[arvados-workbench2] updated: 2.5.0-19-g7093aa29
git repository hosting
git at public.arvados.org
Fri Feb 10 20:10:57 UTC 2023
Summary of changes:
src/models/user.ts | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
via 7093aa294fdfe0f0a71918e9fd7b9726f5e35a04 (commit)
from 8e91af9bd8d0a66d1181e4db8b72efc632c27ad5 (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 7093aa294fdfe0f0a71918e9fd7b9726f5e35a04
Author: Stephen Smith <stephen at curii.com>
Date: Fri Feb 10 15:10:33 2023 -0500
19294: Only show cluster id part of uuid in participant select chip tooltip
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/src/models/user.ts b/src/models/user.ts
index 6d66d9d3..87a2e8c1 100644
--- a/src/models/user.ts
+++ b/src/models/user.ts
@@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0
-import { Resource, ResourceKind } from 'models/resource';
+import { Resource, ResourceKind, RESOURCE_UUID_REGEX } from 'models/resource';
export type UserPrefs = {
profile?: {
@@ -46,12 +46,19 @@ export const getUserDisplayName = (user: User, withEmail = false, withUuid = fal
export const getUserDetailsString = (user: User) => {
let parts: string[] = [];
+ const userCluster = getUserClusterID(user);
user.username.length && parts.push(user.username);
user.email.length && parts.push(`<${user.email}>`);
- user.uuid.length && parts.push(`(${user.uuid})`);
+ userCluster && userCluster.length && parts.push(`(${userCluster})`);
return parts.join(' ');
};
+export const getUserClusterID = (user: User): string | undefined => {
+ const match = RESOURCE_UUID_REGEX.exec(user.uuid);
+ const parts = match ? match[0].split('-') : [];
+ return parts.length === 3 ? parts[0] : undefined;
+};
+
export interface UserResource extends Resource, User {
kind: ResourceKind.USER;
defaultOwnerUuid: string;
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list