diff --git a/src/shared/components/JIRA/JIRA.tsx b/src/shared/components/JIRA/JIRA.tsx index 8d738ebac7..52d55fcbbf 100644 --- a/src/shared/components/JIRA/JIRA.tsx +++ b/src/shared/components/JIRA/JIRA.tsx @@ -317,17 +317,20 @@ const JIRAPluginUI = ({ > ( - - setCreateIssueVisible(true)} - > - Create issue - - setLinkIssueVisible(true)}> - Link issue - - + setCreateIssueVisible(true), + label: 'Create issue', + }, + { + key: 'link', + onClick: () => setLinkIssueVisible(true), + label: 'Link issue', + }, + ]} + /> )} > + items={[ + { + key: 'meta-data', + label: 'Metadata', + }, + { + key: 'files', + label: 'Files', + }, + { + key: 'both', + label: 'Both', + }, + ]} + /> ); const downloadButton = (disabled: boolean) => { diff --git a/src/shared/containers/RemoveTagButtonContainer.tsx b/src/shared/containers/RemoveTagButtonContainer.tsx index 0ff22599f3..db1cb7c493 100644 --- a/src/shared/containers/RemoveTagButtonContainer.tsx +++ b/src/shared/containers/RemoveTagButtonContainer.tsx @@ -75,13 +75,15 @@ const RemoveTagButton: React.FunctionComponent<{ onClick={e => { setConfirm({ visible: true, tagName: e.key.toString(), busy: false }); }} - > - {tags?.map(t => ( - - {t.tag} (revision {t.rev} ) - - ))} - + items={tags?.map(t => ({ + key: t.tag, + label: ( + <> + {t.tag} (revision {t.rev} ) + + ), + }))} + /> ); return ( diff --git a/src/shared/containers/ResourceViewActionsContainer.tsx b/src/shared/containers/ResourceViewActionsContainer.tsx index e420b72658..c79cf9719d 100644 --- a/src/shared/containers/ResourceViewActionsContainer.tsx +++ b/src/shared/containers/ResourceViewActionsContainer.tsx @@ -171,23 +171,23 @@ const ResourceViewActionsContainer: React.FC<{ const revisionMenuItems = React.useMemo( () => ( - - {[...Array(latestResource?._rev).keys()] + k + 1) .sort((a, b) => b - a) - .map(rev => ( - { - goToResource(orgLabel, projectLabel, encodedResourceId, rev); - }} - > - Revision {rev} - {revisionLabels(rev).length > 0 && - ` (${revisionLabels(rev).join(', ')})`} - - ))} - + .map(rev => ({ + key: rev, + onClick: () => + goToResource(orgLabel, projectLabel, encodedResourceId, rev), + label: ( + <> + Revision {rev} + {revisionLabels(rev).length > 0 && + ` (${revisionLabels(rev).join(', ')})`} + + ), + }))} + /> ), [resource, latestResource, tags] ); @@ -244,70 +244,76 @@ const ResourceViewActionsContainer: React.FC<{ } }} dropdownRender={() => ( - - { - const pathToResource = `${basePath}${generatePath( - '/:orgLabel/:projectLabel/resources/:resourceId', - { - orgLabel, - projectLabel, - resourceId: encodedResourceId, - } - )}`; + { + const pathToResource = `${basePath}${generatePath( + '/:orgLabel/:projectLabel/resources/:resourceId', + { + orgLabel, + projectLabel, + resourceId: encodedResourceId, + } + )}`; - triggerCopy( - `${window.location.origin.toString()}${pathToResource}` - ); - }} - > - URL - - { - const pathToResource = `${basePath}${generatePath( - '/:orgLabel/:projectLabel/resources/:resourceId', - { - orgLabel, - projectLabel, - resourceId: encodedResourceId, - } - )}`; + triggerCopy( + `${window.location.origin.toString()}${pathToResource}` + ); + }, + }, + { + key: 'url_with_revision', + label: 'URL (with revision)', + onClick: () => { + const pathToResource = `${basePath}${generatePath( + '/:orgLabel/:projectLabel/resources/:resourceId', + { + orgLabel, + projectLabel, + resourceId: encodedResourceId, + } + )}`; - triggerCopy( - `${window.location.origin.toString()}${pathToResource}?rev=${ - resource._rev - }` - ); - }} - > - URL (with revision) - - triggerCopy(resource['@id'])}> - ID - - - triggerCopy(`${resource['@id']}?rev=${resource._rev}`) - } - > - ID (with revision) - - triggerCopy(self ? self : '')}> - Nexus address - - - triggerCopy( - self - ? `${self}?rev=${resource ? resource._rev : ''}` - : '' - ) - } - > - Nexus address (with revision) - - + triggerCopy( + `${window.location.origin.toString()}${pathToResource}?rev=${ + resource._rev + }` + ); + }, + }, + { + key: 'id', + label: 'ID', + onClick: () => triggerCopy(resource['@id']), + }, + { + key: 'id_with_revision', + label: 'ID (with revision)', + onClick: () => + triggerCopy( + `${resource['@id']}?rev=${resource._rev}` + ), + }, + { + key: 'nexus_address', + label: 'Nexus address', + onClick: () => triggerCopy(self ? self : ''), + }, + { + key: 'nexus_address_with_revision', + label: 'Nexus address (with revision)', + onClick: () => + triggerCopy( + self + ? `${self}?rev=${resource ? resource._rev : ''}` + : '' + ), + }, + ]} + /> )} > {copySuccess ? 'Copied!' : 'Copy'} diff --git a/src/shared/molecules/MyDataHeader/MyDataHeaderFilters/DateFieldSelector.tsx b/src/shared/molecules/MyDataHeader/MyDataHeaderFilters/DateFieldSelector.tsx index c625461dcd..36a2dea9fc 100644 --- a/src/shared/molecules/MyDataHeader/MyDataHeaderFilters/DateFieldSelector.tsx +++ b/src/shared/molecules/MyDataHeader/MyDataHeaderFilters/DateFieldSelector.tsx @@ -29,10 +29,17 @@ const DateFieldSelector = ({ defaultSelectedKeys={['']} selectedKeys={dateField ? [dateField] : undefined} className="my-data-date-type-popover" - > - {dateFieldName.createdAt} - {dateFieldName.updatedAt} - + items={[ + { + key: 'createdAt', + label: dateFieldName.createdAt, + }, + { + key: 'updatedAt', + label: dateFieldName.updatedAt, + }, + ]} + /> ); return ( { const menu = ( - - {addInputTable && ( - - Canvas: Add New Input Table - - )} - {addActivityTable && ( - - Canvas: Add New Activity Table - - )} - - Canvas: Add New Step - {addDataTable && ( - Canvas: Add Data Table - )} - {addCode && ( - - Project: Create New Code Resource - - )} - {addDataset && ( - Project: Add New Dataset - )} - + addInputTable(), + }, + ] + : []), + ...(addActivityTable + ? [ + { + key: 'add_activity_table', + label: 'Canvas: Add New Activity Table', + onClick: () => addActivityTable(), + }, + ] + : []), + { + key: 'add_new_step', + label: 'Canvas: Add New Step', + onClick: () => addNewStep(), + }, + ...(addDataTable + ? [ + { + key: 'add_data_table', + label: 'Canvas: Add Data Table', + onClick: () => addDataTable(), + }, + ] + : []), + ...(addCode + ? [ + { + key: 'add_code', + label: 'Project: Create New Code Resource', + onClick: () => addCode(), + }, + ] + : []), + ...(addDataset + ? [ + { + key: 'add_new_dataset', + label: 'Project: Add New Dataset', + onClick: () => addDataset(), + }, + ] + : []), + ]} + /> ); return ( diff --git a/src/subapps/projects/components/WorkflowSteps/StepCard.tsx b/src/subapps/projects/components/WorkflowSteps/StepCard.tsx index b50220c077..59e4af3e60 100644 --- a/src/subapps/projects/components/WorkflowSteps/StepCard.tsx +++ b/src/subapps/projects/components/WorkflowSteps/StepCard.tsx @@ -180,13 +180,13 @@ const StepCard: React.FC<{ }; const menu = ( - - {Object.values(Status).map(status => ( - - {status} - - ))} - + ({ + key: status, + label: {status}, + }))} + /> ); const enterNewName = () => {