Skip to content

Commit 7a499e8

Browse files
authored
[ENG-8078] Show a dedicated empty linked services page when no LINK add-on is configured (#2574)
1 parent e050955 commit 7a499e8

File tree

4 files changed

+57
-39
lines changed

4 files changed

+57
-39
lines changed

app/guid-node/links/styles.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,8 @@
2222
max-width: 50px;
2323
max-height: 50px;
2424
}
25+
26+
.links-page-wrapper {
27+
margin: 20px;
28+
}
29+

app/guid-node/links/template.hbs

Lines changed: 47 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,47 @@
1-
<h2>{{t 'links.linked-services'}}</h2>
2-
3-
<table local-class='table'>
4-
<thead>
5-
<tr local-class='table-row'>
6-
<th local-class='table-header'>{{t 'links.linked-service'}}</th>
7-
<th local-class='table-header'>{{t 'links.display-name'}}</th>
8-
<th local-class='table-header'>{{t 'links.resource-type'}}</th>
9-
<th local-class='table-header'>
10-
{{#if this.currentUserCanEdit}}
11-
<OsfLink
12-
@route='guid-node.addons'
13-
@queryParams={{hash
14-
activeFilterType='verified-link'
15-
tabIndex='1'
16-
}}
17-
@models={{array this.model.node.id}}
18-
>
19-
{{t 'links.edit'}}
20-
</OsfLink>
21-
{{/if}}
22-
</th>
23-
</tr>
24-
</thead>
25-
<tbody>
26-
{{#each this.model.configuredLinkAddons as |configuredLinkAddon|}}
27-
<tr local-class='table-row'>
28-
<td local-class='table-cell'>
29-
<img alt={{t 'links.logo'}} local-class='logo' src={{configuredLinkAddon.externalLinkService.iconUrl}}>
30-
<span>{{configuredLinkAddon.externalLinkService.displayName}}</span>
31-
</td>
32-
<td local-class='table-cell'>{{configuredLinkAddon.displayName}}</td>
33-
<td local-class='table-cell'>{{configuredLinkAddon.resourceType}}</td>
34-
<td local-class='table-cell'><a href={{configuredLinkAddon.targetUrl}}>{{t 'links.link'}}</a></td>
35-
</tr>
36-
{{/each}}
37-
</tbody>
38-
</table>
1+
<div local-class='links-page-wrapper'>
2+
<h2>{{t 'links.linked-services'}}</h2>
3+
{{#if this.model.configuredLinkAddons}}
4+
<table local-class='table'>
5+
<thead>
6+
<tr local-class='table-row'>
7+
<th local-class='table-header'>{{t 'links.linked-service'}}</th>
8+
<th local-class='table-header'>{{t 'links.display-name'}}</th>
9+
<th local-class='table-header'>{{t 'links.resource-type'}}</th>
10+
<th local-class='table-header'>
11+
{{#if this.currentUserCanEdit}}
12+
<OsfLink
13+
@route='guid-node.addons'
14+
@queryParams={{hash
15+
activeFilterType='verified-link'
16+
tabIndex='1'
17+
}}
18+
@models={{array this.model.node.id}}
19+
>
20+
{{t 'links.edit'}}
21+
</OsfLink>
22+
{{/if}}
23+
</th>
24+
</tr>
25+
</thead>
26+
<tbody>
27+
{{#each this.model.configuredLinkAddons as |configuredLinkAddon|}}
28+
<tr local-class='table-row'>
29+
<td local-class='table-cell'>
30+
<img alt={{t 'links.logo'}} local-class='logo'
31+
src={{configuredLinkAddon.externalLinkService.iconUrl}}>
32+
<span>{{configuredLinkAddon.externalLinkService.displayName}}</span>
33+
</td>
34+
<td local-class='table-cell'>{{configuredLinkAddon.displayName}}</td>
35+
<td local-class='table-cell'>{{configuredLinkAddon.resourceType}}</td>
36+
<td local-class='table-cell'><a href={{configuredLinkAddon.targetUrl}}>{{t 'links.link'}}</a></td>
37+
</tr>
38+
{{/each}}
39+
</tbody>
40+
</table>
41+
{{else}}
42+
<p>{{t 'links.empty-screen-message'}}</p>
43+
{{#if this.currentUserCanEdit}}
44+
<p> {{t 'links.point-to-addons-message'}} <a href='/{{this.model.node.id}}/addons?activeFilterType=verified-link'>{{t 'addons.heading'}}</a></p>
45+
{{/if}}
46+
{{/if}}
47+
</div>

lib/osf-components/addon/components/addons-service/file-manager/component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import AuthorizedAccountModel from 'ember-osf-web/models/authorized-account';
1414
import ConfiguredAddonModel from 'ember-osf-web/models/configured-addon';
1515
import captureException, { getApiErrorMessage } from 'ember-osf-web/utils/capture-exception';
1616
import ConfiguredLinkAddonModel from 'ember-osf-web/models/configured-link-addon';
17+
import AuthorizedLinkAccountModel from 'ember-osf-web/models/authorized-link-account';
1718

1819
interface Args {
1920
configuredAddon?: ConfiguredAddonModel;
@@ -48,7 +49,8 @@ export default class FileManager extends Component<Args> {
4849
}
4950

5051
get isLinkAddon() {
51-
return this.operationInvocableModel instanceof ConfiguredLinkAddonModel;
52+
return this.operationInvocableModel instanceof ConfiguredLinkAddonModel ||
53+
this.operationInvocableModel instanceof AuthorizedLinkAccountModel ;
5254
}
5355

5456
constructor(owner: unknown, args: Args) {

translations/en-us.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ links:
381381
linked-service: 'Linked Service'
382382
display-name: 'Display Name'
383383
resource-type: 'Resource Type'
384+
empty-screen-message: 'This project has no configured linked services at a moment '
385+
point-to-addons-message: 'In order to add linked service visit'
384386
link: 'Link'
385387
edit: 'Edit'
386388
icon: '{addonName} icon'

0 commit comments

Comments
 (0)