added mass-draft-push and mass-draft-reset, small stylistic fixes
This commit is contained in:
parent
9153417202
commit
ece69f01b7
4 changed files with 88 additions and 4 deletions
|
|
@ -5,7 +5,7 @@ import getResettableAsyncComponent from 'src/services/resettable_async_component
|
|||
import Popover from '../popover/popover.vue'
|
||||
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { cloneDeep, isEqual } from 'lodash'
|
||||
import {
|
||||
newImporter,
|
||||
newExporter
|
||||
|
|
@ -155,6 +155,12 @@ const SettingsModal = {
|
|||
PLEROMAFE_SETTINGS_MINOR_VERSION
|
||||
]
|
||||
return clone
|
||||
},
|
||||
resetAdminDraft () {
|
||||
this.$store.commit('resetAdminDraft')
|
||||
},
|
||||
pushAdminDraft () {
|
||||
this.$store.dispatch('pushAdminDraft')
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -183,6 +189,12 @@ const SettingsModal = {
|
|||
set (value) {
|
||||
this.$store.dispatch('setOption', { name: 'expertLevel', value: value ? 1 : 0 })
|
||||
}
|
||||
},
|
||||
adminDraftAny () {
|
||||
return !isEqual(
|
||||
this.$store.state.adminSettings.config,
|
||||
this.$store.state.adminSettings.draft
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@
|
|||
|
||||
.settings-footer {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
line-height: 2;
|
||||
|
||||
>* {
|
||||
margin-right: 0.5em;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
<SettingsModalUserContent v-if="modalMode === 'user' && modalOpenedOnceUser" />
|
||||
<SettingsModalAdminContent v-if="modalMode === 'admin' && modalOpenedOnceAdmin" />
|
||||
</div>
|
||||
<div class="panel-footer settings-footer">
|
||||
<div class="panel-footer settings-footer -flexible-height">
|
||||
<Popover
|
||||
v-if="modalMode === 'user'"
|
||||
class="export"
|
||||
|
|
@ -125,6 +125,23 @@
|
|||
id="unscrolled-content"
|
||||
class="extra-content"
|
||||
/>
|
||||
<span class="admin-buttons" v-if="modalMode === 'admin'">
|
||||
<button
|
||||
class="button-default btn"
|
||||
@click="resetAdminDraft"
|
||||
:disabled="!adminDraftAny"
|
||||
>
|
||||
{{ $t("admin_dash.reset_all") }}
|
||||
</button>
|
||||
{{ ' ' }}
|
||||
<button
|
||||
class="button-default btn"
|
||||
@click="pushAdminDraft"
|
||||
:disabled="!adminDraftAny"
|
||||
>
|
||||
{{ $t("admin_dash.commit_all") }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue