Update category name inside module for different flavors
Resolves MS-503
This commit is contained in:
parent
ea9c90189a
commit
6019adf09a
|
|
@ -87,6 +87,7 @@
|
||||||
import PopoverLink from '@/components/ui/PopoverLink';
|
import PopoverLink from '@/components/ui/PopoverLink';
|
||||||
import { removeAtIndex } from '@/graphql/immutable-operations';
|
import { removeAtIndex } from '@/graphql/immutable-operations';
|
||||||
import { EDIT_CONTENT_BLOCK_PAGE } from '@/router/module.names';
|
import { EDIT_CONTENT_BLOCK_PAGE } from '@/router/module.names';
|
||||||
|
import {instrumentCategory} from '@/helpers/instrumentType';
|
||||||
|
|
||||||
const ContentComponent = () => import(/* webpackChunkName: "content-components" */'@/components/content-blocks/ContentComponent');
|
const ContentComponent = () => import(/* webpackChunkName: "content-components" */'@/components/content-blocks/ContentComponent');
|
||||||
|
|
||||||
|
|
@ -137,8 +138,7 @@
|
||||||
if (!(contentType in instruments)) {
|
if (!(contentType in instruments)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
return instrumentCategory();
|
||||||
return `${this.$flavor.textInstrument} - ${instruments[contentType]}`;
|
|
||||||
},
|
},
|
||||||
canEditContentBlock() {
|
canEditContentBlock() {
|
||||||
return this.contentBlock.mine && !this.contentBlock.indent;
|
return this.contentBlock.mine && !this.contentBlock.indent;
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { INTERDISCIPLINARY, LANGUAGE_COMMUNICATION, SOCIETY } from '@/consts/instrument.consts';
|
import {INTERDISCIPLINARY, LANGUAGE_COMMUNICATION, SOCIETY} from '@/consts/instrument.consts';
|
||||||
import instrumentType from '@/helpers/instrumentType';
|
import instrumentType, {instrumentCategory} from '@/helpers/instrumentType';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -33,13 +33,7 @@
|
||||||
'instrument-entry__interdisciplinary': this.instrument.type.category === INTERDISCIPLINARY,
|
'instrument-entry__interdisciplinary': this.instrument.type.category === INTERDISCIPLINARY,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
categoryName() {
|
categoryName: instrumentCategory,
|
||||||
if (this.$flavor.appFlavor === 'my-kv') {
|
|
||||||
return this.$flavor.textInstruments;
|
|
||||||
} else {
|
|
||||||
return instrumentType(this.instrument);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { LANGUAGE_COMMUNICATION, SOCIETY } from '@/consts/instrument.consts';
|
import {LANGUAGE_COMMUNICATION, SOCIETY} from '@/consts/instrument.consts';
|
||||||
|
import flavor from '@/helpers/app-flavor';
|
||||||
|
|
||||||
const instrumentType = ({type: {category}}) => {
|
const instrumentType = ({type: {category}}) => {
|
||||||
if (category === LANGUAGE_COMMUNICATION) {
|
if (category === LANGUAGE_COMMUNICATION) {
|
||||||
|
|
@ -10,4 +11,15 @@ const instrumentType = ({type: {category}}) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const instrumentCategory = () => {
|
||||||
|
if (flavor.appFlavor === 'my-kv') {
|
||||||
|
return flavor.textInstruments;
|
||||||
|
} else {
|
||||||
|
return instrumentType(this.instrument);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
export default instrumentType;
|
export default instrumentType;
|
||||||
|
|
||||||
|
export {instrumentCategory, instrumentType};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue