From 8a7b2a3a68d4ea361c2d3785923051de37c7e87e Mon Sep 17 00:00:00 2001 From: John Cowen Date: Fri, 10 Dec 2021 16:19:11 +0000 Subject: [PATCH 1/2] ui: Change the URL prefix of partitions from `-` to `_` --- ui/packages/consul-ui/app/locations/fsm-with-optional.js | 4 ++-- ui/packages/consul-ui/app/services/ui-config.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/packages/consul-ui/app/locations/fsm-with-optional.js b/ui/packages/consul-ui/app/locations/fsm-with-optional.js index 0d69d8bcf172..19ed18da3c8b 100644 --- a/ui/packages/consul-ui/app/locations/fsm-with-optional.js +++ b/ui/packages/consul-ui/app/locations/fsm-with-optional.js @@ -1,7 +1,7 @@ import { env } from 'consul-ui/env'; const OPTIONAL = {}; if (env('CONSUL_PARTITIONS_ENABLED')) { - OPTIONAL.partition = /^-([a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?)$/; + OPTIONAL.partition = /^_([a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?)$/; } if (env('CONSUL_NSPACES_ENABLED')) { @@ -194,7 +194,7 @@ export default class FSMWithOptionalLocation { hash.nspace = `~${hash.nspace}`; } if (typeof hash.partition !== 'undefined') { - hash.partition = `-${hash.partition}`; + hash.partition = `_${hash.partition}`; } if (typeof this.router === 'undefined') { this.router = this.container.lookup('router:main'); diff --git a/ui/packages/consul-ui/app/services/ui-config.js b/ui/packages/consul-ui/app/services/ui-config.js index 6cf971f36abd..cb039bc589e9 100644 --- a/ui/packages/consul-ui/app/services/ui-config.js +++ b/ui/packages/consul-ui/app/services/ui-config.js @@ -18,7 +18,7 @@ export default class UiConfigService extends Service { case item.startsWith('~'): prev.nspace = item.substr(1); break; - case item.startsWith('-'): + case item.startsWith('_'): prev.partition = item.substr(1); break; case typeof prev.dc === 'undefined': From 9a7b0410b9002d84cb4d55ab2401b731a68cb10d Mon Sep 17 00:00:00 2001 From: John Cowen Date: Mon, 13 Dec 2021 10:47:10 +0000 Subject: [PATCH 2/2] Changelog --- .changelog/11801.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/11801.txt diff --git a/.changelog/11801.txt b/.changelog/11801.txt new file mode 100644 index 000000000000..68df58f26e84 --- /dev/null +++ b/.changelog/11801.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +ui: Change partition URL segment prefix from `-` to `_` +```