Skip to content

Commit

Permalink
don't show root folder for configured compute addons
Browse files Browse the repository at this point in the history
  • Loading branch information
felliott committed Jan 2, 2025
1 parent 41c2f7b commit 6535fdf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
22 changes: 12 additions & 10 deletions app/guid-node/addons/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,18 @@
</Button>
</span>
</div>
<div
data-test-configured-addon-root-folder
local-class='configured-addon-root-folder'
>
{{#if configuredAddon.rootFolder}}
{{configuredAddon.rootFolder}}
{{else}}
{{t 'addons.list.root-folder-not-set'}}
{{/if}}
</div>
{{#if configuredAddon.hasRootFolder}}
<div
data-test-configured-addon-root-folder
local-class='configured-addon-root-folder'
>
{{#if configuredAddon.rootFolder}}
{{configuredAddon.rootFolder}}
{{else}}
{{t 'addons.list.root-folder-not-set'}}
{{/if}}
</div>
{{/if}}
<div local-class='configured-addon-connected-to'>
{{t 'addons.list.connected-to-account'}} {{configuredAddon.baseAccount.displayName}}
</div>
Expand Down
4 changes: 4 additions & 0 deletions app/models/configured-addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ export default class ConfiguredAddonModel extends Model {
// To be implemented in child classes
return;
}

get hasRootFolder() {
return true;
}
}
5 changes: 5 additions & 0 deletions app/models/configured-computing-addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export default class ConfiguredComputingAddonModel extends ConfiguredAddonModel
get externalServiceId() {
return (this as ConfiguredComputingAddonModel).belongsTo('externalComputingService').id();
}

get hasRootFolder() {
return false;
}

}

declare module 'ember-data/types/registries/model' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Item, ItemType } from 'ember-osf-web/models/addon-operation-invocation'
import AuthorizedAccountModel from 'ember-osf-web/models/authorized-account';
import AuthorizedComputingAccountModel from 'ember-osf-web/models/authorized-computing-account';
import ConfiguredAddonModel from 'ember-osf-web/models/configured-addon';
import ConfiguredComputingAddonModel from 'ember-osf-web/models/configured-computing-addon';


interface Args {
Expand All @@ -25,7 +26,11 @@ export default class ConfiguredAddonEdit extends Component<Args> {
};

get hasRootFolder() {
return !(this.args.authorizedAccount instanceof AuthorizedComputingAccountModel);
return !(
this.args.authorizedAccount instanceof AuthorizedComputingAccountModel
||
this.args.configuredAddon instanceof ConfiguredComputingAddonModel
);
}

get invalidDisplayName() {
Expand Down

0 comments on commit 6535fdf

Please sign in to comment.