Skip to content

Commit 7d1c063

Browse files
authored
[ENG-8255][ENG-8244] Show item name when deleting linked service; fix linked service page for mobile (#2593)
1 parent a6a0902 commit 7d1c063

File tree

5 files changed

+37
-4
lines changed

5 files changed

+37
-4
lines changed

app/guid-node/addons/index/template.hbs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,18 @@
243243
{{manager.selectedConfiguration.displayName}}
244244
</div>
245245
<div>
246-
{{#if manager.selectedConfiguration.rootFolder}}
247-
{{manager.selectedConfiguration.rootFolderName}}
246+
{{#if (instance-of manager.selectedConfiguration 'ConfiguredLinkAddon')}}
247+
{{#if manager.selectedConfiguration.targetUrl}}
248+
{{manager.selectedConfiguration.targetItemName}}
249+
{{else}}
250+
{{t 'addons.list.target-not-set'}}
251+
{{/if}}
248252
{{else}}
249-
{{t 'addons.list.root-folder-not-set'}}
253+
{{#if manager.selectedConfiguration.rootFolder}}
254+
{{manager.selectedConfiguration.rootFolderName}}
255+
{{else}}
256+
{{t 'addons.list.root-folder-not-set'}}
257+
{{/if}}
250258
{{/if}}
251259
</div>
252260
<div>

app/guid-node/links/styles.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
padding-top: 10px;
1010
}
1111

12+
.edit-header {
13+
min-width: 30px;
14+
}
15+
1216
.table-row {
1317
border-bottom: 1px solid $color-border-gray;
1418
}

app/guid-node/links/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<th local-class='table-header'>{{t 'links.linked-service'}}</th>
88
<th local-class='table-header'>{{t 'links.display-name'}}</th>
99
<th local-class='table-header'>{{t 'links.resource-type'}}</th>
10-
<th local-class='table-header'>
10+
<th local-class='table-header edit-header'>
1111
{{#if this.currentUserCanEdit}}
1212
<OsfLink
1313
@route='guid-node.addons'

app/helpers/instance-of.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { getOwner } from '@ember/application';
2+
import { assert } from '@ember/debug';
3+
4+
import Helper from '@ember/component/helper';
5+
6+
export default class InstanceOf extends Helper {
7+
compute([object, className]: [any, string]) {
8+
if (!object || typeof className !== 'string') {
9+
return false;
10+
}
11+
// Look up the class from the container
12+
const owner = getOwner(this);
13+
const klass = owner.factoryFor(`model:${className}`)?.class;
14+
if (!klass) {
15+
assert(`Class "${className}" not found`);
16+
return false;
17+
}
18+
return object instanceof klass;
19+
}
20+
}

translations/en-us.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ addons:
247247
confirm-remove-connected-location: 'You are about to disconnect the addon below from the project.'
248248
connected-to-account: 'Connected to account'
249249
root-folder-not-set: 'Root folder not set'
250+
target-not-set: 'Target not set'
250251
sync-details-1: 'Sync your projects with external services to help stay connected and organized. Select a category and browse the options.'
251252
sync-details-2: 'To manage all add-ons connected to your account, visit your profile settings.'
252253
sync-details-3: 'Manage your connected Add-ons, re-authorize, disconnect account, or disconnect project'

0 commit comments

Comments
 (0)