From 0a653179a5fbb413b2a9b9be93f3cb7ddfcd3c1d Mon Sep 17 00:00:00 2001 From: Keegan George Date: Mon, 11 Apr 2022 10:24:14 -0700 Subject: [PATCH] FEATURE: Sortable json-editor items (#16403) --- .../discourse/app/components/json-editor.js | 10 +++++++--- app/assets/stylesheets/common/base/modal.scss | 11 +++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/json-editor.js b/app/assets/javascripts/discourse/app/components/json-editor.js index c0f418d8bbc..2ac1dcc7349 100644 --- a/app/assets/javascripts/discourse/app/components/json-editor.js +++ b/app/assets/javascripts/discourse/app/components/json-editor.js @@ -29,8 +29,9 @@ export default Component.extend({ schema: this.model.jsonSchema, disable_array_delete_all_rows: true, disable_array_delete_last_row: true, - disable_array_reorder: true, - disable_array_copy: true, + disable_array_reorder: false, + disable_array_copy: false, + enable_array_copy: true, disable_edit_json: true, disable_properties: true, disable_collapse: true, @@ -70,8 +71,11 @@ export default Component.extend({ class DiscourseJsonSchemaEditorIconlib { constructor() { this.mapping = { - delete: "times", + delete: "trash-alt", add: "plus", + moveup: "arrow-up", + movedown: "arrow-down", + copy: "copy", }; } diff --git a/app/assets/stylesheets/common/base/modal.scss b/app/assets/stylesheets/common/base/modal.scss index 4b09e637830..f19d70c577f 100644 --- a/app/assets/stylesheets/common/base/modal.scss +++ b/app/assets/stylesheets/common/base/modal.scss @@ -747,6 +747,17 @@ .btn-group { margin-top: 0; + display: flex; + align-items: stretch; + gap: 0.5em; + + .btn { + padding-block: 0.65em; + + .d-icon { + margin-right: 0; + } + } } .json-editor-btn-delete {