[arvados-workbench2] updated: 2.4.2-2-ga0877e64
git repository hosting
git at public.arvados.org
Mon Sep 19 17:52:15 UTC 2022
Summary of changes:
cypress/integration/project.spec.js | 2 +-
cypress/integration/search.spec.js | 156 ++++++++++++++++++++-
cypress/integration/user-profile.spec.js | 2 +-
src/common/redirect-to.ts | 10 +-
src/components/code-snippet/code-snippet.tsx | 4 +-
src/store/advanced-tab/advanced-tab.tsx | 27 ++--
.../advanced-tab-dialog/advanced-tab-dialog.tsx | 24 ++--
.../api-client-authorization-action-set.ts | 2 +-
.../action-sets/collection-action-set.ts | 2 +-
.../context-menu/action-sets/group-action-set.ts | 2 +-
.../action-sets/group-member-action-set.ts | 4 +-
.../action-sets/keep-service-action-set.ts | 2 +-
.../context-menu/action-sets/link-action-set.ts | 2 +-
.../action-sets/process-resource-action-set.ts | 2 +-
.../context-menu/action-sets/project-action-set.ts | 2 +-
.../action-sets/repository-action-set.ts | 2 +-
.../context-menu/action-sets/ssh-key-action-set.ts | 2 +-
.../action-sets/trashed-collection-action-set.ts | 2 +-
.../context-menu/action-sets/user-action-set.ts | 2 +-
.../action-sets/virtual-machine-action-set.ts | 2 +-
20 files changed, 212 insertions(+), 41 deletions(-)
via a0877e643ad4b54846849f8c24501d15d2cdccd6 (commit)
via f778abd3ea3c3a525419ed1bc2c0c63edb335405 (commit)
from 75ce74fad69511374162b679072a88a42253a7ee (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit a0877e643ad4b54846849f8c24501d15d2cdccd6
Author: Stephen Smith <stephen at curii.com>
Date: Tue Sep 6 09:56:26 2022 -0400
Merge branch '19383-advanced-dialog' into main. Closes #19383
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/cypress/integration/project.spec.js b/cypress/integration/project.spec.js
index b2f6f33d..9c5e791c 100644
--- a/cypress/integration/project.spec.js
+++ b/cypress/integration/project.spec.js
@@ -301,7 +301,7 @@ describe('Project tests', function() {
cy.get('main').contains(projectName).rightclick();
- cy.get('[data-cy=context-menu]').contains('Advanced').click();
+ cy.get('[data-cy=context-menu]').contains('API Details').click();
cy.get('[role=tablist]').contains('METADATA').click();
diff --git a/cypress/integration/search.spec.js b/cypress/integration/search.spec.js
index 5434ca24..da33c7df 100644
--- a/cypress/integration/search.spec.js
+++ b/cypress/integration/search.spec.js
@@ -126,4 +126,158 @@ describe('Search tests', function() {
});
});
});
-});
\ No newline at end of file
+
+ it('shows search context menu', function() {
+ const colName = `Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
+ const federatedColName = `Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
+ const federatedColUuid = "xxxxx-4zz18-000000000000000";
+
+ // Intercept config to insert remote cluster
+ cy.intercept({method: 'GET', hostname: 'localhost', url: '**/arvados/v1/config?nocache=*'}, (req) => {
+ req.reply((res) => {
+ res.body.RemoteClusters = {
+ "*": res.body.RemoteClusters["*"],
+ "xxxxx": {
+ "ActivateUsers": true,
+ "Host": "xxxxx.fakecluster.tld",
+ "Insecure": false,
+ "Proxy": true,
+ "Scheme": ""
+ }
+ };
+ });
+ });
+
+ // Fake remote cluster config
+ cy.intercept(
+ {
+ method: "GET",
+ hostname: "xxxxx.fakecluster.tld",
+ url: "**/arvados/v1/config",
+ },
+ {
+ statusCode: 200,
+ body: {
+ API: {},
+ ClusterID: "xxxxx",
+ Collections: {},
+ Containers: {},
+ InstanceTypes: {},
+ Login: {},
+ Mail: { SupportEmailAddress: "arvados at example.com" },
+ RemoteClusters: {
+ "*": {
+ ActivateUsers: false,
+ Host: "",
+ Insecure: false,
+ Proxy: false,
+ Scheme: "https",
+ },
+ },
+ Services: {
+ Composer: { ExternalURL: "" },
+ Controller: { ExternalURL: "https://xxxxx.fakecluster.tld:34763/" },
+ DispatchCloud: { ExternalURL: "" },
+ DispatchLSF: { ExternalURL: "" },
+ DispatchSLURM: { ExternalURL: "" },
+ GitHTTP: { ExternalURL: "https://xxxxx.fakecluster.tld:39105/" },
+ GitSSH: { ExternalURL: "" },
+ Health: { ExternalURL: "https://xxxxx.fakecluster.tld:42915/" },
+ Keepbalance: { ExternalURL: "" },
+ Keepproxy: { ExternalURL: "https://xxxxx.fakecluster.tld:46773/" },
+ Keepstore: { ExternalURL: "" },
+ RailsAPI: { ExternalURL: "" },
+ WebDAV: { ExternalURL: "https://xxxxx.fakecluster.tld:36041/" },
+ WebDAVDownload: { ExternalURL: "https://xxxxx.fakecluster.tld:42957/" },
+ WebShell: { ExternalURL: "" },
+ Websocket: { ExternalURL: "wss://xxxxx.fakecluster.tld:37121/websocket" },
+ Workbench1: { ExternalURL: "https://wb1.xxxxx.fakecluster.tld/" },
+ Workbench2: { ExternalURL: "https://wb2.xxxxx.fakecluster.tld/" },
+ },
+ StorageClasses: {
+ default: { Default: true, Priority: 0 },
+ },
+ Users: {},
+ Volumes: {},
+ Workbench: {},
+ },
+ }
+ );
+
+ cy.createCollection(adminUser.token, {
+ name: colName,
+ owner_uuid: activeUser.user.uuid,
+ preserve_version: true,
+ manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
+ }).then(function(testCollection) {
+ cy.loginAs(activeUser);
+
+ // Intercept search results to add federated result
+ cy.intercept({method: 'GET', url: '**/arvados/v1/groups/contents?*'}, (req) => {
+ req.reply((res) => {
+ res.body.items = [
+ res.body.items[0],
+ {
+ ...res.body.items[0],
+ uuid: federatedColUuid,
+ portable_data_hash: "00000000000000000000000000000000+0",
+ name: federatedColName,
+ href: res.body.items[0].href.replace(testCollection.uuid, federatedColUuid),
+ }
+ ];
+ res.body.items_available += 1;
+ });
+ });
+
+ cy.doSearch(colName);
+
+ // Stub new window
+ cy.window().then(win => {
+ cy.stub(win, 'open').as('Open')
+ });
+
+ // Check copy to clipboard
+ cy.get('[data-cy=search-results]').contains(colName).rightclick();
+ cy.get('[data-cy=context-menu]').within((ctx) => {
+ // Check that there are 4 items in the menu
+ cy.get(ctx).children().should('have.length', 4);
+ cy.contains('API Details');
+ cy.contains('Copy to clipboard');
+ cy.contains('Open in new tab');
+ cy.contains('View details');
+
+ cy.contains('Copy to clipboard').click();
+ cy.window().then((win) => (
+ win.navigator.clipboard.readText().then((text) => {
+ expect(text).to.match(new RegExp(`/collections/${testCollection.uuid}$`));
+ })
+ ));
+ });
+
+ // Check open in new tab
+ cy.get('[data-cy=search-results]').contains(colName).rightclick();
+ cy.get('[data-cy=context-menu]').within(() => {
+ cy.contains('Open in new tab').click();
+ cy.get('@Open').should('have.been.calledOnceWith', `${window.location.origin}/collections/${testCollection.uuid}`)
+ });
+
+ // Check federated result copy to clipboard
+ cy.get('[data-cy=search-results]').contains(federatedColName).rightclick();
+ cy.get('[data-cy=context-menu]').within(() => {
+ cy.contains('Copy to clipboard').click();
+ cy.window().then((win) => (
+ win.navigator.clipboard.readText().then((text) => {
+ expect(text).to.equal(`https://wb2.xxxxx.fakecluster.tld/collections/${federatedColUuid}`);
+ })
+ ));
+ });
+ // Check open in new tab
+ cy.get('[data-cy=search-results]').contains(federatedColName).rightclick();
+ cy.get('[data-cy=context-menu]').within(() => {
+ cy.contains('Open in new tab').click();
+ cy.get('@Open').should('have.been.calledWith', `https://wb2.xxxxx.fakecluster.tld/collections/${federatedColUuid}`)
+ });
+
+ });
+ });
+});
diff --git a/cypress/integration/user-profile.spec.js b/cypress/integration/user-profile.spec.js
index 7d21249c..d91dbb0b 100644
--- a/cypress/integration/user-profile.spec.js
+++ b/cypress/integration/user-profile.spec.js
@@ -76,7 +76,7 @@ describe('User profile tests', function() {
}) {
cy.get('[data-cy=user-profile-panel-options-btn]').click();
cy.get('[data-cy=context-menu]').within(() => {
- cy.get('[role=button]').contains('Advanced');
+ cy.get('[role=button]').contains('API Details');
cy.get('[role=button]').should(account ? 'contain' : 'not.contain', 'Account Settings');
cy.get('[role=button]').should(activate ? 'contain' : 'not.contain', 'Activate User');
diff --git a/src/components/code-snippet/code-snippet.tsx b/src/components/code-snippet/code-snippet.tsx
index 83c378b8..5a5a7041 100644
--- a/src/components/code-snippet/code-snippet.tsx
+++ b/src/components/code-snippet/code-snippet.tsx
@@ -30,6 +30,7 @@ export interface CodeSnippetDataProps {
className?: string;
apiResponse?: boolean;
linked?: boolean;
+ children?: JSX.Element;
}
interface CodeSnippetAuthProps {
@@ -43,11 +44,12 @@ const mapStateToProps = (state: RootState): CodeSnippetAuthProps => ({
});
export const CodeSnippet = withStyles(styles)(connect(mapStateToProps)(
- ({ classes, lines, linked, className, apiResponse, dispatch, auth }: CodeSnippetProps & CodeSnippetAuthProps & DispatchProp) =>
+ ({ classes, lines, linked, className, apiResponse, dispatch, auth, children }: CodeSnippetProps & CodeSnippetAuthProps & DispatchProp) =>
<Typography
component="div"
className={classNames(classes.root, className)}>
<Typography className={apiResponse ? classes.space : className} component="pre">
+ {children}
{linked ?
lines.map((line, index) => <React.Fragment key={index}>{renderLinks(auth, dispatch)(line)}{`\n`}</React.Fragment>) :
lines.join('\n')
diff --git a/src/store/advanced-tab/advanced-tab.tsx b/src/store/advanced-tab/advanced-tab.tsx
index 61fd705a..ac088f02 100644
--- a/src/store/advanced-tab/advanced-tab.tsx
+++ b/src/store/advanced-tab/advanced-tab.tsx
@@ -26,8 +26,9 @@ import React from 'react';
export const ADVANCED_TAB_DIALOG = 'advancedTabDialog';
-interface AdvancedTabDialogData {
- apiResponse: any;
+export interface AdvancedTabDialogData {
+ uuid: string;
+ apiResponse: JSX.Element;
metadata: ListResults<LinkResource> | string;
user: UserResource | string;
pythonHeader: string;
@@ -290,7 +291,7 @@ interface AdvancedTabData {
uuid: string;
metadata: ListResults<LinkResource> | string;
user: UserResource | string;
- apiResponseKind: any;
+ apiResponseKind: (apiResponse) => JSX.Element;
data: AdvanceResponseData;
resourceKind: AdvanceResourceKind;
resourcePrefix: AdvanceResourcePrefix;
@@ -370,7 +371,7 @@ const stringify = (item: string | null | number | boolean) =>
const stringifyObject = (item: any) =>
JSON.stringify(item, null, 2) || 'null';
-const containerRequestApiResponse = (apiResponse: ContainerRequestResource) => {
+const containerRequestApiResponse = (apiResponse: ContainerRequestResource): JSX.Element => {
const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, description, properties, state, requestingContainerUuid, containerUuid,
containerCountMax, mounts, runtimeConstraints, containerImage, environment, cwd, command, outputPath, priority, expiresAt, filters, containerCount,
useExisting, schedulingParameters, outputUuid, logUuid, outputName, outputTtl } = apiResponse;
@@ -409,7 +410,7 @@ const containerRequestApiResponse = (apiResponse: ContainerRequestResource) => {
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
-const collectionApiResponse = (apiResponse: CollectionResource) => {
+const collectionApiResponse = (apiResponse: CollectionResource): JSX.Element => {
const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, description, properties, portableDataHash, replicationDesired,
replicationConfirmedAt, replicationConfirmed, deleteAt, trashAt, isTrashed, storageClassesDesired,
storageClassesConfirmed, storageClassesConfirmedAt, currentVersionUuid, version, preserveVersion, fileCount, fileSizeTotal } = apiResponse;
@@ -442,7 +443,7 @@ const collectionApiResponse = (apiResponse: CollectionResource) => {
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
-const groupRequestApiResponse = (apiResponse: ProjectResource) => {
+const groupRequestApiResponse = (apiResponse: ProjectResource): JSX.Element => {
const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, description, groupClass, trashAt, isTrashed, deleteAt, properties, writableBy } = apiResponse;
const response = `
"uuid": "${uuid}",
@@ -463,7 +464,7 @@ const groupRequestApiResponse = (apiResponse: ProjectResource) => {
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
-const repositoryApiResponse = (apiResponse: RepositoryResource) => {
+const repositoryApiResponse = (apiResponse: RepositoryResource): JSX.Element => {
const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, cloneUrls } = apiResponse;
const response = `
"uuid": "${uuid}",
@@ -478,7 +479,7 @@ const repositoryApiResponse = (apiResponse: RepositoryResource) => {
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
-const sshKeyApiResponse = (apiResponse: SshKeyResource) => {
+const sshKeyApiResponse = (apiResponse: SshKeyResource): JSX.Element => {
const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, authorizedUserUuid, expiresAt } = apiResponse;
const response = `
"uuid": "${uuid}",
@@ -493,7 +494,7 @@ const sshKeyApiResponse = (apiResponse: SshKeyResource) => {
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
-const virtualMachineApiResponse = (apiResponse: VirtualMachinesResource) => {
+const virtualMachineApiResponse = (apiResponse: VirtualMachinesResource): JSX.Element => {
const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, hostname } = apiResponse;
const response = `
"hostname": ${stringify(hostname)},
@@ -508,7 +509,7 @@ const virtualMachineApiResponse = (apiResponse: VirtualMachinesResource) => {
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
-const keepServiceApiResponse = (apiResponse: KeepServiceResource) => {
+const keepServiceApiResponse = (apiResponse: KeepServiceResource): JSX.Element => {
const {
uuid, readOnly, serviceHost, servicePort, serviceSslFlag, serviceType,
ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid
@@ -529,7 +530,7 @@ const keepServiceApiResponse = (apiResponse: KeepServiceResource) => {
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
-const userApiResponse = (apiResponse: UserResource) => {
+const userApiResponse = (apiResponse: UserResource): JSX.Element => {
const {
uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid,
email, firstName, lastName, username, isActive, isAdmin, prefs, defaultOwnerUuid,
@@ -554,7 +555,7 @@ const userApiResponse = (apiResponse: UserResource) => {
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
-const apiClientAuthorizationApiResponse = (apiResponse: ApiClientAuthorization) => {
+const apiClientAuthorizationApiResponse = (apiResponse: ApiClientAuthorization): JSX.Element => {
const {
uuid, ownerUuid, apiToken, apiClientId, userId, createdByIpAddress, lastUsedByIpAddress,
lastUsedAt, expiresAt, defaultOwnerUuid, scopes, updatedAt, createdAt
@@ -577,7 +578,7 @@ const apiClientAuthorizationApiResponse = (apiResponse: ApiClientAuthorization)
return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
};
-const linkApiResponse = (apiResponse: LinkResource) => {
+const linkApiResponse = (apiResponse: LinkResource): JSX.Element => {
const {
uuid, name, headUuid, properties, headKind, tailUuid, tailKind, linkClass,
ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid
diff --git a/src/views-components/advanced-tab-dialog/advanced-tab-dialog.tsx b/src/views-components/advanced-tab-dialog/advanced-tab-dialog.tsx
index f493df33..bc84ed2c 100644
--- a/src/views-components/advanced-tab-dialog/advanced-tab-dialog.tsx
+++ b/src/views-components/advanced-tab-dialog/advanced-tab-dialog.tsx
@@ -7,9 +7,11 @@ import { Dialog, DialogActions, Button, StyleRulesCallback, WithStyles, withStyl
import { WithDialogProps } from 'store/dialog/with-dialog';
import { withDialog } from "store/dialog/with-dialog";
import { compose } from 'redux';
-import { ADVANCED_TAB_DIALOG } from "store/advanced-tab/advanced-tab";
+import { AdvancedTabDialogData, ADVANCED_TAB_DIALOG } from "store/advanced-tab/advanced-tab";
import { DefaultCodeSnippet } from "components/default-code-snippet/default-code-snippet";
import { MetadataTab } from 'views-components/advanced-tab-dialog/metadataTab';
+import { LinkResource } from "models/link";
+import { ListResults } from "services/common-service/common-service";
type CssRules = 'content' | 'codeSnippet' | 'spacing';
@@ -34,7 +36,7 @@ export const AdvancedTabDialog = compose(
withDialog(ADVANCED_TAB_DIALOG),
withStyles(styles),
)(
- class extends React.Component<WithDialogProps<any> & WithStyles<CssRules>>{
+ class extends React.Component<WithDialogProps<AdvancedTabDialogData> & WithStyles<CssRules>>{
state = {
value: 0,
};
@@ -67,7 +69,7 @@ export const AdvancedTabDialog = compose(
maxWidth="lg"
onClose={closeDialog}
onExit={() => this.setState({ value: 0 })} >
- <DialogTitle>Advanced</DialogTitle>
+ <DialogTitle>API Details</DialogTitle>
<Tabs value={value} onChange={this.handleChange} fullWidth>
<Tab label="API RESPONSE" />
<Tab label="METADATA" />
@@ -78,8 +80,8 @@ export const AdvancedTabDialog = compose(
<DialogContent className={classes.content}>
{value === 0 && <div>{dialogContentExample(apiResponse, classes)}</div>}
{value === 1 && <div>
- {metadata !== '' && metadata.items.length > 0 ?
- <MetadataTab items={metadata.items} uuid={uuid} />
+ {metadata !== '' && (metadata as ListResults<LinkResource>).items.length > 0 ?
+ <MetadataTab items={(metadata as ListResults<LinkResource>).items} uuid={uuid} />
: dialogContentHeader('(No metadata links found)')}
</div>}
{value === 2 && dialogContent(pythonHeader, pythonExample, classes)}
@@ -110,8 +112,14 @@ const dialogContentHeader = (header: string) =>
{header}
</DialogContentText>;
-const dialogContentExample = (example: string, classes: any) =>
- <DefaultCodeSnippet
+const dialogContentExample = (example: JSX.Element | string, classes: any) => {
+ // Pass string to lines param or JSX to child props
+ const stringData = example && (example as string).length ? (example as string) : undefined;
+ return <DefaultCodeSnippet
apiResponse
className={classes.codeSnippet}
- lines={[example]} />;
\ No newline at end of file
+ lines={stringData ? [stringData] : []}
+ >
+ {example as JSX.Element || null}
+ </DefaultCodeSnippet>;
+}
diff --git a/src/views-components/context-menu/action-sets/api-client-authorization-action-set.ts b/src/views-components/context-menu/action-sets/api-client-authorization-action-set.ts
index 3394b211..aeaa6a22 100644
--- a/src/views-components/context-menu/action-sets/api-client-authorization-action-set.ts
+++ b/src/views-components/context-menu/action-sets/api-client-authorization-action-set.ts
@@ -17,7 +17,7 @@ export const apiClientAuthorizationActionSet: ContextMenuActionSet = [[{
dispatch<any>(openApiClientAuthorizationAttributesDialog(uuid));
}
}, {
- name: "Advanced",
+ name: "API Details",
icon: AdvancedIcon,
execute: (dispatch, { uuid }) => {
dispatch<any>(openAdvancedTabDialog(uuid));
diff --git a/src/views-components/context-menu/action-sets/collection-action-set.ts b/src/views-components/context-menu/action-sets/collection-action-set.ts
index 9b0efac0..edfaa3cd 100644
--- a/src/views-components/context-menu/action-sets/collection-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-action-set.ts
@@ -78,7 +78,7 @@ const commonActionSet: ContextMenuActionSet = [[
},
{
icon: AdvancedIcon,
- name: "Advanced",
+ name: "API Details",
execute: (dispatch, resource) => {
dispatch<any>(openAdvancedTabDialog(resource.uuid));
}
diff --git a/src/views-components/context-menu/action-sets/group-action-set.ts b/src/views-components/context-menu/action-sets/group-action-set.ts
index 874a601b..f573af69 100644
--- a/src/views-components/context-menu/action-sets/group-action-set.ts
+++ b/src/views-components/context-menu/action-sets/group-action-set.ts
@@ -20,7 +20,7 @@ export const groupActionSet: ContextMenuActionSet = [[{
dispatch<any>(openGroupAttributes(uuid));
}
}, {
- name: "Advanced",
+ name: "API Details",
icon: AdvancedIcon,
execute: (dispatch, resource) => {
dispatch<any>(openAdvancedTabDialog(resource.uuid));
diff --git a/src/views-components/context-menu/action-sets/group-member-action-set.ts b/src/views-components/context-menu/action-sets/group-member-action-set.ts
index b7215c70..37aa35c0 100644
--- a/src/views-components/context-menu/action-sets/group-member-action-set.ts
+++ b/src/views-components/context-menu/action-sets/group-member-action-set.ts
@@ -14,7 +14,7 @@ export const groupMemberActionSet: ContextMenuActionSet = [[{
dispatch<any>(openGroupMemberAttributes(uuid));
}
}, {
- name: "Advanced",
+ name: "API Details",
icon: AdvancedIcon,
execute: (dispatch, resource) => {
dispatch<any>(openAdvancedTabDialog(resource.uuid));
@@ -25,4 +25,4 @@ export const groupMemberActionSet: ContextMenuActionSet = [[{
execute: (dispatch, { uuid }) => {
dispatch<any>(openRemoveGroupMemberDialog(uuid));
}
-}]];
\ No newline at end of file
+}]];
diff --git a/src/views-components/context-menu/action-sets/keep-service-action-set.ts b/src/views-components/context-menu/action-sets/keep-service-action-set.ts
index b2d30baf..820d1978 100644
--- a/src/views-components/context-menu/action-sets/keep-service-action-set.ts
+++ b/src/views-components/context-menu/action-sets/keep-service-action-set.ts
@@ -14,7 +14,7 @@ export const keepServiceActionSet: ContextMenuActionSet = [[{
dispatch<any>(openKeepServiceAttributesDialog(uuid));
}
}, {
- name: "Advanced",
+ name: "API Details",
icon: AdvancedIcon,
execute: (dispatch, { uuid }) => {
dispatch<any>(openAdvancedTabDialog(uuid));
diff --git a/src/views-components/context-menu/action-sets/link-action-set.ts b/src/views-components/context-menu/action-sets/link-action-set.ts
index 0b70ba9b..929a65a9 100644
--- a/src/views-components/context-menu/action-sets/link-action-set.ts
+++ b/src/views-components/context-menu/action-sets/link-action-set.ts
@@ -14,7 +14,7 @@ export const linkActionSet: ContextMenuActionSet = [[{
dispatch<any>(openLinkAttributesDialog(uuid));
}
}, {
- name: "Advanced",
+ name: "API Details",
icon: AdvancedIcon,
execute: (dispatch, { uuid }) => {
dispatch<any>(openAdvancedTabDialog(uuid));
diff --git a/src/views-components/context-menu/action-sets/process-resource-action-set.ts b/src/views-components/context-menu/action-sets/process-resource-action-set.ts
index f17d74c9..56cfee85 100644
--- a/src/views-components/context-menu/action-sets/process-resource-action-set.ts
+++ b/src/views-components/context-menu/action-sets/process-resource-action-set.ts
@@ -69,7 +69,7 @@ export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [[
},
{
icon: AdvancedIcon,
- name: "Advanced",
+ name: "API Details",
execute: (dispatch, resource) => {
dispatch<any>(openAdvancedTabDialog(resource.uuid));
}
diff --git a/src/views-components/context-menu/action-sets/project-action-set.ts b/src/views-components/context-menu/action-sets/project-action-set.ts
index a079bf4f..e352d0c4 100644
--- a/src/views-components/context-menu/action-sets/project-action-set.ts
+++ b/src/views-components/context-menu/action-sets/project-action-set.ts
@@ -52,7 +52,7 @@ export const readOnlyProjectActionSet: ContextMenuActionSet = [[
},
{
icon: AdvancedIcon,
- name: "Advanced",
+ name: "API Details",
execute: (dispatch, resource) => {
dispatch<any>(openAdvancedTabDialog(resource.uuid));
}
diff --git a/src/views-components/context-menu/action-sets/repository-action-set.ts b/src/views-components/context-menu/action-sets/repository-action-set.ts
index fdd9d288..12fec7c4 100644
--- a/src/views-components/context-menu/action-sets/repository-action-set.ts
+++ b/src/views-components/context-menu/action-sets/repository-action-set.ts
@@ -21,7 +21,7 @@ export const repositoryActionSet: ContextMenuActionSet = [[{
dispatch<any>(openSharingDialog(uuid));
}
}, {
- name: "Advanced",
+ name: "API Details",
icon: AdvancedIcon,
execute: (dispatch, resource) => {
dispatch<any>(openAdvancedTabDialog(resource.uuid));
diff --git a/src/views-components/context-menu/action-sets/ssh-key-action-set.ts b/src/views-components/context-menu/action-sets/ssh-key-action-set.ts
index 587a05bc..d1a94cd3 100644
--- a/src/views-components/context-menu/action-sets/ssh-key-action-set.ts
+++ b/src/views-components/context-menu/action-sets/ssh-key-action-set.ts
@@ -14,7 +14,7 @@ export const sshKeyActionSet: ContextMenuActionSet = [[{
dispatch<any>(openSshKeyAttributesDialog(uuid));
}
}, {
- name: "Advanced",
+ name: "API Details",
icon: AdvancedIcon,
execute: (dispatch, { uuid }) => {
dispatch<any>(openAdvancedTabDialog(uuid));
diff --git a/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts b/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts
index b3d893b4..020ff5c7 100644
--- a/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts
+++ b/src/views-components/context-menu/action-sets/trashed-collection-action-set.ts
@@ -25,7 +25,7 @@ export const trashedCollectionActionSet: ContextMenuActionSet = [[
},
{
icon: AdvancedIcon,
- name: "Advanced",
+ name: "API Details",
execute: (dispatch, resource) => {
dispatch<any>(openAdvancedTabDialog(resource.uuid));
}
diff --git a/src/views-components/context-menu/action-sets/user-action-set.ts b/src/views-components/context-menu/action-sets/user-action-set.ts
index c298e1ab..c00b7f1f 100644
--- a/src/views-components/context-menu/action-sets/user-action-set.ts
+++ b/src/views-components/context-menu/action-sets/user-action-set.ts
@@ -32,7 +32,7 @@ export const userActionSet: ContextMenuActionSet = [[{
dispatch<any>(openUserProjects(uuid));
}
}, {
- name: "Advanced",
+ name: "API Details",
icon: AdvancedIcon,
execute: (dispatch, { uuid }) => {
dispatch<any>(openAdvancedTabDialog(uuid));
diff --git a/src/views-components/context-menu/action-sets/virtual-machine-action-set.ts b/src/views-components/context-menu/action-sets/virtual-machine-action-set.ts
index 721a6a2f..be9567cd 100644
--- a/src/views-components/context-menu/action-sets/virtual-machine-action-set.ts
+++ b/src/views-components/context-menu/action-sets/virtual-machine-action-set.ts
@@ -14,7 +14,7 @@ export const virtualMachineActionSet: ContextMenuActionSet = [[{
dispatch<any>(openVirtualMachineAttributes(uuid));
}
}, {
- name: "Advanced",
+ name: "API Details",
icon: AdvancedIcon,
execute: (dispatch, { uuid }) => {
dispatch<any>(openAdvancedTabDialog(uuid));
commit f778abd3ea3c3a525419ed1bc2c0c63edb335405
Author: Stephen Smith <stephen at curii.com>
Date: Thu Aug 25 11:27:32 2022 -0400
Merge branch '19421-restore-old-redirect-key' into main. Closes #19421
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/src/common/redirect-to.ts b/src/common/redirect-to.ts
index d8fecde4..73c94843 100644
--- a/src/common/redirect-to.ts
+++ b/src/common/redirect-to.ts
@@ -7,6 +7,7 @@ import { Config } from './config';
export const REDIRECT_TO_DOWNLOAD_KEY = 'redirectToDownload';
export const REDIRECT_TO_PREVIEW_KEY = 'redirectToPreview';
+export const REDIRECT_TO_KEY = 'redirectTo';
const getRedirectKeyFromUrl = (href: string): string | null => {
switch (true) {
@@ -14,6 +15,8 @@ const getRedirectKeyFromUrl = (href: string): string | null => {
return REDIRECT_TO_DOWNLOAD_KEY;
case href.indexOf(REDIRECT_TO_PREVIEW_KEY) > -1:
return REDIRECT_TO_PREVIEW_KEY;
+ case href.indexOf(`${REDIRECT_TO_KEY}=`) > -1:
+ return REDIRECT_TO_KEY;
default:
return null;
}
@@ -32,8 +35,11 @@ export const storeRedirects = () => {
const { location: { href }, localStorage } = window;
const redirectKey = getRedirectKeyFromUrl(href);
- if (localStorage && redirectKey) {
- localStorage.setItem(redirectKey, href.split(`${redirectKey}=`)[1]);
+ // Change old redirectTo -> redirectToPreview when storing redirect
+ const redirectStoreKey = redirectKey === REDIRECT_TO_KEY ? REDIRECT_TO_PREVIEW_KEY : redirectKey;
+
+ if (localStorage && redirectKey && redirectStoreKey) {
+ localStorage.setItem(redirectStoreKey, href.split(`${redirectKey}=`)[1]);
}
};
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list