Skip to content

Commit 83c4a77

Browse files
authored
Update no data placeholder text (#2390)
- Ticket: [No ticket] - Feature flag: n/a ## Purpose - Update placeholder text when there is no data for a given column ## Summary of Changes - Use a simple `-` to denote missing values - Add placeholder text if no contributors are no longer affiliated for a project/registration/preprint
1 parent 4877062 commit 83c4a77

File tree

6 files changed

+27
-41
lines changed

6 files changed

+27
-41
lines changed

app/institutions/dashboard/-components/object-list/contributors-field/template.hbs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@
77
</OsfLink>
88
{{t 'institutions.dashboard.object-list.table-items.permission-level' permissionLevel=contributor.permissionLevel}}
99
</div>
10+
{{else}}
11+
<div>
12+
{{t 'institutions.dashboard.object-list.table-items.no-contributors'}}
13+
</div>
1014
{{/each}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{#each this.dois as |doi|}}
22
<OsfLink @href={{doi.fullLink}} @target='_blank'>{{doi.displayText}}</OsfLink>
33
{{else}}
4-
{{t 'institutions.dashboard.object-list.table-items.no-info' field=(t 'institutions.dashboard.object-list.table-headers.doi')}}
4+
{{t 'institutions.dashboard.object-list.table-items.missing-info'}}
55
{{/each}}

app/institutions/dashboard/preprints/controller.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { ObjectListColumn } from '../-components/object-list/component';
99
export default class InstitutionDashboardPreprints extends Controller {
1010
@service intl!: Intl;
1111

12+
missingItemPlaceholder = this.intl.t('institutions.dashboard.object-list.table-items.missing-info');
13+
1214
columns: ObjectListColumn[] = [
1315
{ // Title
1416
name: this.intl.t('institutions.dashboard.object-list.table-headers.title'),
@@ -36,8 +38,7 @@ export default class InstitutionDashboardPreprints extends Controller {
3638
},
3739
{ // License
3840
name: this.intl.t('institutions.dashboard.object-list.table-headers.license'),
39-
getValue: searchResult => searchResult.license?.name ||
40-
this.intl.t('institutions.dashboard.object-list.table-items.no-license-info'),
41+
getValue: searchResult => searchResult.license?.name || this.missingItemPlaceholder,
4142
},
4243
{ // Contributor name + permissions
4344
name: this.intl.t('institutions.dashboard.object-list.table-headers.contributor_name'),
@@ -47,16 +48,14 @@ export default class InstitutionDashboardPreprints extends Controller {
4748
name: this.intl.t('institutions.dashboard.object-list.table-headers.view_count'),
4849
getValue: searchResult => {
4950
const metrics = searchResult.usageMetrics;
50-
return metrics ? metrics.viewCount :
51-
this.intl.t('institutions.dashboard.object-list.table-items.no-metrics');
51+
return metrics ? metrics.viewCount : this.missingItemPlaceholder;
5252
},
5353
},
5454
{ // Download count
5555
name: this.intl.t('institutions.dashboard.object-list.table-headers.download_count'),
5656
getValue: searchResult => {
5757
const metrics = searchResult.usageMetrics;
58-
return metrics ? metrics.downloadCount :
59-
this.intl.t('institutions.dashboard.object-list.table-items.no-metrics');
58+
return metrics ? metrics.downloadCount : this.missingItemPlaceholder;
6059
},
6160
},
6261
];

app/institutions/dashboard/projects/controller.ts

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { ObjectListColumn } from '../-components/object-list/component';
1111
export default class InstitutionDashboardProjects extends Controller {
1212
@service intl!: Intl;
1313

14+
missingItemPlaceholder = this.intl.t('institutions.dashboard.object-list.table-items.missing-info');
15+
1416
columns: ObjectListColumn[] = [
1517
{ // Title
1618
name: this.intl.t('institutions.dashboard.object-list.table-headers.title'),
@@ -44,8 +46,7 @@ export default class InstitutionDashboardProjects extends Controller {
4446
name: this.intl.t('institutions.dashboard.object-list.table-headers.total_data_stored'),
4547
getValue: searchResult => {
4648
const byteCount = getSingleOsfmapValue(searchResult.resourceMetadata, ['storageByteCount']);
47-
return byteCount ? humanFileSize(byteCount) :
48-
this.intl.t('institutions.dashboard.object-list.table-items.no-storage-info');
49+
return byteCount ? humanFileSize(byteCount) : this.missingItemPlaceholder;
4950
},
5051
},
5152
{ // Contributor name + permissions
@@ -56,36 +57,27 @@ export default class InstitutionDashboardProjects extends Controller {
5657
name: this.intl.t('institutions.dashboard.object-list.table-headers.view_count'),
5758
getValue: searchResult => {
5859
const metrics = searchResult.usageMetrics;
59-
return metrics ? metrics.viewCount :
60-
this.intl.t('institutions.dashboard.object-list.table-items.no-metrics');
60+
return metrics ? metrics.viewCount : this.missingItemPlaceholder;
6161
},
6262
},
6363
{ // Resource type
6464
name: this.intl.t('institutions.dashboard.object-list.table-headers.resource_nature'),
65-
getValue: searchResult => {
66-
const field = this.intl.t('institutions.dashboard.object-list.table-headers.resource_nature');
67-
return searchResult.resourceNature ||
68-
this.intl.t('institutions.dashboard.object-list.table-items.no-info', { field });
69-
},
65+
getValue: searchResult => searchResult.resourceNature || this.missingItemPlaceholder,
7066
},
7167
{ // License
7268
name: this.intl.t('institutions.dashboard.object-list.table-headers.license'),
73-
getValue: searchResult => searchResult.license?.name ||
74-
this.intl.t('institutions.dashboard.object-list.table-items.no-license-info'),
69+
getValue: searchResult => searchResult.license?.name || this.missingItemPlaceholder,
7570
},
7671
{ // addons associated
7772
name: this.intl.t('institutions.dashboard.object-list.table-headers.addons'),
78-
getValue: searchResult => {
79-
const field = this.intl.t('institutions.dashboard.object-list.table-headers.addons');
80-
return searchResult.configuredAddonNames.length ? searchResult.configuredAddonNames :
81-
this.intl.t('institutions.dashboard.object-list.table-items.no-info', { field });
82-
},
73+
getValue: searchResult => searchResult.configuredAddonNames.length ? searchResult.configuredAddonNames :
74+
this.missingItemPlaceholder,
8375
},
8476
{ // Funder name
8577
name: this.intl.t('institutions.dashboard.object-list.table-headers.funder_name'),
8678
getValue: searchResult => {
8779
if (!searchResult.funders) {
88-
return this.intl.t('institutions.dashboard.object-list.table-items.no-funder-info');
80+
return this.missingItemPlaceholder;
8981
}
9082
return searchResult.funders.map((funder: { name: string }) => funder.name).join(', ');
9183
},

app/institutions/dashboard/registrations/controller.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { ObjectListColumn } from '../-components/object-list/component';
1010
export default class InstitutionDashboardRegistrations extends Controller {
1111
@service intl!: Intl;
1212

13+
missingItemPlaceholder = this.intl.t('institutions.dashboard.object-list.table-items.missing-info');
1314
columns: ObjectListColumn[] = [
1415
{ // Title
1516
name: this.intl.t('institutions.dashboard.object-list.table-headers.title'),
@@ -43,8 +44,7 @@ export default class InstitutionDashboardRegistrations extends Controller {
4344
name: this.intl.t('institutions.dashboard.object-list.table-headers.total_data_stored'),
4445
getValue: searchResult => {
4546
const byteCount = getSingleOsfmapValue(searchResult.resourceMetadata, ['storageByteCount']);
46-
return byteCount ? humanFileSize(byteCount) :
47-
this.intl.t('institutions.dashboard.object-list.table-items.no-storage-info');
47+
return byteCount ? humanFileSize(byteCount) : this.missingItemPlaceholder;
4848
},
4949
},
5050
{ // Contributor name + permissions
@@ -55,28 +55,22 @@ export default class InstitutionDashboardRegistrations extends Controller {
5555
name: this.intl.t('institutions.dashboard.object-list.table-headers.view_count'),
5656
getValue: searchResult => {
5757
const metrics = searchResult.usageMetrics;
58-
return metrics ? metrics.viewCount :
59-
this.intl.t('institutions.dashboard.object-list.table-items.no-metrics');
58+
return metrics ? metrics.viewCount : this.missingItemPlaceholder;
6059
},
6160
},
6261
{ // Resource type
6362
name: this.intl.t('institutions.dashboard.object-list.table-headers.resource_nature'),
64-
getValue: searchResult => {
65-
const field = this.intl.t('institutions.dashboard.object-list.table-headers.resource_nature');
66-
return searchResult.resourceNature ||
67-
this.intl.t('institutions.dashboard.object-list.table-items.no-info', { field });
68-
},
63+
getValue: searchResult => searchResult.resourceNature || this.missingItemPlaceholder,
6964
},
7065
{ // License
7166
name: this.intl.t('institutions.dashboard.object-list.table-headers.license'),
72-
getValue: searchResult => searchResult.license?.name ||
73-
this.intl.t('institutions.dashboard.object-list.table-items.no-license-info'),
67+
getValue: searchResult => searchResult.license?.name || this.missingItemPlaceholder,
7468
},
7569
{ // Funder name
7670
name: this.intl.t('institutions.dashboard.object-list.table-headers.funder_name'),
7771
getValue: searchResult => {
7872
if (!searchResult.funders) {
79-
return this.intl.t('institutions.dashboard.object-list.table-items.no-funder-info');
73+
return this.missingItemPlaceholder;
8074
}
8175
return searchResult.funders.map((funder: { name: string }) => funder.name).join(', ');
8276
},

translations/en-us.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -900,11 +900,8 @@ institutions:
900900
funder_name: Funder Name
901901
registration_schema: 'Registration Schema'
902902
table-items:
903-
no-info: 'No {field}'
904-
no-storage-info: 'No Storage Info'
905-
no-metrics: 'No metrics'
906-
no-license-info: 'No License Info'
907-
no-funder-info: 'No Funder info'
903+
missing-info: '-'
904+
no-contributors: 'Contributor no longer affiliated'
908905
permission-level: '({permissionLevel})'
909906
projects_panel: 'Total Projects'
910907
departments_panel: Departments

0 commit comments

Comments
 (0)