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

[Content] Create new item from one to many field #3203

Open
wants to merge 80 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
b3beff0
task: create new component
finnar-bin Jan 7, 2025
1697f0c
task: show model name
finnar-bin Jan 7, 2025
66479bf
task: create active item component
finnar-bin Jan 8, 2025
c0a9363
task: update loading skeleton
finnar-bin Jan 8, 2025
f9bec07
task: show image
finnar-bin Jan 9, 2025
70829a4
task: updated logic for margin
finnar-bin Jan 9, 2025
c900cd8
task: version chips
finnar-bin Jan 9, 2025
ff58f3c
task: wire edit item
finnar-bin Jan 9, 2025
a00974b
task: create more menu
finnar-bin Jan 9, 2025
842fb9d
task: item sorting
finnar-bin Jan 10, 2025
dd2da81
task: limit to only 5 shown
finnar-bin Jan 10, 2025
71eb106
Merge branch 'dev' into enhancement/one-to-one-many-revamp
finnar-bin Jan 13, 2025
5ec9ff6
task: field selector and sort by filter
finnar-bin Jan 14, 2025
02ccc7a
task: add remaining filters
finnar-bin Jan 14, 2025
d1f3828
task: create table base
finnar-bin Jan 15, 2025
6426197
Merge branch 'dev' into enhancement/one-to-one-many-revamp
finnar-bin Jan 15, 2025
4f079a3
task: setup row items
finnar-bin Jan 15, 2025
4dfb6b2
Merge branch 'dev' into enhancement/one-to-one-many-revamp
finnar-bin Jan 15, 2025
fdc3482
Merge branch 'dev' into enhancement/one-to-one-many-revamp
finnar-bin Jan 16, 2025
12038dd
task: render image cell
finnar-bin Jan 16, 2025
d2350f8
task: optimize image loading
finnar-bin Jan 16, 2025
83849ce
Merge branch 'dev' into enhancement/one-to-one-many-revamp
finnar-bin Jan 16, 2025
f72dafd
task: extract to own component
finnar-bin Jan 17, 2025
9a6eadd
task: version cell
finnar-bin Jan 17, 2025
e4d0fb4
task: skeleton loader
finnar-bin Jan 17, 2025
e23ada7
task: wire search items
finnar-bin Jan 17, 2025
a45aa1f
Merge branch 'dev' into enhancement/one-to-one-many-revamp
finnar-bin Jan 17, 2025
4d7e0d4
task: no search results
finnar-bin Jan 20, 2025
5c9a999
task: wire item selection
finnar-bin Jan 20, 2025
91e19f3
task: dynamic dialog header
finnar-bin Jan 20, 2025
a6d6d25
chore: optimized filter state
finnar-bin Jan 20, 2025
bf53163
chore: cleanup
finnar-bin Jan 20, 2025
b92fcc1
task: handle deleted items
finnar-bin Jan 20, 2025
89ed0bd
task: preserve selected items when filtering
finnar-bin Jan 21, 2025
eab199d
task: hide version cell if content does not exist
finnar-bin Jan 21, 2025
d232db6
task: use redux store
finnar-bin Jan 21, 2025
b83c89e
task: sorting
finnar-bin Jan 21, 2025
56c8415
task: add sort logic
finnar-bin Jan 22, 2025
9710e09
task: per field sorting
finnar-bin Jan 22, 2025
941c588
task: field filtering logic
finnar-bin Jan 22, 2025
eae27d7
task: update logic for when to show the no results component
finnar-bin Jan 22, 2025
a7b9d5f
Simplify selection handling and filter deleted items.
finnar-bin Jan 23, 2025
36a88eb
Add publish functionality and enhance ConfirmPublishModal
finnar-bin Jan 23, 2025
7afe7d4
Add support for scheduling content publishing
finnar-bin Jan 23, 2025
ba96cb5
Refactor ActiveItem to handle deleted content items gracefully
finnar-bin Jan 23, 2025
ef622f1
Add copy ZUID functionality to ActiveItem menu
finnar-bin Jan 23, 2025
46261d7
Add dynamic preview URLs for Draft and Production
finnar-bin Jan 23, 2025
0536154
Merge branch 'dev' into enhancement/one-to-one-many-revamp
finnar-bin Jan 27, 2025
806e9a1
Add onRemoveCard functionality to ActiveItem component
finnar-bin Jan 28, 2025
e9bfa57
Add loading state handling to RelationalFieldBase component
finnar-bin Jan 28, 2025
a135ab4
Add unpublished related items list to ConfirmPublishModal
finnar-bin Jan 28, 2025
5d8dacb
Refactor unpublished related items handling in ItemEditHeaderActions …
finnar-bin Jan 28, 2025
78aa1c6
Enhance UnpublishedRelatedItem component with image handling and impr…
finnar-bin Jan 30, 2025
5df5019
Add related items selection handling to ConfirmPublishModal and ItemE…
finnar-bin Jan 30, 2025
60ad729
Add support for publishing multiple related items in ItemEditHeaderAc…
finnar-bin Jan 30, 2025
76aab65
Add scheduling check to draft version comparison in ItemEditHeaderAct…
finnar-bin Jan 30, 2025
310a48f
Merge branch 'dev' into enhancement/one-to-one-many-revamp
finnar-bin Jan 31, 2025
6cdac8a
Add validation for 'one_to_many' field to limit item selection to 255…
finnar-bin Jan 31, 2025
1d7fb2b
Refactor selection model handling in FieldSelectorDialog to enforce s…
finnar-bin Jan 31, 2025
dc2c6cd
Refactor ActiveItem component to disable edit button when contentItem…
finnar-bin Jan 31, 2025
e21aceb
Merge branch 'dev' into enhancement/one-to-one-many-revamp
finnar-bin Feb 4, 2025
087863f
Add Cypress tests for one-to-one and one-to-many relational fields; e…
finnar-bin Feb 4, 2025
6d3cd7e
Add create and add new button
finnar-bin Feb 5, 2025
436d9f1
Load content editor in dialog
finnar-bin Feb 5, 2025
559a4b1
Enhance Content Editor and Header components for dialog support; add …
finnar-bin Feb 5, 2025
f58fcc7
Optimize fields
finnar-bin Feb 5, 2025
9e564d9
resolve merge conflicts
finnar-bin Feb 5, 2025
0f3e5f5
Filter out draft items
finnar-bin Feb 6, 2025
047b0fc
Dispatch event when new item is successfully created via dialog
finnar-bin Feb 6, 2025
a18b66a
Add newly-created item from dialog to the selected zuid list
finnar-bin Feb 6, 2025
88710a0
Hide Create & Add New button when field is rendered in the create & a…
finnar-bin Feb 6, 2025
18b23b4
Disable buttons when model has been deleted
finnar-bin Feb 6, 2025
6a1f39c
Add test for creating and adding a new item in one-to-many field
finnar-bin Feb 11, 2025
c87c1ff
Merge branch 'dev' into enhancement/2937-create-new-item-from-one-to-…
finnar-bin Feb 12, 2025
5253bad
Refactor one-to-many field context and remove unused props from Inter…
finnar-bin Feb 12, 2025
ab9da28
Merge branch 'dev' into enhancement/2937-create-new-item-from-one-to-…
finnar-bin Feb 14, 2025
425a330
Merge branch 'dev' into enhancement/2937-create-new-item-from-one-to-…
finnar-bin Feb 19, 2025
c88f272
[Content] Add CreateContentItemDialogProvider and integrate into Item…
finnar-bin Feb 19, 2025
335e2a1
Refactor RelationalFieldBase to use fieldLabel for button text
finnar-bin Feb 19, 2025
3ec7611
Merge branch 'dev' into enhancement/2937-create-new-item-from-one-to-…
finnar-bin Feb 26, 2025
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
21 changes: 21 additions & 0 deletions cypress/e2e/content/content.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,5 +536,26 @@ describe("Content Specs", () => {
2
);
});

