-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4572 from hashicorp/f-ui-region-switcher
UI: Region Switcher
- Loading branch information
Showing
39 changed files
with
847 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
'data-test-global-header': true, | ||
|
||
onHamburgerClick() {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Component from '@ember/component'; | ||
import { computed } from '@ember/object'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default Component.extend({ | ||
system: service(), | ||
router: service(), | ||
store: service(), | ||
|
||
sortedRegions: computed('system.regions', function() { | ||
return this.get('system.regions') | ||
.toArray() | ||
.sort(); | ||
}), | ||
|
||
gotoRegion(region) { | ||
this.get('router').transitionTo('jobs', { | ||
queryParams: { region }, | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,21 +32,17 @@ export default Controller.extend(Sortable, Searchable, { | |
Filtered jobs are those that match the selected namespace and aren't children | ||
of periodic or parameterized jobs. | ||
*/ | ||
filteredJobs: computed( | ||
'model.[]', | ||
'[email protected]', | ||
'system.activeNamespace', | ||
'system.namespaces.length', | ||
function() { | ||
const hasNamespaces = this.get('system.namespaces.length'); | ||
const activeNamespace = this.get('system.activeNamespace.id') || 'default'; | ||
|
||
return this.get('model') | ||
.compact() | ||
.filter(job => !hasNamespaces || job.get('namespace.id') === activeNamespace) | ||
.filter(job => !job.get('parent.content')); | ||
} | ||
), | ||
filteredJobs: computed('model.[]', '[email protected]', function() { | ||
// Namespace related properties are ommitted from the dependent keys | ||
// due to a prop invalidation bug caused by region switching. | ||
const hasNamespaces = this.get('system.namespaces.length'); | ||
const activeNamespace = this.get('system.activeNamespace.id') || 'default'; | ||
|
||
return this.get('model') | ||
.compact() | ||
.filter(job => !hasNamespaces || job.get('namespace.id') === activeNamespace) | ||
.filter(job => !job.get('parent.content')); | ||
}), | ||
|
||
listToSort: alias('filteredJobs'), | ||
listToSearch: alias('listSorted'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.