-
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 #5318 from hashicorp/f-ui-clients-filtering
UI: Clients filtering
- Loading branch information
Showing
8 changed files
with
383 additions
and
32 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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { computed } from '@ember/object'; | ||
|
||
// An unattractive but robust way to encode query params | ||
export const serialize = arr => (arr.length ? JSON.stringify(arr) : ''); | ||
|
||
export const deserialize = str => { | ||
try { | ||
return JSON.parse(str) | ||
.compact() | ||
.without(''); | ||
} catch (e) { | ||
return []; | ||
} | ||
}; | ||
|
||
// A computed property macro for deserializing a query param | ||
export const deserializedQueryParam = qpKey => | ||
computed(qpKey, function() { | ||
return deserialize(this.get(qpKey)); | ||
}); |
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.