move remaining setting to generalSettings.vue - delete site.vue - start with siteData.vue

This commit is contained in:
negue
2023-02-21 21:11:48 +01:00
parent b09298fb01
commit 3b050861c4
5 changed files with 64 additions and 118 deletions
@@ -1,111 +0,0 @@
<template>
<div class="row standard-page">
<h1 class="col-12">
{{ $t('settings') }} - to be removed once all settings found a new place
</h1>
<div class="col-sm-6">
<div>
<div
v-if="party.memberCount === 1"
class="checkbox"
>
<label>
<input
v-model="user.preferences.displayInviteToPartyWhenPartyIs1"
type="checkbox"
class="mr-2"
@change="set('displayInviteToPartyWhenPartyIs1')"
>
<span
class="hint"
popover-trigger="mouseenter"
popover-placement="right"
:popover="$t('displayInviteToPartyWhenPartyIs1')"
>{{ $t('displayInviteToPartyWhenPartyIs1') }}</span>
</label>
</div>
</div>
</div>
<div class="col-sm-6">
</div>
</div>
</template>
<style lang="scss" scoped>
@import '~@/assets/scss/colors.scss';
input {
color: $gray-50;
}
.usersettings h5 {
margin-top: 1em;
}
.iconalert > div > span {
line-height: 25px;
}
.iconalert > div:after {
clear: both;
content: '';
display: table;
}
.input-error {
width: 100%;
margin-top: 5px;
}
</style>
<script>
import { mapState } from '@/libs/store';
import notificationsMixin from '../../mixins/notifications';
export default {
components: {
},
mixins: [notificationsMixin],
data () {
return {
party: {},
// Made available by the server as a script
localAuth: {
password: '',
confirmPassword: '',
},
};
},
computed: {
...mapState({
user: 'user.data',
content: 'content',
}),
},
mounted () {
// @TODO: We may need to request the party here
this.party = this.$store.state.party;
this.$store.dispatch('common:setTitle', {
section: this.$t('settings'),
});
const focusID = this.$route.query.focus; // ... what is this needed for?
if (focusID !== undefined && focusID !== null) {
this.$nextTick(() => {
const element = document.getElementById(focusID);
if (element !== undefined && element !== null) {
element.focus();
}
});
}
},
methods: {
set (preferenceType, subtype) {
const settings = {};
if (!subtype) {
settings[`preferences.${preferenceType}`] = this.user.preferences[preferenceType];
} else {
settings[`preferences.${preferenceType}.${subtype}`] = this.user.preferences[preferenceType][subtype];
}
return this.$store.dispatch('user:set', settings);
},
},
};
</script>
@@ -181,11 +181,11 @@ export default {
}),
tabs: [
'general',
'site',
'subscription',
'siteData',
'api',
'dataExport',
'promoCode',
'subscription',
'transactions',
'notifications',
],
@@ -77,6 +77,28 @@
</td>
</tr>
</table>
<br>
<br>
<div>
TODO: this was only visible when party.memberCount is 1
<div
class="checkbox"
>
<label>
<input
v-model="user.preferences.displayInviteToPartyWhenPartyIs1"
type="checkbox"
class="mr-2"
@change="setUserPreference('displayInviteToPartyWhenPartyIs1')"
>
<span
v-b-popover.hover.right="$t('displayInviteToPartyWhenPartyIs1')"
class="hint"
>{{ $t('displayInviteToPartyWhenPartyIs1') }}</span>
</label>
</div>
</div>
</div>
</div>
</template>
@@ -111,6 +133,8 @@ import ClassSetting from '@/pages/settings/inlineSettings/classSetting.vue';
import FixValuesSetting from '@/pages/settings/inlineSettings/fixValuesSetting.vue';
import LoginMethods from '@/pages/settings/inlineSettings/loginMethods.vue';
import TaskSettings from '@/pages/settings/inlineSettings/taskSettings.vue';
import { GenericUserPreferencesMixin } from '@/pages/settings/components/genericUserPreferencesMixin';
import { mapState } from '@/libs/store';
export default {
components: {
@@ -129,7 +153,12 @@ export default {
UserEmailSetting,
UserNameSetting,
},
mixins: [notificationsMixin],
mixins: [notificationsMixin, GenericUserPreferencesMixin],
computed: {
...mapState({
user: 'user.data',
}),
},
beforeRouteLeave (_, __, next) {
sharedInlineSettingStore.markAsClosed();
next();
@@ -0,0 +1,27 @@
<template>
<div class="row standard-page">
<div class="col-12">
<h1
v-once
class="page-header"
>
{{ $t('siteData') }}
</h1>
</div>
<div class="col-12">
<h2 v-once>
{{ $t('user') }}
</h2>
</div>
</div>
</template>
<script>
export default {
};
</script>
<style scoped>
</style>
+5 -4
View File
@@ -13,11 +13,12 @@ const GeneralSettings = () => import(/* webpackChunkName: "settings" */'@/pages/
const Notifications = () => import(/* webpackChunkName: "settings" */'@/pages/settings/notificationSettings');
const Transactions = () => import(/* webpackChunkName: "settings" */'@/pages/settings/purchaseHistory.vue');
const SiteData = () => import(/* webpackChunkName: "settings" */'@/pages/settings/siteData.vue');
// not converted yet
const API = () => import(/* webpackChunkName: "settings" */'@/components/settings/api');
const DataExport = () => import(/* webpackChunkName: "settings" */'@/components/settings/dataExport');
const PromoCode = () => import(/* webpackChunkName: "settings" */'@/components/settings/promoCode');
const Site = () => import(/* webpackChunkName: "settings" */'@/components/settings/site');
const Subscription = () => import(/* webpackChunkName: "settings" */'@/components/settings/subscription');
@@ -39,9 +40,9 @@ export const USER_ROUTES = {
component: GeneralSettings,
},
{
name: 'site',
path: 'site',
component: Site,
name: 'siteData',
path: 'siteData',
component: SiteData,
},
{
name: 'api',