diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index 1e73e27175a7..1e9ab944ad2e 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -4804,7 +4804,7 @@ export interface paths { }; /** * Get User Roles - * @description Return a collection of roles associated with this user. Only admins can see user roles. + * @description Return a list of roles associated with this user. Only admins can see user roles. */ get: operations["get_user_roles_api_users__user_id__roles_get"]; put?: never; diff --git a/client/src/components/Common/TextSummary.vue b/client/src/components/Common/TextSummary.vue index 19b7f40e98c7..6ef4b607402d 100644 --- a/client/src/components/Common/TextSummary.vue +++ b/client/src/components/Common/TextSummary.vue @@ -11,7 +11,8 @@ interface Props { maxLength?: number; /** The text to summarize */ description: string; - /** If `true`, doesn't let unexpanded text go beyond height of one line */ + /** If `true`, doesn't let unexpanded text go beyond height of one line + * and ignores `maxLength` */ oneLineSummary?: boolean; /** If `true`, doesn't show expand/collapse buttons */ noExpand?: boolean; @@ -25,8 +26,17 @@ const props = withDefaults(defineProps(), { }); const showDetails = ref(false); +const refOneLineSummary = ref(null); -const textTooLong = computed(() => props.description.length > props.maxLength); +const textTooLong = computed(() => { + if (!props.oneLineSummary) { + return props.description.length > props.maxLength; + } else if (refOneLineSummary.value) { + return refOneLineSummary.value.scrollWidth > refOneLineSummary.value.clientWidth; + } else { + return false; + } +}); const text = computed(() => textTooLong.value && !showDetails.value ? props.description.slice(0, Math.round(props.maxLength - props.maxLength / 2)) + "..." @@ -35,8 +45,12 @@ const text = computed(() =>