From 8a86a699ffc6051a5cc529748b06426867a1e1e9 Mon Sep 17 00:00:00 2001 From: Nick Krantz <125900171+nick-livefront@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:26:38 -0500 Subject: [PATCH] [PM-9952][PM-9954] Minor assign collection fixes (#10190) * disable organization selector when only one org is selected * break long org names in assign collections copy - applicable more in the browser implementation * add `title` to each select option so a mouse over presents the name - more applicable to the browser extension where names can overflow * truncate options that overflow a select * set max width of form fields to 100% --- libs/components/src/select/select.component.html | 4 ++-- .../vault/src/components/assign-collections.component.html | 6 +++--- libs/vault/src/components/assign-collections.component.ts | 7 ++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/libs/components/src/select/select.component.html b/libs/components/src/select/select.component.html index 2609496e10a..f334e67d691 100644 --- a/libs/components/src/select/select.component.html +++ b/libs/components/src/select/select.component.html @@ -10,11 +10,11 @@ appendTo="body" > -
+
-
+
{{ item.label }}
diff --git a/libs/vault/src/components/assign-collections.component.html b/libs/vault/src/components/assign-collections.component.html index 5663a9e817b..c66db1813e5 100644 --- a/libs/vault/src/components/assign-collections.component.html +++ b/libs/vault/src/components/assign-collections.component.html @@ -1,7 +1,7 @@

{{ "bulkCollectionAssignmentDialogDescription" | i18n }}

-
    +
    • {{ "bulkCollectionAssignmentWarning" | i18n: totalItemCount : readonlyItemCount }} @@ -15,7 +15,7 @@

    - + {{ "moveToOrganization" | i18n }}
    - + {{ "selectCollectionsToAssign" | i18n }} { this.formGroup.patchValue({ selectedOrg: orgs[0].id }); this.setFormValidators(); + + // Disable the org selector if there is only one organization + if (orgs.length === 1) { + this.formGroup.controls.selectedOrg.disable(); + } }); } }), @@ -139,7 +144,7 @@ export class AssignCollectionsComponent implements OnInit { // Get the selected organization ID. If the user has not selected an organization from the form, // fallback to use the organization ID from the params. private get selectedOrgId(): OrganizationId { - return this.formGroup.value.selectedOrg || this.params.organizationId; + return this.formGroup.getRawValue().selectedOrg || this.params.organizationId; } private destroy$ = new Subject();