From 5edc689bc12d638e16565731bc9f224eeb9788d0 Mon Sep 17 00:00:00 2001 From: Yury Bondarenko Date: Wed, 6 Mar 2024 17:04:54 +0100 Subject: [PATCH] Fix null/undefined incosistencies - Introduced pipes for combined null/undefined checks: dsHasValue & dsHasNoValue - Safer to async !== true than async === false - Went over other instances of async === to confirm that they should be fine --- .../epeople-registry.component.html | 2 +- .../eperson-form/eperson-form.component.html | 4 ++-- .../eperson-form/eperson-form.component.spec.ts | 6 +++++- .../group-form/group-form.component.html | 2 +- .../groups-registry.component.html | 2 +- .../admin-notify-logs-result.component.html | 2 +- .../admin-sidebar/admin-sidebar.component.html | 4 ++-- .../browse-by-metadata.component.html | 2 +- .../delete-collection-page.component.html | 2 +- .../collection-source-controls.component.html | 6 +++--- .../collection-source.component.html | 14 +++++++------- .../community-list/community-list.component.html | 4 ++-- .../delete-community-page.component.html | 2 +- .../dso-edit-metadata-value.component.html | 2 +- .../header-navbar-wrapper.component.html | 2 +- .../edit-item-page/edit-item-page.component.html | 2 +- .../item-bitstreams.component.html | 12 ++++++------ ...d-drag-and-drop-bitstream-list.component.html | 2 +- .../edit-relationship-list.component.html | 2 +- .../item-relationships.component.html | 12 ++++++------ .../collections/collections.component.html | 2 +- .../orcid-auth/orcid-auth.component.html | 6 +++--- .../orcid-page/orcid-page.component.html | 6 +++--- .../orcid-queue/orcid-queue.component.html | 4 ++-- .../request-status-alert-box.component.html | 2 +- .../item-versions-summary-modal.component.html | 2 +- ...y-dspace-new-external-dropdown.component.html | 6 +++--- ...dspace-new-submission-dropdown.component.html | 6 +++--- src/app/navbar/navbar.component.html | 6 +++--- .../quality-assurance-events.component.html | 4 ++-- .../project-entry-import-modal.component.html | 4 ++-- .../quality-assurance-source.component.html | 4 ++-- .../quality-assurance-topics.component.html | 4 ++-- .../publication-claim.component.html | 4 ++-- .../detail/process-detail.component.html | 4 ++-- .../detail/process-detail.component.spec.ts | 9 ++++++++- .../process-page/new/new-process.component.html | 6 +++--- .../new/new-process.component.spec.ts | 7 ++++++- .../overview/process-overview.component.html | 2 +- .../profile-page-researcher-form.component.html | 4 ++-- src/app/root/root.component.html | 2 +- .../auth-nav-menu/auth-nav-menu.component.html | 6 +++--- .../user-menu/user-menu.component.html | 2 +- .../collection-dropdown.component.html | 2 +- .../comcol-role/comcol-role.component.html | 4 ++-- ...item-withdrawn-reinstate-modal.component.html | 2 +- .../entity-dropdown.component.html | 2 +- .../file-download-link.component.html | 2 +- .../models/onebox/dynamic-onebox.component.html | 2 +- .../dynamic-relation-group.component.html | 6 +++--- ...mic-lookup-relation-search-tab.component.html | 2 +- src/app/shared/form/form.component.html | 2 +- .../vocabulary-treeview.component.html | 2 +- src/app/shared/log-in/log-in.component.html | 2 +- .../claimed-task-actions-approve.component.html | 2 +- ...imed-task-actions-decline-task.component.html | 2 +- .../claimed-task-actions-reject.component.html | 4 ++-- ...ed-task-actions-return-to-pool.component.html | 2 +- .../pool-task/pool-task-actions.component.html | 2 +- .../workspaceitem-actions.component.html | 2 +- .../item-list-preview.component.html | 2 +- .../item-select/item-select.component.html | 2 +- .../entry/resource-policy-entry.component.html | 2 +- .../resource-policy-entry.component.spec.ts | 2 ++ .../form/resource-policy-form.component.html | 4 ++-- .../resource-policies.component.html | 4 ++-- .../resource-policies.component.spec.ts | 2 ++ .../search-authority-filter.component.html | 2 +- .../search-boolean-filter.component.html | 2 +- .../search-filter/search-filter.component.html | 2 +- .../search-hierarchy-filter.component.html | 2 +- .../search-text-filter.component.html | 2 +- src/app/shared/search/search.component.html | 6 +++--- src/app/shared/shared.module.ts | 4 ++++ .../sidebar/page-with-sidebar.component.html | 2 +- .../subscription-modal.component.html | 2 +- .../subscription-view.component.html | 2 +- src/app/shared/utils/has-no-value.pipe.ts | 16 ++++++++++++++++ src/app/shared/utils/has-value.pipe.ts | 16 ++++++++++++++++ .../statistics-page.component.html | 2 +- .../submission-form-collection.component.html | 4 ++-- .../footer/submission-form-footer.component.html | 8 ++++---- .../submission-form-section-add.component.html | 4 ++-- .../form/submission-form.component.html | 4 ++-- ...sion-import-external-searchbar.component.html | 4 ++-- .../submission-import-external.component.html | 6 +++--- .../container/section-container.component.html | 2 +- .../section-coar-notify.component.html | 2 +- .../file/section-upload-file.component.html | 12 ++++++------ .../subscriptions-page.component.html | 4 ++-- .../suggestions-page.component.html | 2 +- .../dspace/app/header/header.component.html | 4 ++-- 92 files changed, 210 insertions(+), 154 deletions(-) create mode 100644 src/app/shared/utils/has-no-value.pipe.ts create mode 100644 src/app/shared/utils/has-value.pipe.ts diff --git a/src/app/access-control/epeople-registry/epeople-registry.component.html b/src/app/access-control/epeople-registry/epeople-registry.component.html index ea8ab046b5c..92968d2e28b 100644 --- a/src/app/access-control/epeople-registry/epeople-registry.component.html +++ b/src/app/access-control/epeople-registry/epeople-registry.component.html @@ -43,7 +43,7 @@
-
@@ -47,7 +47,7 @@

{{messagePrefix + '.edit' | translate}}

{{messagePrefix + '.groupsEPersonIsMemberOf' | translate}}

- + { }, }), ], - declarations: [EPersonFormComponent], + declarations: [ + EPersonFormComponent, + HasNoValuePipe, + ], providers: [ { provide: EPersonDataService, useValue: ePersonDataServiceStub }, { provide: GroupDataService, useValue: groupsDataService }, diff --git a/src/app/access-control/group-registry/group-form/group-form.component.html b/src/app/access-control/group-registry/group-form/group-form.component.html index b8604cb4c58..dc477352e56 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.html +++ b/src/app/access-control/group-registry/group-form/group-form.component.html @@ -25,7 +25,7 @@

- diff --git a/src/app/access-control/group-registry/groups-registry.component.html b/src/app/access-control/group-registry/groups-registry.component.html index 8a85961b389..2ef67ddf547 100644 --- a/src/app/access-control/group-registry/groups-registry.component.html +++ b/src/app/access-control/group-registry/groups-registry.component.html @@ -35,7 +35,7 @@

- - - @@ -33,7 +33,7 @@ {{ (node.isExpanded ? 'communityList.collapse' : 'communityList.expand') | translate:{ name: dsoNameService.getName(node.payload) } }} -