From ea298b0b18fca844b845fe32fb7cce518cda33c5 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 16 Aug 2017 19:54:53 -0400 Subject: [PATCH] Change raw tag editor readOnlyTags to accept array of regex --- modules/ui/commit.js | 10 +++++----- modules/ui/raw_tag_editor.js | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/ui/commit.js b/modules/ui/commit.js index 0e5ffc75d..b3681d602 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -12,11 +12,11 @@ import { utilRebind } from '../util'; var changeset; var readOnlyTags = [ - 'changesets_count', - 'created_by', - 'imagery_used', - 'host', - 'locale' + /^changesets_count$/, + /^created_by$/, + /^imagery_used$/, + /^host$/, + /^locale$/ ]; diff --git a/modules/ui/raw_tag_editor.js b/modules/ui/raw_tag_editor.js index c3bbb4f8a..2991895d6 100644 --- a/modules/ui/raw_tag_editor.js +++ b/modules/ui/raw_tag_editor.js @@ -175,7 +175,12 @@ export function uiRawTagEditor(context) { function isReadOnly(d) { - return readOnlyTags.indexOf(d.key) !== -1; + for (var i = 0; i < readOnlyTags.length; i++) { + if (d.key.match(readOnlyTags[i]) !== null) { + return true; + } + } + return false; }