fix: auth strategy order not saved

pull/2390/head 2.5.121
NGPixel 4 years ago
parent 794ecc6ef6
commit dab5dcfbc1

@ -25,7 +25,6 @@
v-model='activeStrategies' v-model='activeStrategies'
handle='.is-handle' handle='.is-handle'
direction='vertical' direction='vertical'
:store='order'
) )
transition-group transition-group
v-list-item( v-list-item(
@ -248,16 +247,6 @@ export default {
} }
} }
}, },
computed: {
order: {
get () {
return this.strategies
},
set (val) {
}
}
},
watch: { watch: {
selectedStrategy(newValue, oldValue) { selectedStrategy(newValue, oldValue) {
this.strategy = _.find(this.activeStrategies, ['key', newValue]) || {} this.strategy = _.find(this.activeStrategies, ['key', newValue]) || {}
@ -321,11 +310,11 @@ export default {
} }
`, `,
variables: { variables: {
strategies: this.activeStrategies.map(str => ({ strategies: this.activeStrategies.map((str, idx) => ({
key: str.key, key: str.key,
strategyKey: str.strategy.key, strategyKey: str.strategy.key,
displayName: str.displayName, displayName: str.displayName,
order: str.order, order: idx,
isEnabled: str.isEnabled, isEnabled: str.isEnabled,
config: str.config.map(cfg => ({...cfg, value: JSON.stringify({ v: cfg.value.value })})), config: str.config.map(cfg => ({...cfg, value: JSON.stringify({ v: cfg.value.value })})),
selfRegistration: str.selfRegistration, selfRegistration: str.selfRegistration,
@ -412,13 +401,13 @@ export default {
} }
`, `,
fetchPolicy: 'network-only', fetchPolicy: 'network-only',
update: (data) => _.get(data, 'authentication.activeStrategies', []).map(str => ({ update: (data) => _.sortBy(_.get(data, 'authentication.activeStrategies', []).map(str => ({
...str, ...str,
config: _.sortBy(str.config.map(cfg => ({ config: _.sortBy(str.config.map(cfg => ({
...cfg, ...cfg,
value: JSON.parse(cfg.value) value: JSON.parse(cfg.value)
})), [t => t.value.order]) })), [t => t.value.order])
})), })), ['order']),
watchLoading (isLoading) { watchLoading (isLoading) {
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-activestrategies-refresh') this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-auth-activestrategies-refresh')
} }

Loading…
Cancel
Save