diff --git a/app/institutions/dashboard/-components/object-list/contributors-field/template.hbs b/app/institutions/dashboard/-components/object-list/contributors-field/template.hbs index 4130b4fd4b0..992e6be26a3 100644 --- a/app/institutions/dashboard/-components/object-list/contributors-field/template.hbs +++ b/app/institutions/dashboard/-components/object-list/contributors-field/template.hbs @@ -7,4 +7,8 @@ {{t 'institutions.dashboard.object-list.table-items.permission-level' permissionLevel=contributor.permissionLevel}} +{{else}} +
+ {{t 'institutions.dashboard.object-list.table-items.no-contributors'}} +
{{/each}} diff --git a/app/institutions/dashboard/-components/object-list/doi-field/template.hbs b/app/institutions/dashboard/-components/object-list/doi-field/template.hbs index e7d4032af6d..59496096bbc 100644 --- a/app/institutions/dashboard/-components/object-list/doi-field/template.hbs +++ b/app/institutions/dashboard/-components/object-list/doi-field/template.hbs @@ -1,5 +1,5 @@ {{#each this.dois as |doi|}} {{doi.displayText}} {{else}} - {{t 'institutions.dashboard.object-list.table-items.no-info' field=(t 'institutions.dashboard.object-list.table-headers.doi')}} + {{t 'institutions.dashboard.object-list.table-items.missing-info'}} {{/each}} diff --git a/app/institutions/dashboard/preprints/controller.ts b/app/institutions/dashboard/preprints/controller.ts index 639bff867cb..1d6d101c485 100644 --- a/app/institutions/dashboard/preprints/controller.ts +++ b/app/institutions/dashboard/preprints/controller.ts @@ -9,6 +9,8 @@ import { ObjectListColumn } from '../-components/object-list/component'; export default class InstitutionDashboardPreprints extends Controller { @service intl!: Intl; + missingItemPlaceholder = this.intl.t('institutions.dashboard.object-list.table-items.missing-info'); + columns: ObjectListColumn[] = [ { // Title name: this.intl.t('institutions.dashboard.object-list.table-headers.title'), @@ -36,8 +38,7 @@ export default class InstitutionDashboardPreprints extends Controller { }, { // License name: this.intl.t('institutions.dashboard.object-list.table-headers.license'), - getValue: searchResult => searchResult.license?.name || - this.intl.t('institutions.dashboard.object-list.table-items.no-license-info'), + getValue: searchResult => searchResult.license?.name || this.missingItemPlaceholder, }, { // Contributor name + permissions name: this.intl.t('institutions.dashboard.object-list.table-headers.contributor_name'), @@ -47,16 +48,14 @@ export default class InstitutionDashboardPreprints extends Controller { name: this.intl.t('institutions.dashboard.object-list.table-headers.view_count'), getValue: searchResult => { const metrics = searchResult.usageMetrics; - return metrics ? metrics.viewCount : - this.intl.t('institutions.dashboard.object-list.table-items.no-metrics'); + return metrics ? metrics.viewCount : this.missingItemPlaceholder; }, }, { // Download count name: this.intl.t('institutions.dashboard.object-list.table-headers.download_count'), getValue: searchResult => { const metrics = searchResult.usageMetrics; - return metrics ? metrics.downloadCount : - this.intl.t('institutions.dashboard.object-list.table-items.no-metrics'); + return metrics ? metrics.downloadCount : this.missingItemPlaceholder; }, }, ]; diff --git a/app/institutions/dashboard/projects/controller.ts b/app/institutions/dashboard/projects/controller.ts index dad3a475286..c5f4dbfa7ab 100644 --- a/app/institutions/dashboard/projects/controller.ts +++ b/app/institutions/dashboard/projects/controller.ts @@ -11,6 +11,8 @@ import { ObjectListColumn } from '../-components/object-list/component'; export default class InstitutionDashboardProjects extends Controller { @service intl!: Intl; + missingItemPlaceholder = this.intl.t('institutions.dashboard.object-list.table-items.missing-info'); + columns: ObjectListColumn[] = [ { // Title name: this.intl.t('institutions.dashboard.object-list.table-headers.title'), @@ -44,8 +46,7 @@ export default class InstitutionDashboardProjects extends Controller { name: this.intl.t('institutions.dashboard.object-list.table-headers.total_data_stored'), getValue: searchResult => { const byteCount = getSingleOsfmapValue(searchResult.resourceMetadata, ['storageByteCount']); - return byteCount ? humanFileSize(byteCount) : - this.intl.t('institutions.dashboard.object-list.table-items.no-storage-info'); + return byteCount ? humanFileSize(byteCount) : this.missingItemPlaceholder; }, }, { // Contributor name + permissions @@ -56,36 +57,27 @@ export default class InstitutionDashboardProjects extends Controller { name: this.intl.t('institutions.dashboard.object-list.table-headers.view_count'), getValue: searchResult => { const metrics = searchResult.usageMetrics; - return metrics ? metrics.viewCount : - this.intl.t('institutions.dashboard.object-list.table-items.no-metrics'); + return metrics ? metrics.viewCount : this.missingItemPlaceholder; }, }, { // Resource type name: this.intl.t('institutions.dashboard.object-list.table-headers.resource_nature'), - getValue: searchResult => { - const field = this.intl.t('institutions.dashboard.object-list.table-headers.resource_nature'); - return searchResult.resourceNature || - this.intl.t('institutions.dashboard.object-list.table-items.no-info', { field }); - }, + getValue: searchResult => searchResult.resourceNature || this.missingItemPlaceholder, }, { // License name: this.intl.t('institutions.dashboard.object-list.table-headers.license'), - getValue: searchResult => searchResult.license?.name || - this.intl.t('institutions.dashboard.object-list.table-items.no-license-info'), + getValue: searchResult => searchResult.license?.name || this.missingItemPlaceholder, }, { // addons associated name: this.intl.t('institutions.dashboard.object-list.table-headers.addons'), - getValue: searchResult => { - const field = this.intl.t('institutions.dashboard.object-list.table-headers.addons'); - return searchResult.configuredAddonNames.length ? searchResult.configuredAddonNames : - this.intl.t('institutions.dashboard.object-list.table-items.no-info', { field }); - }, + getValue: searchResult => searchResult.configuredAddonNames.length ? searchResult.configuredAddonNames : + this.missingItemPlaceholder, }, { // Funder name name: this.intl.t('institutions.dashboard.object-list.table-headers.funder_name'), getValue: searchResult => { if (!searchResult.funders) { - return this.intl.t('institutions.dashboard.object-list.table-items.no-funder-info'); + return this.missingItemPlaceholder; } return searchResult.funders.map((funder: { name: string }) => funder.name).join(', '); }, diff --git a/app/institutions/dashboard/registrations/controller.ts b/app/institutions/dashboard/registrations/controller.ts index eab296e1148..4925eb1ffc6 100644 --- a/app/institutions/dashboard/registrations/controller.ts +++ b/app/institutions/dashboard/registrations/controller.ts @@ -10,6 +10,7 @@ import { ObjectListColumn } from '../-components/object-list/component'; export default class InstitutionDashboardRegistrations extends Controller { @service intl!: Intl; + missingItemPlaceholder = this.intl.t('institutions.dashboard.object-list.table-items.missing-info'); columns: ObjectListColumn[] = [ { // Title name: this.intl.t('institutions.dashboard.object-list.table-headers.title'), @@ -43,8 +44,7 @@ export default class InstitutionDashboardRegistrations extends Controller { name: this.intl.t('institutions.dashboard.object-list.table-headers.total_data_stored'), getValue: searchResult => { const byteCount = getSingleOsfmapValue(searchResult.resourceMetadata, ['storageByteCount']); - return byteCount ? humanFileSize(byteCount) : - this.intl.t('institutions.dashboard.object-list.table-items.no-storage-info'); + return byteCount ? humanFileSize(byteCount) : this.missingItemPlaceholder; }, }, { // Contributor name + permissions @@ -55,28 +55,22 @@ export default class InstitutionDashboardRegistrations extends Controller { name: this.intl.t('institutions.dashboard.object-list.table-headers.view_count'), getValue: searchResult => { const metrics = searchResult.usageMetrics; - return metrics ? metrics.viewCount : - this.intl.t('institutions.dashboard.object-list.table-items.no-metrics'); + return metrics ? metrics.viewCount : this.missingItemPlaceholder; }, }, { // Resource type name: this.intl.t('institutions.dashboard.object-list.table-headers.resource_nature'), - getValue: searchResult => { - const field = this.intl.t('institutions.dashboard.object-list.table-headers.resource_nature'); - return searchResult.resourceNature || - this.intl.t('institutions.dashboard.object-list.table-items.no-info', { field }); - }, + getValue: searchResult => searchResult.resourceNature || this.missingItemPlaceholder, }, { // License name: this.intl.t('institutions.dashboard.object-list.table-headers.license'), - getValue: searchResult => searchResult.license?.name || - this.intl.t('institutions.dashboard.object-list.table-items.no-license-info'), + getValue: searchResult => searchResult.license?.name || this.missingItemPlaceholder, }, { // Funder name name: this.intl.t('institutions.dashboard.object-list.table-headers.funder_name'), getValue: searchResult => { if (!searchResult.funders) { - return this.intl.t('institutions.dashboard.object-list.table-items.no-funder-info'); + return this.missingItemPlaceholder; } return searchResult.funders.map((funder: { name: string }) => funder.name).join(', '); }, diff --git a/translations/en-us.yml b/translations/en-us.yml index 2abecdc51b3..1129cb84be8 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -900,11 +900,8 @@ institutions: funder_name: Funder Name registration_schema: 'Registration Schema' table-items: - no-info: 'No {field}' - no-storage-info: 'No Storage Info' - no-metrics: 'No metrics' - no-license-info: 'No License Info' - no-funder-info: 'No Funder info' + missing-info: '-' + no-contributors: 'Contributor no longer affiliated' permission-level: '({permissionLevel})' projects_panel: 'Total Projects' departments_panel: Departments