2023-03-01 09:39:41 -06:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
2020-08-17 14:56:19 -04:00
|
|
|
import Controller from '@ember/controller';
|
|
|
|
|
|
|
|
|
|
export default class ScopesScopeAuthenticateController extends Controller {
|
|
|
|
|
// =attributes
|
|
|
|
|
|
|
|
|
|
/**
|
2020-10-03 12:43:12 -04:00
|
|
|
* Moves the global scope to index 0.
|
2020-08-17 14:56:19 -04:00
|
|
|
* @type {Array}
|
|
|
|
|
*/
|
2022-07-18 09:08:09 -07:00
|
|
|
|
2020-10-03 12:43:12 -04:00
|
|
|
get sortedScopes() {
|
|
|
|
|
return [
|
|
|
|
|
...this.model.scopes.filter((scope) => scope.id === 'global'),
|
|
|
|
|
...this.model.scopes.filter((scope) => scope.id !== 'global'),
|
2020-11-16 15:08:59 -05:00
|
|
|
];
|
2020-10-03 12:43:12 -04:00
|
|
|
}
|
2020-08-17 14:56:19 -04:00
|
|
|
}
|