From fdfac8c720a04600988c2c24d4dd5e37662eeced Mon Sep 17 00:00:00 2001 From: Andrei Prigorshnev Date: Sun, 14 Aug 2022 18:55:54 +0400 Subject: [PATCH 1/4] UX: improve styles of the user status message component (#17904) --- .../stylesheets/common/components/user-status-message.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/common/components/user-status-message.scss b/app/assets/stylesheets/common/components/user-status-message.scss index 8e45d8e6d2..b8f1aae0c4 100644 --- a/app/assets/stylesheets/common/components/user-status-message.scss +++ b/app/assets/stylesheets/common/components/user-status-message.scss @@ -1,3 +1,8 @@ +.user-status-message-description { + margin-left: 0.1em; + color: var(--primary-800); +} + .user-status-message-tooltip { .emoji { width: 1em; From 5d1cf006ab50a6db008ecb6f1163bddd9e5de121 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Sun, 14 Aug 2022 17:30:15 +0200 Subject: [PATCH 2/4] DEV: Tweak core_frontend_tests timeouts (#17902) Each test chunk takes about 10 minutes, so those timeouts can be decreased from 20 to 15. And there are three of those chunks so total can be a bit over 30 minutes, hence the bump to 35. --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a2c9f200b8..38e1e947c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -179,7 +179,7 @@ jobs: name: core frontend (${{ matrix.browser }}) runs-on: ubuntu-latest container: discourse/discourse_test:slim-browsers - timeout-minutes: 30 + timeout-minutes: 35 strategy: fail-fast: false @@ -223,16 +223,16 @@ jobs: if: ${{ always() }} working-directory: ./app/assets/javascripts/discourse run: sudo -E -u discourse -H yarn ember exam --path /tmp/emberbuild --split=3 --partition=1 --launch "${{ matrix.browser }}" --random - timeout-minutes: 20 + timeout-minutes: 15 - name: Core QUnit 2 if: ${{ always() }} working-directory: ./app/assets/javascripts/discourse run: sudo -E -u discourse -H yarn ember exam --path /tmp/emberbuild --split=3 --partition=2 --launch "${{ matrix.browser }}" --random - timeout-minutes: 20 + timeout-minutes: 15 - name: Core QUnit 3 if: ${{ always() }} working-directory: ./app/assets/javascripts/discourse run: sudo -E -u discourse -H yarn ember exam --path /tmp/emberbuild --split=3 --partition=3 --launch "${{ matrix.browser }}" --random - timeout-minutes: 20 + timeout-minutes: 15 From 92035cdc6284b596fd977b6394bc8b7168a7cd41 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Sun, 14 Aug 2022 17:31:37 +0200 Subject: [PATCH 3/4] DEV: Change test localStorage prefix (#17906) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …to something more easily recognizable and less collision-prone --- app/assets/javascripts/discourse/app/lib/key-value-store.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/lib/key-value-store.js b/app/assets/javascripts/discourse/app/lib/key-value-store.js index b5436cf853..55a843ebfc 100644 --- a/app/assets/javascripts/discourse/app/lib/key-value-store.js +++ b/app/assets/javascripts/discourse/app/lib/key-value-store.js @@ -1,5 +1,7 @@ import { isTesting } from "discourse-common/config/environment"; +const TEST_KEY_PREFIX = "__test_"; + // A simple key value store that uses LocalStorage let safeLocalStorage; @@ -20,7 +22,7 @@ export default class KeyValueStore { context = null; constructor(ctx) { - this.context = isTesting() ? `test_${ctx}` : ctx; + this.context = isTesting() ? `${TEST_KEY_PREFIX}${ctx}` : ctx; } abandonLocal() { From f25e77922684fc780d7b050ffb808b3374206dc3 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Sun, 14 Aug 2022 17:31:49 +0200 Subject: [PATCH 4/4] DEV: Prefer kvs over raw localStorage (#17907) --- .../discourse/app/components/time-shortcut-picker.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js index ad8da0313f..a7597ec88d 100644 --- a/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js +++ b/app/assets/javascripts/discourse/app/components/time-shortcut-picker.js @@ -127,8 +127,8 @@ export default Component.extend({ }, _loadLastUsedCustomDatetime() { - let lastTime = localStorage.lastCustomTime; - let lastDate = localStorage.lastCustomDate; + const lastTime = this.keyValueStore.lastCustomTime; + const lastDate = this.keyValueStore.lastCustomDate; if (lastTime && lastDate) { let parsed = parseCustomDatetime(lastDate, lastTime, this.userTimezone); @@ -242,8 +242,8 @@ export default Component.extend({ if (customDatetime.isValid() && this.customDate) { dateTime = customDatetime; - localStorage.lastCustomTime = this.customTime; - localStorage.lastCustomDate = this.customDate; + this.keyValueStore.lastCustomTime = this.customTime; + this.keyValueStore.lastCustomDate = this.customDate; } } else { dateTime = this.options.findBy("id", type).time;