return "v" + process.env.REACT_APP_VERSION;
} else {
const getBuildNumber = "BN-" + (process.env.REACT_APP_BUILD_NUMBER || "dev");
- const getGitCommit = "GIT-" + (process.env.REACT_APP_GIT_COMMIT || "latest").substr(0, 7);
+ const getGitCommit = "GIT-" + (process.env.REACT_APP_GIT_COMMIT || "latest").substring(0, 7);
return getBuildNumber + " / " + getGitCommit;
}
};
const u = new URL(url);
u.pathname = u.pathname.replace(/\/\//, '/');
if (u.pathname[u.pathname.length - 1] === '/') {
- u.pathname = u.pathname.substr(0, u.pathname.length - 1);
+ u.pathname = u.pathname.substring(0, u.pathname.length - 1);
}
return u.toString();
}
export const getNavUrl = (uuid: string, config: FederationConfig) => {
const path = getResourceUrl(uuid) || "";
- const cls = uuid.substr(0, 5);
+ const cls = uuid.substring(0, 5);
if (cls === config.localCluster || extractUuidKind(uuid) === ResourceKind.USER || COLLECTION_PDH_REGEX.exec(uuid)) {
return path;
} else if (config.remoteHostsConfig[cls]) {
if (url0) {
let idx0 = url0.length - 1;
while (url0[idx0] === '/') { --idx0; }
- u0 = url0.substr(0, idx0 + 1);
+ u0 = url0.substring(0, idx0 + 1);
}
let u1 = "";
if (url1) {
let idx1 = 0;
while (url1[idx1] === '/') { ++idx1; }
- u1 = url1.substr(idx1);
+ u1 = url1.substring(idx1);
}
let url = u0;
if (u1.length > 0) {
this.getStorage().setItem(API_TOKEN_KEY, token);
const sp = token.split('/');
if (sp.length === 3) {
- this.getStorage().setItem(HOME_CLUSTER, sp[1].substr(0, 5));
+ this.getStorage().setItem(HOME_CLUSTER, sp[1].substring(0, 5));
}
}
throw new Error(invalidV2Token);
}
let salted = secret;
- if (uuid.substr(0, 5) !== clusterId) {
+ if (uuid.substring(0, 5) !== clusterId) {
shaObj.setHMACKey(secret, "TEXT");
shaObj.update(clusterId);
salted = shaObj.getHMAC("HEX");
apiToken: token,
apiTokenExpiration: tokenExpiration,
apiTokenLocation: tokenLocation,
- homeCluster: user.uuid.substr(0, 5)
+ homeCluster: user.uuid.substring(0, 5)
}),
LOGIN: () => state,
LOGOUT: () => ({ ...state, apiToken: undefined }),
USER_DETAILS_SUCCESS: (user: User) =>
- ({ ...state, user, homeCluster: user.uuid.substr(0, 5) }),
+ ({ ...state, user, homeCluster: user.uuid.substring(0, 5) }),
SET_SSH_KEYS: (sshKeys: SshKeyResource[]) => ({ ...state, sshKeys }),
ADD_SSH_KEY: (sshKey: SshKeyResource) =>
({ ...state, sshKeys: state.sshKeys.concat(sshKey) }),
permissionLinkUuid: string,
visible: boolean,
canManage: boolean,
- setMemberIsHidden: (memberLinkUuid: string, permissionLinkUuid: string, hide: boolean) => void
+ setMemberIsHidden: (memberLinkUuid: string, permissionLinkUuid: string, hide: boolean) => void
}) => {
if (props.memberLinkUuid) {
return <Checkbox
export const ResourceCluster = (props: { uuid: string }) => {
const CLUSTER_ID_LENGTH = 5;
const pos = props.uuid.length > CLUSTER_ID_LENGTH ? props.uuid.indexOf('-') : 5;
- const clusterId = pos >= CLUSTER_ID_LENGTH ? props.uuid.substr(0, pos) : '';
+ const clusterId = pos >= CLUSTER_ID_LENGTH ? props.uuid.substring(0, pos) : '';
const ci = pos >= CLUSTER_ID_LENGTH ? (((((
(props.uuid.charCodeAt(0) * props.uuid.charCodeAt(1))
+ props.uuid.charCodeAt(2))
title="Account Management"
key={currentRoute}>
<MenuItem disabled>
- {getUserDisplayName(user)} {user.uuid.substr(0, 5) !== localCluster && `(${user.uuid.substr(0, 5)})`}
+ {getUserDisplayName(user)} {user.uuid.substring(0, 5) !== localCluster && `(${user.uuid.substring(0, 5)})`}
</MenuItem>
{user.isActive && accountMenuItems}
<Divider />
const disp: JSX.Element[] = [];
disp.push(<span><b>{user.email}</b> ({user.username}, {user.uuid})</span>);
if (showCluster) {
- const homeCluster = user.uuid.substr(0, 5);
+ const homeCluster = user.uuid.substring(0, 5);
disp.push(<span> hosted on cluster <b>{homeCluster}</b> and </span>);
}
if (showCreatedAt) {
This a remote account. You can link a local Arvados account to this one.
After linking, you can access the local account's data by logging into the
<b>{localCluster}</b> cluster as user <b>{targetUser.email}</b>
- from <b>{targetUser.uuid.substr(0, 5)}</b>.
+ from <b>{targetUser.uuid.substring(0, 5)}</b>.
</Grid >
<Grid item>
<Button color="primary" variant="contained" onClick={() => startLinking(LinkAccountType.ADD_LOCAL_TO_REMOTE)}>
type LocalClusterProp = { localCluster: string };
const renderField: React.ComponentType<WrappedFieldProps & LocalClusterProp> = ({ input, localCluster }) => (
- <span>{localCluster === input.value.substr(0, 5) ? "" : "federated"} user {input.value}</span>
+ <span>{localCluster === input.value.substring(0, 5) ? "" : "federated"} user {input.value}</span>
);
export const MyAccountPanelRoot = withStyles(styles)(
export const SearchResultsPanelView = withStyles(styles, { withTheme: true })(
(props: SearchResultsPanelProps & WithStyles<CssRules, true>) => {
- const homeCluster = props.user.uuid.substr(0, 5);
+ const homeCluster = props.user.uuid.substring(0, 5);
const loggedIn = props.sessions.filter((ss) => ss.loggedIn && ss.userIsActive);
return <span data-cy='search-results'><DataExplorer
id={SEARCH_RESULTS_PANEL_ID}