Remove superfluous uses of Object.freeze

This is no longer needed!
https://guides.emberjs.com/release/upgrading/current-edition/native-classes/#toc_properties-and-fields
This commit is contained in:
Buck Doyle 2020-06-12 15:48:52 -05:00
parent a4be011141
commit c1cc51a057
13 changed files with 22 additions and 22 deletions

View File

@ -2,9 +2,9 @@ import WatchableNamespaceIDs from './watchable-namespace-ids';
import addToPath from 'nomad-ui/utils/add-to-path';
export default class JobAdapter extends WatchableNamespaceIDs {
relationshipFallbackLinks = Object.freeze({
relationshipFallbackLinks = {
summary: '/summary',
});
};
fetchRawDefinition(job) {
const url = this.urlForFindRecord(job.get('id'), 'job');

View File

@ -1,7 +1,7 @@
import Watchable from './watchable';
export default class PluginAdapter extends Watchable {
queryParamsToAttrs = Object.freeze({
queryParamsToAttrs = {
type: 'type',
});
};
}

View File

@ -1,8 +1,8 @@
import WatchableNamespaceIDs from './watchable-namespace-ids';
export default class VolumeAdapter extends WatchableNamespaceIDs {
queryParamsToAttrs = Object.freeze({
queryParamsToAttrs = {
type: 'type',
plugin_id: 'plugin.id',
});
};
}

View File

@ -63,7 +63,7 @@ export default class TaskGroupParent extends Component {
return this.taskGroup.tasks.filter(task => activeTaskStateNames.includes(task.name));
}
taskSorting = Object.freeze(['name']);
taskSorting = ['name'];
@sort('tasksWithRunningStates', 'taskSorting') sortedTasks;
clickedOpen = false;

View File

@ -5,7 +5,7 @@ export default class PageSizeSelect extends Component {
@service userSettings;
tagName = '';
pageSizeOptions = Object.freeze([10, 25, 50]);
pageSizeOptions = [10, 25, 50];
onChange() {}
}

View File

@ -32,7 +32,7 @@ export default class ExecController extends Controller {
@mapBy('pendingAndRunningAllocations', 'taskGroup') pendingAndRunningTaskGroups;
@uniq('pendingAndRunningTaskGroups') uniquePendingAndRunningTaskGroups;
taskGroupSorting = Object.freeze(['name']);
taskGroupSorting = ['name'];
@sort('uniquePendingAndRunningTaskGroups', 'taskGroupSorting') sortedTaskGroups;
setUpTerminal(Terminal) {

View File

@ -10,12 +10,12 @@ export default class ClientsRoute extends Route.extend(WithForbiddenState) {
@service store;
@service system;
breadcrumbs = Object.freeze([
breadcrumbs = [
{
label: 'Clients',
args: ['clients.index'],
},
]);
];
beforeModel() {
return this.get('system.leader');

View File

@ -6,12 +6,12 @@ import notifyForbidden from 'nomad-ui/utils/notify-forbidden';
export default class PluginsRoute extends Route.extend(WithForbiddenState) {
@service store;
breadcrumbs = Object.freeze([
breadcrumbs = [
{
label: 'Storage',
args: ['csi.index'],
},
]);
];
model() {
return this.store.query('plugin', { type: 'csi' }).catch(notifyForbidden(this));

View File

@ -9,12 +9,12 @@ export default class VolumesRoute extends Route.extend(WithForbiddenState) {
@service system;
@service store;
breadcrumbs = Object.freeze([
breadcrumbs = [
{
label: 'Storage',
args: ['csi.index'],
},
]);
];
queryParams = {
volumeNamespace: {

View File

@ -10,12 +10,12 @@ export default class JobsRoute extends Route.extend(WithForbiddenState) {
@service store;
@service system;
breadcrumbs = Object.freeze([
breadcrumbs = [
{
label: 'Jobs',
args: ['jobs.index'],
},
]);
];
queryParams = {
jobNamespace: {

View File

@ -8,12 +8,12 @@ export default class RunRoute extends Route {
@service store;
@service system;
breadcrumbs = Object.freeze([
breadcrumbs = [
{
label: 'Run',
args: ['jobs.run'],
},
]);
];
beforeModel() {
if (this.can.cannot('run job')) {

View File

@ -10,12 +10,12 @@ export default class ServersRoute extends Route.extend(WithForbiddenState) {
@service store;
@service system;
breadcrumbs = Object.freeze([
breadcrumbs = [
{
label: 'Servers',
args: ['servers.index'],
},
]);
];
beforeModel() {
return this.get('system.leader');

View File

@ -6,7 +6,7 @@ export default class VolumeSerializer extends ApplicationSerializer {
externalId: 'ExternalID',
};
embeddedRelationships = Object.freeze(['writeAllocations', 'readAllocations']);
embeddedRelationships = ['writeAllocations', 'readAllocations'];
// Volumes treat Allocations as embedded records. Ember has an
// EmbeddedRecords mixin, but it assumes an application is using