Skip to content

Commit

Permalink
Replace TextAreaAutoGrow with Ace editor
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Rak <[email protected]>
  • Loading branch information
rak-phillip committed Feb 15, 2024
1 parent 1630e29 commit 4852b7e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
19 changes: 13 additions & 6 deletions pkg/rancher-desktop/pages/snapshots/create.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script lang="ts">
import { Banner, LabeledInput, TextAreaAutoGrow } from '@rancher/components';
import { Banner, LabeledInput } from '@rancher/components';
import dayjs from 'dayjs';
import Vue from 'vue';
import editor from 'vue2-ace-editor';
import { mapGetters } from 'vuex';
import { Snapshot, SnapshotEvent } from '@pkg/main/snapshots/types';
Expand All @@ -18,7 +19,7 @@ export default Vue.extend({
components: {
Banner,
LabeledInput,
TextAreaAutoGrow,
editor,
},
data() {
Expand All @@ -45,6 +46,12 @@ export default Vue.extend({
},
methods: {
editorInit() {
require('brace/ext/language_tools');
require('brace/mode/markdown');
require('brace/theme/solarized_dark');
},
goBack(event: SnapshotEvent | null) {
this.$router.push({
name: 'Snapshots',
Expand Down Expand Up @@ -142,12 +149,12 @@ export default Vue.extend({
</div>
<div class="field description-field">
<label>{{ t('snapshots.create.description.label') }}</label>
<TextAreaAutoGrow
ref="descriptionInput"
<editor
v-model="description"
data-test="createSnapshotDescInput"
lang="markdown"
theme="solarized_dark"
class="input"
:disabled="creating"
@init="editorInit"
/>
</div>
<div class="actions">
Expand Down
1 change: 1 addition & 0 deletions pkg/rancher-desktop/typings/vue2-ace-editor.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'vue2-ace-editor';

0 comments on commit 4852b7e

Please sign in to comment.