mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-02-04 15:37:17 +00:00
Refactor CommentEditor and PickWorkflow components: update template structure, enhance default values, and improve type definitions.
This commit is contained in:
@@ -1,3 +1,26 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="'rich' === kind">
|
||||
<Ckeditor
|
||||
:editor="ClassicEditor"
|
||||
:config="classicEditorConfig"
|
||||
v-model="value"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<textarea v-model="value" class="form-control simple-editor"></textarea>
|
||||
</div>
|
||||
|
||||
<button :class="toggleButtonClass" type="button" @click="toggleEditor">
|
||||
{{
|
||||
isSimple
|
||||
? trans(EDITOR_SWITCH_TO_COMPLEX)
|
||||
: trans(EDITOR_SWITCH_TO_SIMPLE)
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, ref } from "vue";
|
||||
import { Ckeditor } from "@ckeditor/ckeditor5-vue";
|
||||
@@ -11,7 +34,7 @@ import {
|
||||
|
||||
const EDITOR_MODE_KEY = "editorMode";
|
||||
const kind = ref<"simple" | "rich">("simple");
|
||||
const value = defineModel({ required: true });
|
||||
const value = defineModel<string>({ required: true });
|
||||
|
||||
const isSimple = computed(() => kind.value === "simple");
|
||||
|
||||
@@ -63,29 +86,6 @@ onUnmounted(function () {
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="'rich' === kind">
|
||||
<Ckeditor
|
||||
:editor="ClassicEditor"
|
||||
:config="classicEditorConfig"
|
||||
v-model="value"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<textarea v-model="value" class="form-control simple-editor"></textarea>
|
||||
</div>
|
||||
|
||||
<button :class="toggleButtonClass" type="button" @click="toggleEditor">
|
||||
{{
|
||||
isSimple
|
||||
? trans(EDITOR_SWITCH_TO_COMPLEX)
|
||||
: trans(EDITOR_SWITCH_TO_SIMPLE)
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "ChillMainAssets/module/bootstrap/bootstrap";
|
||||
|
||||
|
||||
@@ -104,19 +104,19 @@ interface PickWorkflowConfig {
|
||||
|
||||
const props = withDefaults(defineProps<PickWorkflowConfig>(), {
|
||||
preventDefaultMoveToGenerate: false,
|
||||
goToGenerateWorkflowPayload: {},
|
||||
goToGenerateWorkflowPayload: () => ({}),
|
||||
allowCreateWorkflow: false,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(
|
||||
e: "goToGenerateWorkflow",
|
||||
{
|
||||
event: MouseEvent,
|
||||
workflowName: string,
|
||||
isLinkValid: boolean,
|
||||
link: string,
|
||||
payload: object,
|
||||
payload: {
|
||||
event: MouseEvent;
|
||||
workflowName: string;
|
||||
isLinkValid: boolean;
|
||||
link: string;
|
||||
payload: object;
|
||||
},
|
||||
): void;
|
||||
(e: "clickOpenList"): void;
|
||||
@@ -159,11 +159,6 @@ const goToGenerateWorkflow = (
|
||||
payload: props.goToGenerateWorkflowPayload,
|
||||
});
|
||||
};
|
||||
|
||||
const goToDuplicateRelatedEntity = (
|
||||
event: MouseEvent,
|
||||
workflowName: string,
|
||||
): void => {};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user