diff --git a/app/cypress/e2e/forms/directory-search.cy.js b/app/cypress/e2e/forms/directory-search.cy.js index 4c53c7a4..0797c377 100644 --- a/app/cypress/e2e/forms/directory-search.cy.js +++ b/app/cypress/e2e/forms/directory-search.cy.js @@ -67,26 +67,10 @@ describe('DirectorySearch Integration Tests', () => { } }).as('getDomain'); - cy.intercept('GET', '/api/collections?kind=domain', { - statusCode: 200, - body: { - collections: [], - totals: {collections: 0}, - metadata: { - kind: 'domain', - columns: [], - fields: [ - {key: 'directory', label: 'Directory', type: 'text', required: false} - ], - routes: {}, - messages: {} - } - } - }).as('getMetadata'); - cy.visit('/archive/domain/1/edit'); cy.wait('@getDomain'); - cy.wait('@getMetadata'); + // Wait for initial directory search API call (component makes call on mount) + cy.wait('@searchDirectories'); }); it('types in search box and sees results', () => { @@ -182,26 +166,10 @@ describe('DirectorySearch Integration Tests', () => { } }).as('getDomain'); - cy.intercept('GET', '/api/collections?kind=domain', { - statusCode: 200, - body: { - collections: [], - totals: {collections: 0}, - metadata: { - kind: 'domain', - columns: [], - fields: [ - {key: 'directory', label: 'Directory', type: 'text', required: true} - ], - routes: {}, - messages: {} - } - } - }).as('getMetadata'); - cy.visit('/archive/domain/2/edit'); cy.wait('@getDomain'); - cy.wait('@getMetadata'); + // Wait for initial directory search API call (component makes call on mount) + cy.wait('@searchDirectories'); }); it('starts with existing directory value', () => { @@ -262,26 +230,10 @@ describe('DirectorySearch Integration Tests', () => { } }).as('getDomain'); - cy.intercept('GET', '/api/collections?kind=domain', { - statusCode: 200, - body: { - collections: [], - totals: {collections: 0}, - metadata: { - kind: 'domain', - columns: [], - fields: [ - {key: 'directory', label: 'Directory', type: 'text', required: false} - ], - routes: {}, - messages: {} - } - } - }).as('getMetadata'); - cy.visit('/archive/domain/3/edit'); cy.wait('@getDomain'); - cy.wait('@getMetadata'); + // Wait for initial directory search API call (component makes call on mount) + cy.wait('@searchDirectories'); // Type path that returns empty results cy.contains('label', 'Directory') diff --git a/app/cypress/support/component.js b/app/cypress/support/component.js index c229045a..03b30c0a 100644 --- a/app/cypress/support/component.js +++ b/app/cypress/support/component.js @@ -36,6 +36,7 @@ Cypress.Commands.add('mountWithRouter', (component, options) => { + diff --git a/app/src/components/Archive.js b/app/src/components/Archive.js index 1d10af19..e5839dde 100644 --- a/app/src/components/Archive.js +++ b/app/src/components/Archive.js @@ -5,11 +5,13 @@ import { CardHeader, CardMeta, Container, + Form, GridColumn, GridRow, Image, Input, TableCell, + TextArea, } from "semantic-ui-react"; import { APIButton, @@ -56,6 +58,7 @@ import {API_ARCHIVE_UPLOAD_URI, Downloaders} from "./Vars"; import {CollectionTable} from "./collections/CollectionTable"; import {CollectionEditForm} from "./collections/CollectionEditForm"; import {RecurringDownloadsTable} from "./admin/Downloads"; +import {DestinationForm} from "./Download"; function archiveFileLink(path, directory = false) { if (path) { @@ -429,18 +432,6 @@ export function DomainsPage() { ; } -// Domain form field configuration -const DOMAIN_FIELDS = [ - {key: 'directory', label: 'Directory', type: 'directory', placeholder: 'Optional directory path'}, - // tag_name field is handled via modal button, not inline in form - {key: 'description', label: 'Description', type: 'textarea', placeholder: 'Optional description'} -]; - -const DOMAIN_MESSAGES = { - no_directory: 'Set a directory to enable tagging', - tag_will_move: 'Tagging will move files to a new directory' -}; - export function DomainEditPage() { const {domainId} = useParams(); const navigate = useNavigate(); @@ -561,17 +552,41 @@ export function DomainEditPage() { {tagButton} ; + const [descriptionProps] = form.getCustomProps({name: 'description', path: 'description'}); + return <> + > + + + + + + + + + +