diff --git a/conf/evolutions/reversions/125-allow-dollar-in-layer-names.sql b/conf/evolutions/reversions/125-allow-dollar-in-layer-names.sql index f357f3cc6d..cff9aa20a7 100644 --- a/conf/evolutions/reversions/125-allow-dollar-in-layer-names.sql +++ b/conf/evolutions/reversions/125-allow-dollar-in-layer-names.sql @@ -8,4 +8,6 @@ UPDATE webknossos.annotation_layers SET name = regexp_replace(name, '\$', '', 'g ALTER TABLE webknossos.annotation_layers DROP CONSTRAINT IF EXISTS annotation_layers_name_check; ALTER TABLE webknossos.annotation_layers ADD CONSTRAINT annotation_layers_name_check CHECK (name ~* '^[A-Za-z0-9\-_\.]+$'); +UPDATE webknossos.releaseInformation SET schemaVersion = 124; + COMMIT TRANSACTION; diff --git a/frontend/javascripts/oxalis/view/left-border-tabs/modals/add_volume_layer_modal.tsx b/frontend/javascripts/oxalis/view/left-border-tabs/modals/add_volume_layer_modal.tsx index 06fbb371a5..fad6a364a5 100644 --- a/frontend/javascripts/oxalis/view/left-border-tabs/modals/add_volume_layer_modal.tsx +++ b/frontend/javascripts/oxalis/view/left-border-tabs/modals/add_volume_layer_modal.tsx @@ -48,9 +48,9 @@ export function checkLayerNameForInvalidCharacters(readableLayerName: string): V message: messages["tracing.volume_layer_name_starts_with_dot"], }; } - const uriSafeCharactersRegex = /[0-9a-zA-Z-._$]+/g; + const validLayerNameCharactersRegex = /[0-9a-zA-Z-._$]+/g; // Removing all URISaveCharacters from readableLayerName. The leftover chars are all invalid. - const allInvalidChars = readableLayerName.replace(uriSafeCharactersRegex, ""); + const allInvalidChars = readableLayerName.replace(validLayerNameCharactersRegex, ""); const allUniqueInvalidCharsAsSet = new Set(allInvalidChars); const allUniqueInvalidCharsAsString = "".concat(...allUniqueInvalidCharsAsSet.values()); const isValid = allUniqueInvalidCharsAsString.length === 0;