Rename constants

This commit is contained in:
Ramon Wenger 2022-06-22 20:34:43 +02:00
parent 0060889a63
commit 813751cf26
4 changed files with 10 additions and 10 deletions

View File

@ -140,7 +140,7 @@
import {CHOOSER, transformInnerContents} from '@/components/content-block-form/helpers.js'; import {CHOOSER, transformInnerContents} from '@/components/content-block-form/helpers.js';
import ContentElementActions from '@/components/content-block-form/ContentElementActions.vue'; import ContentElementActions from '@/components/content-block-form/ContentElementActions.vue';
import {ContentBlock, numberOrUndefined} from "@/@types"; import {ContentBlock, numberOrUndefined} from "@/@types";
import {DEFAULT_FEATURES} from "@/consts/features.consts"; import {DEFAULT_FEATURE_SET} from "@/consts/features.consts";
// TODO: refactor this file, it's huuuuuge! // TODO: refactor this file, it's huuuuuge!
interface ContentBlockFormData { interface ContentBlockFormData {
@ -159,7 +159,7 @@
}, },
features: { features: {
type: String, type: String,
default: DEFAULT_FEATURES default: DEFAULT_FEATURE_SET
} }
}, },
provide(): object { provide(): object {
@ -191,7 +191,7 @@
return this.localContentBlock.title > ''; return this.localContentBlock.title > '';
}, },
hasDefaultFeatures(): boolean { hasDefaultFeatures(): boolean {
return this.features === DEFAULT_FEATURES; return this.features === DEFAULT_FEATURE_SET;
} }
}, },
methods: { methods: {

View File

@ -46,7 +46,7 @@
import formElementIcons from '@/components/ui/form-element-icons'; import formElementIcons from '@/components/ui/form-element-icons';
import CrossIcon from '@/components/icons/CrossIcon'; import CrossIcon from '@/components/icons/CrossIcon';
import ChooserElement from '@/components/content-forms/ChooserElement'; import ChooserElement from '@/components/content-forms/ChooserElement';
import {DEFAULT_FEATURES} from '@/consts/features.consts'; import {DEFAULT_FEATURE_SET} from '@/consts/features.consts';
export default { export default {
@ -73,7 +73,7 @@
}, },
data() { data() {
const hasDefaultFeatures = this.features === DEFAULT_FEATURES; const hasDefaultFeatures = this.features === DEFAULT_FEATURE_SET;
return { return {
convertToList: false, convertToList: false,
chooserTypes: [ chooserTypes: [
@ -127,7 +127,7 @@
return this.chooserTypes.filter(type => !("show" in type) || type.show ); // display element if `show` is not set or if `show` evaluates to true return this.chooserTypes.filter(type => !("show" in type) || type.show ); // display element if `show` is not set or if `show` evaluates to true
}, },
hasDefaultFeatures() { hasDefaultFeatures() {
return this.features === DEFAULT_FEATURES; return this.features === DEFAULT_FEATURE_SET;
} }
}, },

View File

@ -1,2 +1,2 @@
export const DEFAULT_FEATURES = 'default'; export const DEFAULT_FEATURE_SET = 'default';
export const ROOMS_FEATURES = 'rooms'; export const ROOMS_FEATURE_SET = 'rooms';

View File

@ -7,14 +7,14 @@
<script> <script>
import ContentBlockForm from '@/components/content-block-form/ContentBlockForm'; import ContentBlockForm from '@/components/content-block-form/ContentBlockForm';
import {ROOMS_FEATURES} from '@/consts/features.consts'; import {ROOMS_FEATURE_SET} from '@/consts/features.consts';
export default { export default {
components: {ContentBlockForm}, components: {ContentBlockForm},
data() { data() {
return { return {
features: ROOMS_FEATURES, features: ROOMS_FEATURE_SET,
roomEntry: { roomEntry: {
title: '', title: '',
contents: [] contents: []