Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage Release #2821

Merged
merged 22 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1489614
Update modal copy
agalin920 Jul 11, 2024
1766cbc
Update modal copy (#2791)
agalin920 Jul 11, 2024
3c38ca2
Update styling for unresolved image
agalin920 Jul 11, 2024
12e0777
Enhancement/Update styling for unresolved image (#2797)
agalin920 Jul 11, 2024
722b711
Fix/Handle inactive publishings
agalin920 Jul 12, 2024
75e40ac
typo
agalin920 Jul 12, 2024
678fb26
add to prior publishing
agalin920 Jul 12, 2024
68aba50
Added T00:00:00 to the date string to avoid time zone discrepancies
agalin920 Jul 12, 2024
1468ec9
Enhance Sort functionality on multi item table
agalin920 Jul 13, 2024
e583541
Fix/Handle inactive publishings (#2802)
agalin920 Jul 14, 2024
4712976
Merge branch 'dev' into 2808-content-multi-page-table-sort-by-user-de…
agalin920 Jul 15, 2024
3aff2ee
[Content] Sort by fields functionality on multi item table (#2809)
agalin920 Jul 15, 2024
fb719be
Merge branch 'dev' into fix/incorrect-date-shown-on-table
agalin920 Jul 15, 2024
6307546
[Content]Fix/Avoid time zone discrepancies (#2807)
agalin920 Jul 15, 2024
1d6ac6c
Enhancement/Improve multi page table performance on large datasets (#…
agalin920 Jul 17, 2024
90d9a03
resolve-conflicts (#2839)
agalin920 Jul 17, 2024
58913e6
[Schema] Show SEO Meta Fields (#2788)
finnar-bin Jul 17, 2024
fd0d8b7
Fix/Use all item set to resolve item zuids for internal link and rela…
agalin920 Jul 18, 2024
0a358cf
Fix/Hide delete and avoid shortcuts based on permissions (#2841)
agalin920 Jul 19, 2024
b6e457b
[Content] Show error blurb on save button click (#2843)
finnar-bin Jul 19, 2024
cd5c0e2
remove child as selection for a parent model (#2822)
glespinosa Jul 19, 2024
0eec26c
Merge branch 'stage' into dev
shrunyan Jul 19, 2024
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
78 changes: 61 additions & 17 deletions cypress/e2e/schema/field.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,27 @@ describe("Schema: Fields", () => {
cy.waitOn("/bin/1-6c9618c-r26pt/groups", () => {
cy.waitOn("/v1/content/models", () => {
cy.visit("/schema/6-ce80dbfe90-ptjpm6/fields");

cy.getBySelector("create_new_content_item").click();

cy.contains("Multi Page Model").click();
cy.contains("Next").click();
cy.contains("Display Name")
.next()
.type(`Cypress Test Model ${timestamp}`);
cy.get(".MuiDialog-container").within(() => {
cy.contains("Create Model").click();
});
cy.intercept("POST", "/models");
cy.intercept("GET", "/models");
});
});
}
);
});

it("Opens Add Field Modal via button click", () => {
cy.wait(3000);
// Open the modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");
Expand All @@ -89,7 +103,9 @@ describe("Schema: Fields", () => {
const fieldName = `text_${timestamp}`;

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select Text field
Expand Down Expand Up @@ -143,7 +159,9 @@ describe("Schema: Fields", () => {
const fieldName = `dropdown_${timestamp}`;

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select Dropdown field
Expand Down Expand Up @@ -200,7 +218,9 @@ describe("Schema: Fields", () => {
const fieldName = `media_${timestamp}`;

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select Media field
Expand Down Expand Up @@ -232,7 +252,9 @@ describe("Schema: Fields", () => {
const fieldName = `boolean_${timestamp}`;

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select Boolean field
Expand Down Expand Up @@ -284,7 +306,9 @@ describe("Schema: Fields", () => {
const fieldName = `one_to_one_${timestamp}`;

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select one-to-one relationship field
Expand All @@ -301,10 +325,12 @@ describe("Schema: Fields", () => {

cy.wait("@getFields");

cy.wait(3000);

// Select a related field
cy.getBySelector(SELECTORS.AUTOCOMPLETE_FIELED_ZUID)
.should("exist")
.type("title");
.click();
cy.get("[role=listbox] [role=option]").first().click();

// Navigate to rules tab and add default value
Expand Down Expand Up @@ -346,7 +372,9 @@ describe("Schema: Fields", () => {
};

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select number field
Expand Down Expand Up @@ -384,7 +412,9 @@ describe("Schema: Fields", () => {

it("Shows error messages during field creation", () => {
// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select Text field
Expand All @@ -405,7 +435,7 @@ describe("Schema: Fields", () => {
// Click end of list button
cy.getBySelector(SELECTORS.ADD_FIELD_BTN_END_OF_LIST)
.should("exist")
.click();
.click({ force: true });

// Verify modal
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");
Expand All @@ -420,7 +450,7 @@ describe("Schema: Fields", () => {
cy.getBySelector(SELECTORS.ADD_FIELD_BTN_IN_BETWEEN)
.first()
.should("exist")
.click();
.click({ force: true });

// Verify modal
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");
Expand All @@ -432,7 +462,9 @@ describe("Schema: Fields", () => {

it("Switches tabs in Add Field Modal", () => {
// Open the modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select single text field
Expand All @@ -455,7 +487,9 @@ describe("Schema: Fields", () => {

it("Can navigate back to fields selection view", () => {
// Open the modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select single text field
Expand All @@ -475,7 +509,9 @@ describe("Schema: Fields", () => {

it("Can filter fields in field selection view", () => {
// Open the modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Verify that field selection screen is loaded
Expand Down Expand Up @@ -505,7 +541,9 @@ describe("Schema: Fields", () => {
const fieldName = `field_to_filter_${timestamp}`;

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select a field
Expand Down Expand Up @@ -554,7 +592,9 @@ describe("Schema: Fields", () => {
const fieldName = `update_me_${timestamp}`;

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select Text field
Expand Down Expand Up @@ -610,7 +650,9 @@ describe("Schema: Fields", () => {
const fieldName = `deactivate_me_${timestamp}`;

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select Text field
Expand Down Expand Up @@ -669,7 +711,9 @@ describe("Schema: Fields", () => {
const fieldName = `deactivate_me_via_modal_${timestamp}`;

// Open the add field modal
cy.getBySelector(SELECTORS.ADD_FIELD_BTN).should("exist").click();
cy.getBySelector(SELECTORS.ADD_FIELD_BTN)
.should("exist")
.click({ force: true });
cy.getBySelector(SELECTORS.ADD_FIELD_MODAL).should("exist");

// Select Text field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ export const ItemCreate = () => {
} finally {
if (isMounted.current) {
setSaving(false);
setSaveClicked(false);
}
}
};
Expand Down
1 change: 0 additions & 1 deletion src/apps/content-editor/src/app/views/ItemEdit/ItemEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ export default function ItemEdit() {
} finally {
if (isMounted.current) {
setSaving(false);
setSaveClicked(false);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ export const ItemEditHeaderActions = ({
);

const saveShortcut = useMetaKey("s", () => {
if (!canUpdate) return;
if (itemState === ITEM_STATES.dirty) {
onSave();
}
});

const publishShortcut = useMetaKey("p", () => {
if (!canPublish) return;
if (itemState === ITEM_STATES.dirty) {
setPublishAfterSave(true);
onSave();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { useGetDomainsQuery } from "../../../../../../../../shell/services/accou
import { useFilePath } from "../../../../../../../../shell/hooks/useFilePath";
import { DeleteItemDialog } from "./DeleteItemDialog";
import { useGetContentModelsQuery } from "../../../../../../../../shell/services/instance";
import { usePermission } from "../../../../../../../../shell/hooks/use-permissions";

export const MoreMenu = () => {
const { modelZUID, itemZUID } = useParams<{
Expand All @@ -56,6 +57,7 @@ export const MoreMenu = () => {
const { data: contentModels } = useGetContentModelsQuery();
const type =
contentModels?.find((model) => model.ZUID === modelZUID)?.type ?? "";
const canDelete = usePermission("DELETE");

const handleCopyClick = (data: string) => {
navigator?.clipboard
Expand Down Expand Up @@ -179,18 +181,20 @@ export const MoreMenu = () => {
</ListItemIcon>
Edit Template
</MenuItem>
<MenuItem
data-cy="DeleteContentItem"
onClick={() => {
setShowDeleteItemDialog(true);
setAnchorEl(null);
}}
>
<ListItemIcon>
<DeleteRounded />
</ListItemIcon>
Delete Item
</MenuItem>
{canDelete && (
<MenuItem
data-cy="DeleteContentItem"
onClick={() => {
setShowDeleteItemDialog(true);
setAnchorEl(null);
}}
>
<ListItemIcon>
<DeleteRounded />
</ListItemIcon>
Delete Item
</MenuItem>
)}
</Menu>
{showDuplicateItemDialog && (
<DuplicateItemDialog
Expand Down
9 changes: 4 additions & 5 deletions src/apps/content-editor/src/app/views/ItemList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export const ItemList = () => {
const activeLangId =
languages?.find((lang) => lang.code === activeLanguageCode)?.ID || 1;
const [hasMounted, setHasMounted] = useState(false);
const allItems = useSelector((state: AppState) => state.content);
const items = useSelector((state: AppState) =>
selectFilteredItems(state, modelZUID, activeLangId, !hasMounted)
);
Expand Down Expand Up @@ -212,14 +213,12 @@ export const ItemList = () => {
break;
case "internal_link":
case "one_to_one":
// @ts-ignore
clonedItem.data[key] = items?.[value]?.web?.metaTitle || value;
clonedItem.data[key] = allItems?.[value]?.web?.metaTitle || value;
break;
case "one_to_many":
clonedItem.data[key] = value
?.split(",")
// @ts-ignore
?.map((id) => items?.[id]?.web?.metaTitle || id)
?.map((id) => allItems?.[id]?.web?.metaTitle || id)
?.join(",");
break;
case "date":
Expand All @@ -241,7 +240,7 @@ export const ItemList = () => {

return clonedItem;
});
}, [items, fields, users, isFieldsFetching, isUsersFetching]);
}, [items, allItems, fields, users, isFieldsFetching, isUsersFetching]);

const sortedAndFilteredItems = useMemo(() => {
let clonedItems = [...processedItems];
Expand Down
Loading
Loading