Fix query parameters structures

I’d think the codemod would handle this if it’s a requirement
but apparently not, is it a bug?
This commit is contained in:
Buck Doyle 2020-06-11 08:38:33 -05:00
parent c4e29f8afa
commit 577e85b007
15 changed files with 186 additions and 82 deletions

View File

@ -2,10 +2,14 @@ import Controller from '@ember/controller';
import { computed } from '@ember/object';
export default class FsController extends Controller {
queryParams = {
sortProperty: 'sort',
sortDescending: 'desc',
};
queryParams = [
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
sortProperty = 'Name';
sortDescending = false;

View File

@ -2,10 +2,14 @@ import Controller from '@ember/controller';
import { computed } from '@ember/object';
export default class FsController extends Controller {
queryParams = {
sortProperty: 'sort',
sortDescending: 'desc',
};
queryParams = [
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
sortProperty = 'Name';
sortDescending = false;

View File

@ -14,9 +14,11 @@ export default class ApplicationController extends Controller {
@service config;
@service system;
queryParams = {
region: 'region',
};
queryParams = [
{
region: 'region',
},
];
region = null;

View File

@ -21,16 +21,32 @@ export default class IndexController extends Controller.extend(
@alias('model.nodes') nodes;
@alias('model.agents') agents;
queryParams = {
currentPage: 'page',
searchTerm: 'search',
sortProperty: 'sort',
sortDescending: 'desc',
qpClass: 'class',
qpState: 'state',
qpDatacenter: 'dc',
qpVolume: 'volume',
};
queryParams = [
{
currentPage: 'page',
},
{
searchTerm: 'search',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
{
qpClass: 'class',
},
{
qpState: 'state',
},
{
qpDatacenter: 'dc',
},
{
qpVolume: 'volume',
},
];
currentPage = 1;
@readOnly('userSettings.pageSize') pageSize;

View File

@ -22,12 +22,20 @@ export default class IndexController extends Controller.extend(
@alias('pluginsController.isForbidden') isForbidden;
queryParams = {
currentPage: 'page',
searchTerm: 'search',
sortProperty: 'sort',
sortDescending: 'desc',
};
queryParams = [
{
currentPage: 'page',
},
{
searchTerm: 'search',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
currentPage = 1;
@readOnly('userSettings.pageSize') pageSize;

View File

@ -13,13 +13,23 @@ export default class AllocationsController extends Controller.extend(
) {
@service userSettings;
queryParams = {
currentPage: 'page',
sortProperty: 'sort',
sortDescending: 'desc',
qpHealth: 'healthy',
qpType: 'type',
};
queryParams = [
{
currentPage: 'page',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
{
qpHealth: 'healthy',
},
{
qpType: 'type',
},
];
currentPage = 1;
@readOnly('userSettings.pageSize') pageSize;

View File

@ -1,9 +1,11 @@
import Controller from '@ember/controller';
export default class VolumesController extends Controller {
queryParams = {
volumeNamespace: 'namespace',
};
queryParams = [
{
volumeNamespace: 'namespace',
},
];
isForbidden = false;

View File

@ -25,12 +25,20 @@ export default class IndexController extends Controller.extend(
@alias('volumesController.isForbidden')
isForbidden;
queryParams = {
currentPage: 'page',
searchTerm: 'search',
sortProperty: 'sort',
sortDescending: 'desc',
};
queryParams = [
{
currentPage: 'page',
},
{
searchTerm: 'search',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
currentPage = 1;
@readOnly('userSettings.pageSize') pageSize;

View File

@ -4,9 +4,11 @@ import Controller from '@ember/controller';
export default class JobsController extends Controller {
@service system;
queryParams = {
jobNamespace: 'namespace',
};
queryParams = [
{
jobNamespace: 'namespace',
},
];
isForbidden = false;

View File

@ -18,16 +18,32 @@ export default class IndexController extends Controller.extend(Sortable, Searcha
@alias('jobsController.isForbidden') isForbidden;
queryParams = {
currentPage: 'page',
searchTerm: 'search',
sortProperty: 'sort',
sortDescending: 'desc',
qpType: 'type',
qpStatus: 'status',
qpDatacenter: 'dc',
qpPrefix: 'prefix',
};
queryParams = [
{
currentPage: 'page',
},
{
searchTerm: 'search',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
{
qpType: 'type',
},
{
qpStatus: 'status',
},
{
qpDatacenter: 'dc',
},
{
qpPrefix: 'prefix',
},
];
currentPage = 1;
@readOnly('userSettings.pageSize') pageSize;

View File

@ -12,12 +12,20 @@ export default class AllocationsController extends Controller.extend(
Searchable,
WithNamespaceResetting
) {
queryParams = {
currentPage: 'page',
searchTerm: 'search',
sortProperty: 'sort',
sortDescending: 'desc',
};
queryParams = [
{
currentPage: 'page',
},
{
searchTerm: 'search',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
currentPage = 1;
pageSize = 25;

View File

@ -9,10 +9,14 @@ export default class EvaluationsController extends Controller.extend(
WithNamespaceResetting,
Sortable
) {
queryParams = {
sortProperty: 'sort',
sortDescending: 'desc',
};
queryParams = [
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
sortProperty = 'modifyIndex';
sortDescending = true;

View File

@ -9,11 +9,17 @@ import classic from 'ember-classic-decorator';
export default class IndexController extends Controller.extend(WithNamespaceResetting) {
@service system;
queryParams = {
currentPage: 'page',
sortProperty: 'sort',
sortDescending: 'desc',
};
queryParams = [
{
currentPage: 'page',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
currentPage = 1;

View File

@ -15,12 +15,20 @@ export default class TaskGroupController extends Controller.extend(
) {
@service userSettings;
queryParams = {
currentPage: 'page',
searchTerm: 'search',
sortProperty: 'sort',
sortDescending: 'desc',
};
queryParams = [
{
currentPage: 'page',
},
{
searchTerm: 'search',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
currentPage = 1;
@readOnly('userSettings.pageSize') pageSize;

View File

@ -6,11 +6,17 @@ export default class ServersController extends Controller.extend(Sortable) {
@alias('model.nodes') nodes;
@alias('model.agents') agents;
queryParams = {
currentPage: 'page',
sortProperty: 'sort',
sortDescending: 'desc',
};
queryParams = [
{
currentPage: 'page',
},
{
sortProperty: 'sort',
},
{
sortDescending: 'desc',
},
];
currentPage = 1;
pageSize = 8;