Skip to content

Commit

Permalink
Remove the concept of caching namespaces; we now expect them to be re…
Browse files Browse the repository at this point in the history
…source-independent
  • Loading branch information
philrenaud authored and lgfa29 committed Jul 11, 2022
1 parent 96f0021 commit a56cffd
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 41 deletions.
9 changes: 2 additions & 7 deletions ui/app/controllers/csi/volumes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class IndexController extends Controller.extend(

fuzzySearchEnabled = true;

@computed('qpNamespace', 'model.namespaces.[]', 'system.cachedNamespace')
@computed('qpNamespace', 'model.namespaces.[]')
get optionsNamespaces() {
const availableNamespaces = this.model.namespaces.map((namespace) => ({
key: namespace.name,
Expand All @@ -81,7 +81,7 @@ export default class IndexController extends Controller.extend(
// eslint-disable-next-line ember/no-incorrect-calls-with-inline-anonymous-functions
scheduleOnce('actions', () => {
// eslint-disable-next-line ember/no-side-effects
this.set('qpNamespace', this.system.cachedNamespace || '*');
this.set('qpNamespace', '*');
});
}

Expand All @@ -101,11 +101,6 @@ export default class IndexController extends Controller.extend(
@alias('listSorted') listToSearch;
@alias('listSearched') sortedVolumes;

@action
cacheNamespace(namespace) {
set(this, 'system.cachedNamespace', namespace);
}

setFacetQueryParam(queryParam, selection) {
this.set(queryParam, serialize(selection));
}
Expand Down
9 changes: 2 additions & 7 deletions ui/app/controllers/jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default class IndexController extends Controller.extend(
}));
}

@computed('qpNamespace', 'model.namespaces.[]', 'system.cachedNamespace')
@computed('qpNamespace', 'model.namespaces.[]')
get optionsNamespaces() {
const availableNamespaces = this.model.namespaces.map((namespace) => ({
key: namespace.name,
Expand All @@ -181,7 +181,7 @@ export default class IndexController extends Controller.extend(
if (!availableNamespaces.mapBy('key').includes(this.qpNamespace)) {
scheduleOnce('actions', () => {
// eslint-disable-next-line ember/no-side-effects
this.set('qpNamespace', this.system.cachedNamespace || '*');
this.set('qpNamespace', '*');
});
}

Expand Down Expand Up @@ -252,11 +252,6 @@ export default class IndexController extends Controller.extend(

isShowingDeploymentDetails = false;

@action
cacheNamespace(namespace) {
set(this, 'system.cachedNamespace', namespace);
}

setFacetQueryParam(queryParam, selection) {
this.set(queryParam, serialize(selection));
}
Expand Down
7 changes: 1 addition & 6 deletions ui/app/controllers/optimize.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class OptimizeController extends Controller {
if (!availableNamespaces.mapBy('key').includes(this.qpNamespace)) {
scheduleOnce('actions', () => {
// eslint-disable-next-line ember/no-side-effects
this.qpNamespace = this.system.cachedNamespace || '*';
this.qpNamespace = '*';
});
}
Expand Down Expand Up @@ -247,11 +247,6 @@ export default class OptimizeController extends Controller {
});
}
@action
cacheNamespace(namespace) {
this.system.cachedNamespace = namespace;
}
@action
setFacetQueryParam(queryParam, selection) {
this[queryParam] = serialize(selection);
Expand Down
6 changes: 0 additions & 6 deletions ui/app/services/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ export default class SystemService extends Service {
);
}

// The cachedNamespace is set on pages that have a namespaces filter.
// It is set so other pages that have a namespaces filter can default to
// what the previous namespaces filter page used rather than defaulting
// to 'default' or '*'.
@tracked cachedNamespace = null;

@task(function* () {
const emptyLicense = { License: { Features: [] } };

Expand Down
4 changes: 1 addition & 3 deletions ui/app/templates/csi/volumes/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
@label="Namespace"
@options={{this.optionsNamespaces}}
@selection={{this.qpNamespace}}
@onSelect={{action
(queue (action this.cacheNamespace) (action this.setFacetQueryParam "qpNamespace"))
}}
@onSelect={{action this.setFacetQueryParam "qpNamespace"}}
/>
</div>
</div>
Expand Down
7 changes: 1 addition & 6 deletions ui/app/templates/jobs/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@
@label="Namespace"
@options={{this.optionsNamespaces}}
@selection={{this.qpNamespace}}
@onSelect={{action
(queue
(action this.cacheNamespace)
(action this.setFacetQueryParam "qpNamespace")
)
}}
@onSelect={{action this.setFacetQueryParam "qpNamespace"}}
/>
{{/if}}
<MultiSelectDropdown
Expand Down
7 changes: 1 addition & 6 deletions ui/app/templates/optimize.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@
@label="Namespace"
@options={{this.optionsNamespaces}}
@selection={{this.qpNamespace}}
@onSelect={{action
(queue
(action this.cacheNamespace)
(action this.setFacetQueryParam "qpNamespace")
)
}}
@onSelect={{action this.setFacetQueryParam "qpNamespace"}}
/>
{{/if}}
<MultiSelectDropdown
Expand Down

0 comments on commit a56cffd

Please sign in to comment.