Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] Use the Ace Editor for Writing Snapshot Descriptions #6487

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@docker/extension-api-client-types": "0.3.4",
"@kubernetes/client-node": "0.18.1",
"@rancher/components": "0.1.4",
"ace-builds": "^1.32.6",
"agent-base": "6.0.2",
"async-mutex": "^0.4.1",
"console": "0.7.2",
Expand Down Expand Up @@ -97,6 +98,7 @@
"vue-select": "3.20.2",
"vue-shortkey": "3.1.7",
"vue-slider-component": "3.2.24",
"vue2.7-ace-editor": "^2.2.6",
"vuex": "3.6.2",
"which": "4.0.0",
"xdg-app-paths": "5.5.1",
Expand Down
19 changes: 11 additions & 8 deletions pkg/rancher-desktop/pages/snapshots/create.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<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 { VAceEditor } from 'vue2.7-ace-editor';

Check failure on line 6 in pkg/rancher-desktop/pages/snapshots/create.vue

View workflow job for this annotation

GitHub Actions / Check Spelling

`VAce` is not a recognized word. (unrecognized-spelling)
import 'ace-builds/src-noconflict/mode-markdown';

Check failure on line 7 in pkg/rancher-desktop/pages/snapshots/create.vue

View workflow job for this annotation

GitHub Actions / Check Spelling

`noconflict` is not a recognized word. (unrecognized-spelling)
import 'ace-builds/src-noconflict/theme-solarized_dark';

Check failure on line 8 in pkg/rancher-desktop/pages/snapshots/create.vue

View workflow job for this annotation

GitHub Actions / Check Spelling

`noconflict` is not a recognized word. (unrecognized-spelling)
import 'ace-builds/src-noconflict/theme-chrome';

Check failure on line 9 in pkg/rancher-desktop/pages/snapshots/create.vue

View workflow job for this annotation

GitHub Actions / Check Spelling

`noconflict` is not a recognized word. (unrecognized-spelling)
import { mapGetters } from 'vuex';

import { Snapshot, SnapshotEvent } from '@pkg/main/snapshots/types';
Expand All @@ -18,7 +22,7 @@
components: {
Banner,
LabeledInput,
TextAreaAutoGrow,
editor: VAceEditor,

Check failure on line 25 in pkg/rancher-desktop/pages/snapshots/create.vue

View workflow job for this annotation

GitHub Actions / Check Spelling

`VAce` is not a recognized word. (unrecognized-spelling)
},

data() {
Expand Down Expand Up @@ -142,12 +146,11 @@
</div>
<div class="field description-field">
<label>{{ t('snapshots.create.description.label') }}</label>
<TextAreaAutoGrow
ref="descriptionInput"
v-model="description"
data-test="createSnapshotDescInput"
class="input"
:disabled="creating"
<editor
:value="description"
lang="markdown"
theme="solarized_dark"
style="height: 300px"
/>
</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';
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3826,6 +3826,11 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.8:
mime-types "~2.1.34"
negotiator "0.6.3"

ace-builds@^1.32.6:
version "1.32.6"
resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.32.6.tgz#454ec8bc9235fbb960b8d8b86e698f941c104de2"
integrity sha512-dO5BnyDOhCnznhOpILzXq4jqkbhRXxNkf3BuVTmyxGyRLrhddfdyk6xXgy+7A8LENrcYoFi/sIxMuH3qjNUN4w==

acorn-globals@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45"
Expand Down Expand Up @@ -13268,6 +13273,13 @@ vue-template-es2015-compiler@^1.6.0, vue-template-es2015-compiler@^1.9.0:
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825"
integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==

vue2.7-ace-editor@^2.2.6:
version "2.2.6"
resolved "https://registry.yarnpkg.com/vue2.7-ace-editor/-/vue2.7-ace-editor-2.2.6.tgz#ae379fbb67c3722c7004e034a369e763e30286cc"
integrity sha512-VqcabvEJrpRSBeCHdjIzkIPNr4TaoLvMSNJdVK34xUg8ncF8c6saJmfzoJ8C/6kn3Gtg2N06OBM0GPGJJ42T5w==
dependencies:
resize-observer-polyfill "^1.5.1"

[email protected]:
version "2.7.16"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.7.16.tgz#98c60de9def99c0e3da8dae59b304ead43b967c9"
Expand Down
Loading