Skip to content

Commit b990a58

Browse files
committed
fix ability to show all editor actions with empty setting
1 parent 21fc843 commit b990a58

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

frontend/nuxt.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ const config: NuxtConfig = {
3737
SOCKET_SECRET: process.env.SOCKET_SECRET,
3838
public: {
3939
TZ: process.env.TZ || 'Europe/Moscow',
40-
SITE_URL: process.env.SITE_URL || '127.0.0.1',
40+
SITE_URL: process.env.SITE_URL || 'http://127.0.0.1:8080/',
4141
API_URL: process.env.API_URL || '/api/',
4242
JWT_EXPIRE: process.env.JWT_EXPIRE || '2592000',
4343
CURRENCY: process.env.CURRENCY || 'RUB',
4444
REGISTER_ENABLED: process.env.REGISTER_ENABLED || '1',
45-
COMMENTS_SHOW_ONLINE: process.env.COMMENTS_SHOW_ONLINE || '3',
45+
COMMENTS_SHOW_ONLINE: process.env.COMMENTS_SHOW_ONLINE || '1',
4646
COMMENTS_MAX_LEVEL: process.env.COMMENTS_MAX_LEVEL || '3',
4747
COMMENTS_EDIT_TIME: process.env.COMMENTS_EDIT_TIME || '600',
4848
EDITOR_TOPIC_BLOCKS: process.env.EDITOR_TOPIC_BLOCKS || '',
49-
EDITOR_COMMENT_BLOCKS: process.env.EDITOR_COMMENT_BLOCKS || '',
49+
EDITOR_COMMENT_BLOCKS: process.env.EDITOR_COMMENT_BLOCKS || 'image,file',
5050
PAYMENT_SERVICES: process.env.PAYMENT_SERVICES || '',
5151
PAYMENT_SUBSCRIPTIONS: process.env.PAYMENT_SUBSCRIPTIONS || '',
5252
ADMIN_SECTIONS: process.env.ADMIN_SECTIONS || '',

frontend/src/components/comments/form.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const record = computed({
6060
})
6161
6262
const uploadUrl = getApiUrl() + 'web/topics/' + props.topic.uuid + '/comments/upload'
63-
const editorBlocks = String(useRuntimeConfig().public.EDITOR_COMMENT_BLOCKS || 'image,file').split(',')
63+
const editorBlocks = String(useRuntimeConfig().public.EDITOR_COMMENT_BLOCKS)
6464
const editor = ref()
6565
const editingTime = computed(() => {
6666
if (!props.timer) {

frontend/src/components/editor/js.client.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ const props = defineProps({
6262
default: 'sm',
6363
},
6464
blocks: {
65-
type: Array as PropType<string[]>,
66-
default() {
67-
return []
68-
},
65+
type: String,
66+
default: '',
6967
},
7068
})
7169
const emit = defineEmits(['update:modelValue'])
@@ -133,7 +131,7 @@ const allBlocks = [
133131
]
134132
const enabledBlocks = computed(() => {
135133
if (props.blocks.length) {
136-
const types = props.blocks.map((i: string) => i.toLowerCase())
134+
const types = props.blocks.split(',').map((i) => i.trim().toLowerCase())
137135
return allBlocks.filter((i) => types.includes(i.type))
138136
}
139137
return allBlocks

frontend/src/components/forms/page.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ const positionOptions = [
5757
{value: 'footer', text: t('models.page.position_footer')},
5858
{value: null, text: t('models.page.position_null')},
5959
]
60-
const editorBlocks = String(useRuntimeConfig().public.EDITOR_TOPIC_BLOCKS).split(',') || []
60+
const editorBlocks = String(useRuntimeConfig().public.EDITOR_TOPIC_BLOCKS)
6161
</script>

frontend/src/components/forms/topic.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const accessOptions = computed(() => {
9999
{value: 'payments', text: t('models.topic.access.payments')},
100100
]
101101
})
102-
const editorBlocks = String(useRuntimeConfig().public.EDITOR_TOPIC_BLOCKS).split(',') || []
102+
const editorBlocks = String(useRuntimeConfig().public.EDITOR_TOPIC_BLOCKS)
103103
104104
const accessLevel = ref('free')
105105
if (record.value.id) {

0 commit comments

Comments
 (0)