it("can create & add new item", () => {
cy.get(
"#12-269a28-1bkm34 [data-cy='create-new-relational-item-button']"
).click({
force: true,
});

cy.get("#12-d6e4c1d797-sjv628", { retries: 1 })
.find("input")
.type(`Test Item ${TIMESTAMP}`);
cy.get("#12-aaa5ce87e3-89whjq")
.find("textarea")
.first()
.type(`Test Item ${TIMESTAMP}`);
cy.getBySelector("CreateItemSaveButton").click();

cy.get("#12-269a28-1bkm34 [data-cy='active-relational-item']", {
retries: 1,
}).should("have.length", 3);
});
});
});
21 changes: 13 additions & 8 deletions src/apps/content-editor/src/app/ContentEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ResizableContainer } from "../../../../shell/components/ResizeableConta
import { StagedChangesProvider } from "./views/ItemList/StagedChangesContext";
import { SelectedItemsProvider } from "./views/ItemList/SelectedItemsContext";
import { TableSortProvider } from "./views/ItemList/TableSortProvider";
import { useParams } from "../../../../shell/hooks/useParams";

// Makes sure that other apps using legacy theme does not get affected with the palette
export let customTheme = createTheme(legacyTheme, {
Expand Down Expand Up @@ -101,6 +102,7 @@ export let customTheme = createTheme(legacyTheme, {
export default function ContentEditor() {
const navContent = useSelector((state) => state.navContent);
const dispatch = useDispatch();
const [params] = useParams();

const [loading, setLoading] = useState(true);

Expand Down Expand Up @@ -133,14 +135,17 @@ export default function ContentEditor() {
</div>
) : (
<section className={cx(styles.ContentEditor)}>
<ResizableContainer
id="contentNav"
defaultWidth={220}
minWidth={220}
maxWidth={360}
>
<ContentNav />
</ResizableContainer>
{params.get("isDialog") !== "true" && (
<ResizableContainer
id="contentNav"
defaultWidth={220}
minWidth={220}
maxWidth={360}
>
<ContentNav />
</ResizableContainer>
)}

<div className={cx(styles.Content)}>
<div className={styles.ContentWrap}>
<Switch>
Expand Down
Loading
Loading