Skip to content

Commit

Permalink
fix: auth strategy order not saved
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Sep 7, 2020
1 parent 794ecc6 commit dab5dcf
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions client/components/admin/admin-auth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
v-model='activeStrategies'
handle='.is-handle'
direction='vertical'
:store='order'
)
transition-group
v-list-item(
Expand Down Expand Up @@ -248,16 +247,6 @@ export default {
}
}
},
computed: {
order: {
get () {
return this.strategies
},
set (val) {
}
}
},
watch: {
selectedStrategy(newValue, oldValue) {
this.strategy = _.find(this.activeStrategies, ['key', newValue]) || {}
Expand Down Expand Up @@ -321,11 +310,11 @@ export default {
}
`,
variables: {
strategies: this.activeStrategies.map(str => ({
strategies: this.activeStrategies.map((str, idx) => ({
key: str.key,
strategyKey: str.strategy.key,
displayName: str.displayName,
order: str.order,
order: idx,
isEnabled: str.isEnabled,
config: str.config.map(cfg => ({...cfg, value: JSON.stringify({ v: cfg.value.value })})),
selfRegistration: str.selfRegistration,
Expand Down Expand Up @@ -412,13 +401,13 @@ export default {
}
`,
fetchPolicy: 'network-only',
update: (data) => _.get(data, 'authentication.activeStrategies', []).map(str => ({
update: (data) => _.sortBy(_.get(data, 'authentication.activeStrategies', []).map(str => ({
...str,
config: _.sortBy(str.config.map(cfg => ({
...cfg,
value: JSON.parse(cfg.value)
})), [t => t.value.order])
})),
})), ['order']),
watchLoading (isLoading) {
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-activestrategies-refresh')
}
Expand Down

0 comments on commit dab5dcf

Please sign in to comment.