|
1 | 1 | <template> |
2 | 2 | <h1 class="mb-3">Modelling of Business Processes</h1> |
3 | 3 |
|
4 | | - <div class="d-flex flex-row flex-fill" style="height: 90%;"> |
| 4 | + <div class="d-flex flex-row flex-fill"> |
5 | 5 | <v-tabs v-model="tab" class="mr-3" direction="vertical" bg-color="surface-light"> |
6 | 6 | <v-tab :value="'nl'"> |
7 | 7 | <v-icon class="mr-1" icon="mdi-chat-outline" /> |
|
17 | 17 | </v-tab> |
18 | 18 | </v-tabs> |
19 | 19 |
|
20 | | - <v-tabs-window v-model="tab" class="flex-fill" style="height: 100%;"> |
21 | | - <v-tabs-window-item value="nl" class="flex-fill"> |
| 20 | + <v-tabs-window v-model="tab" class="w-100"> |
| 21 | + <v-tabs-window-item value="nl" class=""> |
22 | 22 | <v-alert v-if="!isTokenConfigured" closable |
23 | 23 | text="Configure the ChatGPT API Token and reload the page in order to use the system." type="error" |
24 | 24 | variant="tonal" class="mb-3"></v-alert> |
25 | | - <v-container class="d-flex flex-column" style="height: 100%;"> |
| 25 | + <v-container> |
26 | 26 | <v-select |
27 | 27 | label="Select an example description" |
28 | 28 | :items="examples" |
29 | 29 | item-title="name" |
30 | 30 | item-value="description" |
31 | 31 | v-model="textualDescription" |
32 | | - class="mb-2 flex-grow-0" |
| 32 | + class="mb-2" |
33 | 33 | clearable |
34 | 34 | ></v-select> |
35 | 35 | <p class="mb-2">Natural language description of the process:</p> |
36 | | - <v-textarea v-model="textualDescription" auto-grow></v-textarea> |
37 | | - <v-btn class="align-self-end" color="primary" @click="processNaturalLanguage"> |
| 36 | + <v-textarea v-model="textualDescription" auto-grow rows="10"></v-textarea> |
| 37 | + <v-btn class="float-right" color="primary" @click="processNaturalLanguage"> |
38 | 38 | Convert to Restricted language |
39 | 39 | <v-icon class="ml-1" icon="mdi-arrow-right" /> |
40 | 40 | </v-btn> |
41 | 41 | </v-container> |
42 | 42 | </v-tabs-window-item> |
43 | 43 |
|
44 | 44 | <v-tabs-window-item value="restricted" class="flex-fill"> |
45 | | - <v-container class="d-flex flex-column" style="height: 100%;"> |
| 45 | + <v-container> |
46 | 46 | <p class="mb-2">Restricted natural language:</p> |
47 | | - <prism-editor class="editor flex-grow-1 line-numbers" v-model="restrictedLanguage" |
48 | | - :highlight="highlighter" :line-numbers="false"></prism-editor> |
49 | | - <div v-if="syntaxErrors.length > 0"> |
50 | | - <p class="text-h6">Syntax Error</p> |
| 47 | + <RestrictedLanguageVisualizer |
| 48 | + v-model="restrictedLanguage" |
| 49 | + ></RestrictedLanguageVisualizer> |
| 50 | + <v-alert v-if="syntaxErrors.length > 0" |
| 51 | + border="top" |
| 52 | + type="error" |
| 53 | + variant="outlined" |
| 54 | + class="mb-3" |
| 55 | + title="Syntax Error" |
| 56 | + > |
51 | 57 | <pre v-html="syntaxErrors.join('\n')"></pre> |
52 | | - </div> |
53 | | - <v-btn class="align-self-end" color="primary" @click="processRestrictedNaturalLanguage"> |
| 58 | + </v-alert> |
| 59 | + <v-btn class="float-right" color="primary" @click="processRestrictedNaturalLanguage"> |
54 | 60 | Convert to model |
55 | 61 | <v-icon class="ml-1" icon="mdi-arrow-right" /> |
56 | 62 | </v-btn> |
|
76 | 82 |
|
77 | 83 | <script> |
78 | 84 | import ProcessVisualizer from '../components/ProcessVisualizer.vue' |
79 | | -
|
80 | | -import { PrismEditor } from "vue-prism-editor"; |
81 | | -import { highlight, languages } from "prismjs/components/prism-core"; |
82 | | -import 'prismjs/plugins/line-numbers/prism-line-numbers.js' |
83 | | -import 'prismjs/plugins/line-numbers/prism-line-numbers.css' |
84 | | -import "vue-prism-editor/dist/prismeditor.min.css"; |
85 | | -import "../highlights/prism-vs.css"; |
86 | | -import "../highlights/businessprocess.js"; |
| 85 | +import RestrictedLanguageVisualizer from '../components/RestrictedLanguageVisualizer.vue'; |
87 | 86 |
|
88 | 87 | import { getNlTextConvertedToDialect, getConvertedText, checkSyntax } from '../converters/businessprocesses'; |
89 | 88 |
|
90 | 89 | export default { |
91 | 90 | name: 'BusinessProcess', |
92 | 91 | components: { |
93 | | - ProcessVisualizer, PrismEditor |
| 92 | + ProcessVisualizer, RestrictedLanguageVisualizer |
94 | 93 | }, |
95 | 94 | data: () => ({ |
96 | 95 | tab: null, |
@@ -157,24 +156,4 @@ export default { |
157 | 156 | } |
158 | 157 | } |
159 | 158 | </script> |
160 | | - |
161 | | -<style> |
162 | | -.editor { |
163 | | - background: #f6f6f6; |
164 | | - font-family: Roboto, sans-serif; |
165 | | - font-size: 16px; |
166 | | - line-height: 1.5; |
167 | | - padding: 16px; |
168 | | - margin-bottom: 20px; |
169 | | - border-bottom: 1px solid #A5A5A5; |
170 | | -} |
171 | | -
|
172 | | -.prism-editor__textarea:focus { |
173 | | - outline: none; |
174 | | -} |
175 | | -
|
176 | | -.prism-editor__line-number { |
177 | | - font-style: normal !important; |
178 | | - color: #23799373 !important; |
179 | | -} |
180 | | -</style> |
| 159 | +< |
0 commit comments