Skip to content

Commit 7911d3e

Browse files
authored
Deprecate ember-based UI Plugins (#5230)
1 parent 1da7497 commit 7911d3e

File tree

6 files changed

+191
-158
lines changed

6 files changed

+191
-158
lines changed

app/authenticated/cluster/edit/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<BannerMessage
88
@color="bg-warning"
99
@icon="icon-alert"
10-
@message={{t "clustersPage.rke1DeprecationMessage" htmlSafe=true}}
10+
@message={{t "clustersPage.emberDeprecationMessage" htmlSafe=true}}
1111
/>
1212

1313
<CruCluster

lib/global-admin/addon/clusters/new/route.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { get, set } from '@ember/object';
1111

1212
export default Route.extend({
1313
globalStore: service(),
14+
intl: service(),
1415

1516
model() {
1617
const gs = this.globalStore;
@@ -33,7 +34,7 @@ export default Route.extend({
3334

3435
afterModel(model) {
3536
// load the css/js url here, if the url loads fail we should error the driver out
36-
// show the driver in the ui, greyed out, and possibly add error text "can not load comonent from url [put url here]"
37+
// show the driver in the ui, greyed out, and possibly add error text "can not load component from url [put url here]"
3738
let { kontainerDrivers } = model;
3839
let externalDrivers = kontainerDrivers.filter( (d) => d.uiUrl !== '' && d.state === 'active');
3940
let promises = {};
@@ -59,6 +60,12 @@ export default Route.extend({
5960
let match = kontainerDrivers.findBy('id', tmp);
6061

6162
console.log('Error Loading External Component for: ', match);
63+
64+
// Try and find by name if we could not find by id
65+
if (!match) {
66+
match = kontainerDrivers.findBy('name', tmp);
67+
}
68+
6269
if (match && get(match, 'scriptError') !== true) {
6370
set(match, 'scriptError', get(this, 'intl').t('clusterNew.externalError'));
6471
}

lib/global-admin/addon/clusters/new/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<BannerMessage
2424
@color="bg-warning"
2525
@icon="icon-alert"
26-
@message={{t "clustersPage.rke1DeprecationMessage" htmlSafe=true}}
26+
@message={{t "clustersPage.emberDeprecationMessage" htmlSafe=true}}
2727
/>
2828
{{outlet}}
2929
</section>

lib/shared/addon/components/cru-cluster/component.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,24 @@ export default Component.extend(ViewNewEdit, ChildHook, {
468468
return true;
469469
}),
470470

471+
hasDriverComponentError: computed('showDriverComponent', function() {
472+
const {
473+
provider,
474+
kontainerDrivers,
475+
} = this;
476+
477+
if (kontainerDrivers?.custom) {
478+
const driver = kontainerDrivers.custom.find((d) => d.id === provider || d.name === provider);
479+
480+
if (driver) {
481+
// Return whether the driver has a script error
482+
return !!driver.scriptError;
483+
}
484+
}
485+
486+
return false;
487+
}),
488+
471489
doSave(opt) {
472490
opt = opt || {};
473491
opt.qp = { '_replace': 'true' };

0 commit comments

Comments
 (0)