From 73e8c7a278603fc7f58510d0f09eeed7192eb6f1 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 31 Oct 2020 21:18:04 +0100 Subject: [PATCH 1/2] docker-compose: explicitly pin postgres container to v12 --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index a689d767..323a43b1 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,7 +14,7 @@ version: "3" services: db: - image: postgres:latest + image: postgres:12 restart: always ports: - 5432:5432 From 9ed8f7931567ce3e12b2c50cea180c2a564e54ad Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sat, 31 Oct 2020 21:18:20 +0100 Subject: [PATCH 2/2] gui/editors: toggle Preview/Edit button When hitting "Preview" on a previewable section (e.g. one with markdown), the tooltip and icon of the preview-button still show "Preview". With this change, both the text and the button will be switched accordingly. --- gui/app/components/section/base-editor-inline.js | 6 ++++++ gui/app/components/ui/ui-toolbar-icon.js | 1 + gui/app/templates/components/section/base-editor-inline.hbs | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gui/app/components/section/base-editor-inline.js b/gui/app/components/section/base-editor-inline.js index 31bde62f..218e2322 100644 --- a/gui/app/components/section/base-editor-inline.js +++ b/gui/app/components/section/base-editor-inline.js @@ -27,6 +27,10 @@ export default Component.extend(Modals, Notifier, { return `page-editor-${page.id}`; }), previewText: 'Preview', + previewIcon: computed('previewIcon', function () { + let constants = this.get('constants'); + return constants.Icon.Preview; + }), pageTitle: '', didReceiveAttrs() { @@ -102,8 +106,10 @@ export default Component.extend(Modals, Notifier, { }, onPreview() { + let constants = this.get('constants'); let pt = this.get('previewText'); this.set('previewText', pt === 'Preview' ? 'Edit Mode' : 'Preview'); + this.set('previewIcon', pt === 'Preview' ? constants.Icon.Edit : constants.Icon.Preview); return this.get('onPreview')(); }, diff --git a/gui/app/components/ui/ui-toolbar-icon.js b/gui/app/components/ui/ui-toolbar-icon.js index bd5bae28..ed23e00d 100644 --- a/gui/app/components/ui/ui-toolbar-icon.js +++ b/gui/app/components/ui/ui-toolbar-icon.js @@ -39,6 +39,7 @@ export default Component.extend({ click(e) { if (!_.isUndefined(this.onClick)) { this.onClick(e); + this.notifyPropertyChange('calcClass'); return; } diff --git a/gui/app/templates/components/section/base-editor-inline.hbs b/gui/app/templates/components/section/base-editor-inline.hbs index 1a12de52..3da46c01 100644 --- a/gui/app/templates/components/section/base-editor-inline.hbs +++ b/gui/app/templates/components/section/base-editor-inline.hbs @@ -29,8 +29,8 @@ tooltip="Insert Link" onClick=(action "onShowLinkModal")}} {{/if}} {{#if previewButton}} - {{ui/ui-toolbar-icon icon=constants.Icon.Preview color=constants.Color.Gray - tooltip="Preview changes" onClick=(action "onPreview")}} + {{ui/ui-toolbar-icon icon=previewIcon color=constants.Color.Gray + tooltip=previewText onClick=(action "onPreview")}} {{/if}} {{ui/ui-toolbar-icon icon=constants.Icon.Tick color=constants.Color.Green tooltip="Save changes" onClick=(action "onAction")}} {{ui/ui-toolbar-icon icon=constants.Icon.Cross color=constants.Color.Red tooltip="Cancel editing" onClick=(action "onCancel")}}