Skip to content

Commit e966ad2

Browse files
authored
Media/refactor (#744)
* Media/refactor hooks (#715) * feat(hooks): add media CRUD hooks * fix(hooks): update query invalidation logic for media CRUD directories * fix(hooks): update query invalidation logic for media move * nit: clean up unused variables and copy * fix: update with correct query key params * Media/refactor components (#716) * refactor(Breadcrumb): update Breadcrumb to parse mediaDirectoryName * refactor(Breadcrumb): update BreadcrumbItem to accept onClick argument * fix(Breadcrumb): update CSS and fix typo in resource links * refactor(move): create move components * refactor(move): update page move modal with new components * refactor(media): remove inline queries & upload handler from media select modal * refactor(media): create parent component for media upload input html component * refactor(media): add modal and yep schema validation for media settings * refactor(media): add parent media component for media actions (upload, select, alt-text) * refactor(media): update EditorModals and FormFieldMedia to use parent media component for actions * refactor(media): add media move modal * refactor(media): update FolderCard and MediaCard * refactor(media): update DirectoryCreation and DirectorySettings for media directories support * nit: fix extra ~ in copy for special characters error * chore: update sidebar links for media directories * chore: clean up unused components * chore: add media utils and validators * refactor(media): add medial modal for alt-text input * fix: allow # in media directory names * fix: update handling for retrieved mediaDatas * Media/refactor tests (#717) * chore: update button copy and button ids in tests * chore: add alt text copy for EditPage insert media test * chore: update resource tests for refactored FormFieldMedia component * chore: update images and files tests for refactored Media flows * chore: add waits for flaky test timeouts * chore: fix flaky tests * Media/refactor layouts (#719) * refactor(screens): generalize PageMoveScreen to handle both pages and media * fix: update references to MoveScreen * feat(screens): add MediaCreation and MediaSettings screens * refactor(screens): update DirectoryCreation and DirectorySettings to support media directories * refactor(screens): update DeleteWarning to support media * refactor(Media): update Media layout: - remove inline react query - remove inline upload handler - replace inline states with url params * chore: update frontend routes * fix: add missing variable for ResourceCategory layout * refactor(media): add medial modal for alt-text input * chore: encode media directory link in FolderCard * Media/refactor services (#743) * feat: add media CRUD services * fix(services): update directory services with media endpoints and handlers * fix(services): update mover services with media endpoints * chore: add mediaServices to servicesContext * chore: update documentation of endpoints
1 parent ea308f2 commit e966ad2

File tree

81 files changed

+2208
-3008
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2208
-3008
lines changed

cypress/integration/editPage.spec.js

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,45 +133,61 @@ describe("Edit unlinked page", () => {
133133

134134
it("Edit page (unlinked) should allow user to add existing image", () => {
135135
cy.get(".image").click()
136+
cy.wait(3000)
136137
cy.contains(DEFAULT_IMAGE_TITLE).click()
137-
cy.contains(":button", "Select image").click()
138+
cy.contains(":button", "Select").click()
139+
140+
cy.get("#altText").clear().type("Hello World")
141+
cy.contains(":button", "Save").click()
138142

139143
cy.contains(`/images/${DEFAULT_IMAGE_TITLE}`)
140144
})
141145

142146
it("Edit page (unlinked) should allow user to upload and add existing image", () => {
143147
cy.get(".image").click()
144-
cy.contains(":button", "Add new image").click()
148+
cy.contains(":button", "Add new").click()
145149

146150
cy.get("#file-upload").attachFile(ADDED_IMAGE_PATH)
147-
cy.get("#file-name").clear().type(ADDED_IMAGE_TITLE)
151+
cy.get("#name").clear().type(ADDED_IMAGE_TITLE)
148152
cy.get("button")
149153
.contains(/^Upload$/)
150154
.click()
151155
cy.wait(2000)
152156

157+
cy.contains(":button", "Select").click()
158+
159+
cy.get("#altText").clear().type("Hello World")
160+
cy.contains(":button", "Save").click()
161+
153162
cy.contains(`/images/${ADDED_IMAGE_TITLE}`)
154163
})
155164

156165
it("Edit page (unlinked) should allow user to upload and add new file", () => {
157166
cy.get(".file").click()
158-
cy.contains(":button", "Add new file").click()
167+
cy.contains(":button", "Add new").click()
159168

160169
cy.get("#file-upload").attachFile(ADDED_FILE_PATH)
161-
cy.get("#file-name").clear().type(ADDED_FILE_TITLE)
170+
cy.get("#name").clear().type(ADDED_FILE_TITLE)
162171
cy.get("button")
163172
.contains(/^Upload$/)
164173
.click()
165174
cy.wait(2000)
166175

176+
cy.contains(":button", "Select").click()
177+
178+
cy.get("#altText").clear().type("Hello World")
179+
cy.contains(":button", "Save").click()
180+
167181
cy.contains(`/files/${ADDED_FILE_TITLE}`)
168182
})
169183

170184
it("Edit page (unlinked) should allow user to add existing file", () => {
171185
cy.get(".file").click()
172186
cy.contains(ADDED_FILE_TITLE).click()
173-
cy.contains(":button", "Select file").click()
187+
cy.contains(":button", "Select").click()
174188

189+
cy.get("#altText").clear().type("Hello World")
190+
cy.contains(":button", "Save").click()
175191
cy.contains(`/files/${ADDED_FILE_TITLE}`)
176192
})
177193

@@ -311,16 +327,20 @@ describe("Edit collection page", () => {
311327
it("Edit page (collection) should allow user to add existing image", () => {
312328
cy.get(".image").click()
313329
cy.contains(DEFAULT_IMAGE_TITLE).click()
314-
cy.contains(":button", "Select image").click()
330+
cy.contains(":button", "Select").click()
315331

332+
cy.get("#altText").clear().type("Hello World")
333+
cy.contains(":button", "Save").click()
316334
cy.contains(`/images/${DEFAULT_IMAGE_TITLE}`)
317335
})
318336

319337
it("Edit page (collection) should allow user to add existing file", () => {
320338
cy.get(".file").click()
321339
cy.contains(ADDED_FILE_TITLE).click()
322-
cy.contains(":button", "Select file").click()
340+
cy.contains(":button", "Select").click()
323341

342+
cy.get("#altText").clear().type("Hello World")
343+
cy.contains(":button", "Save").click()
324344
cy.contains(`/files/${ADDED_FILE_TITLE}`)
325345
})
326346

0 commit comments

Comments
 (0)