Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/api/update-category/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ query CategoryFull($relativePath: String!) {
body
created
createdBy
createdByEmail
lastUpdated
lastUpdatedBy
lastUpdatedByEmail
isArchived
archivedreason
index {
Expand Down Expand Up @@ -53,10 +51,8 @@ query CategoryFullNoIndex($relativePath: String!) {
body
created
createdBy
createdByEmail
lastUpdated
lastUpdatedBy
lastUpdatedByEmail
isArchived
archivedreason
}
Expand Down
4 changes: 0 additions & 4 deletions app/api/update-category/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ export type CategoryRuleIndexItem = {
body?: string;
created?: string;
createdBy?: string;
createdByEmail?: string;
lastUpdated?: string;
lastUpdatedBy?: string;
lastUpdatedByEmail?: string;
isArchived?: boolean;
archivedreason?: string;
};
Expand All @@ -59,10 +57,8 @@ export type CategoryRuleIndexItem = {
body?: string;
created?: string;
createdBy?: string;
createdByEmail?: string;
lastUpdated?: string;
lastUpdatedBy?: string;
lastUpdatedByEmail?: string;
isArchived?: boolean;
archivedreason?: string;
index?: CategoryIndexItem[];
Expand Down
2 changes: 0 additions & 2 deletions app/api/update-category/update-the-category-rule-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,8 @@ function buildCategoryParams(currentCategory: CategoryFullQueryResponse["categor
body: currentCategory?.body,
created: currentCategory?.created,
createdBy: currentCategory?.createdBy,
createdByEmail: currentCategory?.createdByEmail,
lastUpdated: currentCategory?.lastUpdated,
lastUpdatedBy: currentCategory?.lastUpdatedBy,
lastUpdatedByEmail: currentCategory?.lastUpdatedByEmail,
isArchived: currentCategory?.isArchived,
archivedreason: currentCategory?.archivedreason,
index: newIndex,
Expand Down
1 change: 0 additions & 1 deletion tina/collection/rule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const Rule: Collection = {
guid: generateGuid(),
created: new Date().toISOString(),
createdBy: "Unknown",
createdByEmail: "Unknown",
filename: "rule",
body: defaultBody,
};
Expand Down
9 changes: 0 additions & 9 deletions tina/collection/shared/createdInfoFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,4 @@ export const createdInfoFields: TinaField[] = [
component: UserInfoField,
},
},
{
type: "string",
name: "createdByEmail",
label: "Created By Email",
description: "If you see this field, contact a dev immediately 😳 (should be a hidden field generated in the background).",
ui: {
component: UserInfoField,
},
},
];
14 changes: 0 additions & 14 deletions tina/collection/shared/historyFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ export const historyFields: TinaField[] = [
component: "hidden",
},
},
{
type: "string",
name: "lastUpdatedByEmail",
label: "Last Updated By Email",
description: "If you see this field, contact a dev immediately 😳 (should be a hidden field generated in the background).",
ui: {
component: "hidden",
},
},
{
type: "boolean",
name: "isArchived",
Expand Down Expand Up @@ -74,7 +65,6 @@ export const historyBeforeSubmit = async ({ form, cms, values }: { form: Form; c
values = { ...values, uri: values.uri.trim() };
}

let userEmail: string | undefined;
let userName: string | undefined;

// Update categories for both create and update forms
Expand Down Expand Up @@ -154,12 +144,10 @@ export const historyBeforeSubmit = async ({ form, cms, values }: { form: Form; c
try {
const user = await cms.api.tina?.authProvider?.getUser();
if (user) {
userEmail = user.email;
userName = user.fullName;
}
} catch (err) {
console.error("Auth error:", err);
userEmail = undefined;
userName = undefined;
}

Expand All @@ -168,14 +156,12 @@ export const historyBeforeSubmit = async ({ form, cms, values }: { form: Form; c
...values,
lastUpdated: new Date().toISOString(),
lastUpdatedBy: userName ?? "",
lastUpdatedByEmail: userEmail ?? "",
};
}

return {
...values,
lastUpdated: new Date().toISOString(),
lastUpdatedBy: userName ?? "",
lastUpdatedByEmail: userEmail ?? "",
};
};
2 changes: 1 addition & 1 deletion tina/fields/UserInfoField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const UserInfoField = wrapFieldsWithMeta((props: any) => {
try {
const user = await cms.api?.tina?.authProvider?.getUser();
if (user) {
const value = field.name === "createdByEmail" ? user.email || "Unknown" : user.fullName || "Unknown";
const value = user.fullName || "Unknown";

// Update the form field value
input.onChange(value);
Expand Down
4 changes: 0 additions & 4 deletions tina/queries/queries.gql
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,8 @@ query ruleData($relativePath: String!) {
seoDescription
created
createdBy
createdByEmail
lastUpdated
lastUpdatedBy
lastUpdatedByEmail
isArchived
archivedreason
sidebarVideo
Expand Down Expand Up @@ -386,10 +384,8 @@ query ruleDataBasic($relativePath: String!) {
seoDescription
created
createdBy
createdByEmail
lastUpdated
lastUpdatedBy
lastUpdatedByEmail
isArchived
archivedreason
sidebarVideo
Expand Down
2 changes: 1 addition & 1 deletion tina/tina-lock.json

Large diffs are not rendered by default.