Skip to content

Commit

Permalink
Merge pull request rancher#5156 from richard-cox/ember-small-bump
Browse files Browse the repository at this point in the history
Bump ember from 3.24.0 to 3.24.7
  • Loading branch information
richard-cox committed Sep 5, 2024
1 parent 76b6fd3 commit e301f65
Show file tree
Hide file tree
Showing 304 changed files with 1,813 additions and 1,786 deletions.
26 changes: 13 additions & 13 deletions app/application/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export default Route.extend({
}

// Find out if auth is enabled
return get(this, 'access').detect().finally(() => {
return get(this, 'language').initLanguage();
return this.access.detect().finally(() => {
return this.language.initLanguage();
});
})();
},
Expand All @@ -57,14 +57,14 @@ export default Route.extend({
},
loading(transition) {
this.incrementProperty('loadingId');
let id = get(this, 'loadingId');
let id = this.loadingId;

cancel(get(this, 'hideTimer'));
cancel(this.hideTimer);

// console.log('Loading', id);
this.notifyAction('need-to-load');

if ( !get(this, 'loadingShown') ) {
if ( !this.loadingShown ) {
set(this, 'loadingShown', true);
// console.log('Loading Show', id);
this.notifyLoading(true);
Expand Down Expand Up @@ -102,7 +102,7 @@ export default Route.extend({
});
}

if ( get(this, 'loadingId') === id ) {
if ( this.loadingId === id ) {
if ( transition.isAborted ) {
// console.log('Loading aborted', id, get(this, 'loadingId'));
set(this, 'hideTimer', next(hide));
Expand Down Expand Up @@ -143,8 +143,8 @@ export default Route.extend({
},

logout(transition, errorMsg) {
let session = get(this, 'session');
let access = get(this, 'access');
let session = this.session;
let access = this.access;

if ( isEmbedded() ) {
dashboardWindow().postMessage({ action: 'logout' });
Expand All @@ -161,7 +161,7 @@ export default Route.extend({
url = `${ window.location.origin }/dashboard/auth/login`;
}

get(this, 'tab-session').clear();
this['tab-session'].clear();
set(this, `session.${ C.SESSION.CONTAINER_ROUTE }`, undefined);
set(this, `session.${ C.SESSION.ISTIO_ROUTE }`, undefined);
set(this, `session.${ C.SESSION.CLUSTER_ROUTE }`, undefined);
Expand All @@ -172,7 +172,7 @@ export default Route.extend({
}

if ( get(this, 'modal.modalVisible') ) {
get(this, 'modal').toggleModal();
this.modal.toggleModal();
}

if ( errorMsg ) {
Expand All @@ -184,11 +184,11 @@ export default Route.extend({
},

langToggle() {
let svc = get(this, 'language');
let svc = this.language;
let cur = svc.getLocale();

if ( cur === 'none' ) {
svc.sideLoadLanguage(get(this, 'previousLang') || 'en-us');
svc.sideLoadLanguage(this.previousLang || 'en-us');
} else {
set(this, 'previousLang', cur);
svc.sideLoadLanguage('none');
Expand All @@ -201,7 +201,7 @@ export default Route.extend({
}),

finishLogin() {
let session = get(this, 'session');
let session = this.session;

let backTo = session.get(C.SESSION.BACK_TO);

Expand Down
2 changes: 1 addition & 1 deletion app/apps-tab/detail/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default Controller.extend({

actions: {
toggleExpand(instId) {
let list = this.get('expandedInstances');
let list = this.expandedInstances;

if ( list.includes(instId) ) {
list.removeObject(instId);
Expand Down
2 changes: 1 addition & 1 deletion app/apps-tab/detail/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default Route.extend({
store: service(),

model(params) {
const store = get(this, 'store');
const store = this.store;

return hash({ app: store.find('app', get(params, 'app_id')), });
},
Expand Down
4 changes: 2 additions & 2 deletions app/apps-tab/index/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default Controller.extend({
}),

filteredApps: computed('model.apps.@each.{type,isFromCatalog,tags,state}', 'tags', 'searchText', function() {
var needTags = get(this, 'tags');
var needTags = this.tags;

var apps = get(this, 'model.apps').filter((ns) => !C.REMOVEDISH_STATES.includes(get(ns, 'state')));

Expand All @@ -31,7 +31,7 @@ export default Controller.extend({
apps = apps.filterBy('isIstio', false);
apps = apps.sortBy('displayName');

const { matches } = filter(apps, get(this, 'searchText'));
const { matches } = filter(apps, this.searchText);

const group = [];
let dataIndex = 0;
Expand Down
6 changes: 3 additions & 3 deletions app/apps-tab/index/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ export default Route.extend({
store: service(),

beforeModel() {
return get(this, 'catalog').fetchUnScopedCatalogs();
return this.catalog.fetchUnScopedCatalogs();
},


model() {
return this.get('store').findAll('app')
return this.store.findAll('app')
.then((apps) => ({ apps, }));
},

afterModel(model/* , transition */) {
return get(this, 'catalog').fetchAppTemplates(get(model, 'apps'));
return this.catalog.fetchAppTemplates(get(model, 'apps'));
},

setDefaultRoute: on('activate', function() {
Expand Down
4 changes: 2 additions & 2 deletions app/authenticated/apikeys/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ export default Controller.extend({
project: alias('scope.currentProject'),
actions: {
newApikey() {
const cred = this.get('globalStore').createRecord({ type: 'token', });
const cred = this.globalStore.createRecord({ type: 'token', });

this.get('modalService').toggleModal('modal-edit-apikey', cred);
this.modalService.toggleModal('modal-edit-apikey', cred);
},
},

Expand Down
2 changes: 1 addition & 1 deletion app/authenticated/apikeys/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import Route from '@ember/routing/route';

export default Route.extend({
model() {
return hash({ tokens: this.get('globalStore').findAll('token'), });
return hash({ tokens: this.globalStore.findAll('token'), });
},
});
2 changes: 1 addition & 1 deletion app/authenticated/cluster/backups/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default Controller.extend({
rows: computed('model.[]', function() {
let { currentClusterId } = this;

return get(this, 'model').filterBy('clusterId', currentClusterId);
return this.model.filterBy('clusterId', currentClusterId);
}),

});
9 changes: 5 additions & 4 deletions app/authenticated/cluster/cis/scan/controller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { filterBy, alias } from '@ember/object/computed';
import Controller from '@ember/controller';
import { downloadFile, generateZip } from 'shared/utils/download-files';
import { get, computed } from '@ember/object';
Expand Down Expand Up @@ -62,9 +63,9 @@ export default Controller.extend({
sortBy: 'date',
descending: true,

runningClusterScans: computed.filterBy('clusterScans', 'isRunning', true),
runningClusterScans: filterBy('clusterScans', 'isRunning', true),

isRKE: computed.alias('scope.currentCluster.isRKE'),
isRKE: alias('scope.currentCluster.isRKE'),
actions: {
runScan() {
get(this, 'scope.currentCluster').send('runCISScan');
Expand All @@ -73,7 +74,7 @@ export default Controller.extend({
get(this, 'scope.currentCluster').send('edit', { scrollTo: 'security-scan' });
},
setAlert() {
get(this, 'router').transitionTo('authenticated.cluster.alert.new', { queryParams: { for: 'security-scan' } });
this.router.transitionTo('authenticated.cluster.alert.new', { queryParams: { for: 'security-scan' } });
}
},
bulkActionHandler: computed(function() {
Expand All @@ -87,7 +88,7 @@ export default Controller.extend({
await downloadFile(`cis-scans.zip`, zip, get(zip, 'type'));
},
promptDelete: async(scans) => {
get(this, 'modalService').toggleModal('confirm-delete', {
this.modalService.toggleModal('confirm-delete', {
escToClose: true,
resources: scans
});
Expand Down
9 changes: 5 additions & 4 deletions app/authenticated/cluster/cis/scan/detail/controller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { filterBy } from '@ember/object/computed';
import Controller from '@ember/controller';
import { computed, get, set } from '@ember/object';
import { inject as service } from '@ember/service';
Expand Down Expand Up @@ -36,20 +37,20 @@ export default Controller.extend({
],
sortBy: 'state',

runningClusterScans: computed.filterBy('clusterScans', 'isRunning', true),
runningClusterScans: filterBy('clusterScans', 'isRunning', true),

actions: {
async runScan() {
get(this, 'scope.currentCluster').send('runCISScan', { onRun: () => get(this, 'router').replaceWith('authenticated.cluster.cis/scan') });
get(this, 'scope.currentCluster').send('runCISScan', { onRun: () => this.router.replaceWith('authenticated.cluster.cis/scan') });
},
download() {
get(this, 'model.scan').send('download');
},
async delete() {
await get(this, 'modalService').toggleModal('confirm-delete', {
await this.modalService.toggleModal('confirm-delete', {
escToClose: true,
resources: [get(this, 'model.scan')],
onDeleteFinished: () => get(this, 'router').replaceWith('authenticated.cluster.cis/scan')
onDeleteFinished: () => this.router.replaceWith('authenticated.cluster.cis/scan')
});
},
clearSearchText() {
Expand Down
4 changes: 2 additions & 2 deletions app/authenticated/cluster/cis/scan/detail/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export default Route.extend({
globalStore: service(),
scope: service(),
model(params) {
const scan = get(this, 'globalStore').find('clusterScan', params.scan_id);
const scan = this.globalStore.find('clusterScan', params.scan_id);
const report = (async() => {
return (await scan).loadReport('report');
})();

return hash({
clusterScans: get(this, 'globalStore').findAll('clusterScan'),
clusterScans: this.globalStore.findAll('clusterScan'),
scan,
report,
nodes: get(this, 'scope.currentCluster.nodes'),
Expand Down
5 changes: 2 additions & 3 deletions app/authenticated/cluster/cis/scan/route.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import { get, } from '@ember/object';
import { hash } from 'rsvp';

export default Route.extend({
globalStore: service(),
scope: service(),

model() {
const clusterScans = get(this, 'globalStore').findAll('clusterScan');
const clusterScans = this.globalStore.findAll('clusterScan');

return hash({
clusterScans,
Expand All @@ -18,7 +17,7 @@ export default Route.extend({

return await Promise.all(reportPromises);
})(),
clusterTemplateRevisions: get(this, 'globalStore').findAll('clustertemplaterevision')
clusterTemplateRevisions: this.globalStore.findAll('clustertemplaterevision')
});
},
});
4 changes: 2 additions & 2 deletions app/authenticated/cluster/cluster-catalogs/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ export default Controller.extend({

actions: {
add() {
const record = get(this, 'globalStore').createRecord({
const record = this.globalStore.createRecord({
type: 'clustercatalog',
kind: 'helm',
branch: 'master',
clusterId: get(this, 'scope.currentCluster.id'),
});

get(this, 'modalService').toggleModal('modal-edit-catalog', {
this.modalService.toggleModal('modal-edit-catalog', {
model: record,
scope: 'cluster'
});
Expand Down
5 changes: 2 additions & 3 deletions app/authenticated/cluster/cluster-catalogs/route.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import { get } from '@ember/object';
import { hash } from 'rsvp';

export default Route.extend({
catalog: service(),

model() {
return hash({
clusterCatalogs: get(this, 'catalog').fetchCatalogs('clusterCatalog'),
globalCatalogs: get(this, 'catalog').fetchCatalogs()
clusterCatalogs: this.catalog.fetchCatalogs('clusterCatalog'),
globalCatalogs: this.catalog.fetchCatalogs()
});
},
});
2 changes: 1 addition & 1 deletion app/authenticated/cluster/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default Controller.extend({

wasReady: true,
watchReady: observer('model.isReady', function() {
const wasReady = get(this, 'wasReady');
const wasReady = this.wasReady;
const isReady = get(this, 'model.isReady');

set(this, 'wasReady', isReady);
Expand Down
4 changes: 2 additions & 2 deletions app/authenticated/cluster/edit/controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Controller from '@ember/controller';
import { alias } from '@ember/object/computed';
import { get, observer } from '@ember/object';
import { observer } from '@ember/object';
import { inject as service } from '@ember/service';

export default Controller.extend({
Expand All @@ -21,7 +21,7 @@ export default Controller.extend({

scrolling: observer('model.activated', function() {
const intervalId = setInterval(() => {
const element = $(`#${ get(this, 'scrollTo') }`); // eslint-disable-line
const element = $(`#${ this.scrollTo }`); // eslint-disable-line

if (element.length > 0 && element.get(0).getBoundingClientRect().top !== 0) {
element.get(0).scrollIntoView(true);
Expand Down
12 changes: 8 additions & 4 deletions app/authenticated/cluster/edit/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { get, set, setProperties } from '@ember/object';
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';
import { hash, hashSettled/* , all */ } from 'rsvp';
import { loadScript, loadStylesheet, proxifyUrl } from 'shared/utils/load-script';
import {
loadScript,
loadStylesheet,
proxifyUrl
} from 'shared/utils/load-script';
import { isEmpty } from '@ember/utils';
import { scheduleOnce } from '@ember/runloop';

Expand All @@ -15,7 +19,7 @@ export default Route.extend({
roleTemplateService: service('roleTemplate'),

model() {
const globalStore = this.get('globalStore');
const globalStore = this.globalStore;

const cluster = this.modelFor('authenticated.cluster');

Expand All @@ -27,7 +31,7 @@ export default Route.extend({
nodeTemplates: globalStore.findAll('nodeTemplate'),
nodeDrivers: globalStore.findAll('nodeDriver'),
psacs: globalStore.findAll('podSecurityAdmissionConfigurationTemplate'),
roleTemplates: get(this, 'roleTemplateService').get('allFilteredRoleTemplates'),
roleTemplates: this.roleTemplateService.get('allFilteredRoleTemplates'),
users: globalStore.findAll('user'),
clusterRoleTemplateBinding: globalStore.findAll('clusterRoleTemplateBinding'),
me: get(this, 'access.principal'),
Expand Down Expand Up @@ -125,7 +129,7 @@ export default Route.extend({

console.log('Error Loading External Component for: ', match);
if (match && get(match, 'scriptError') !== true) {
set(match, 'scriptError', get(this, 'intl').t('clusterNew.externalError'));
set(match, 'scriptError', this.intl.t('clusterNew.externalError'));
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion app/authenticated/cluster/nodes/index/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default Route.extend({
model() {
const cluster = this.modelFor('authenticated.cluster');

return this.get('globalStore').findAll('node')
return this.globalStore.findAll('node')
.then((nodes) => ({
cluster,
nodes,
Expand Down
Loading

0 comments on commit e301f65

Please sign in to comment.