mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-31 19:17:48 +00:00
This allows a user to add/update a custom regex and a cue while defining custom attributes(Only applicable for type- text). While adding/editing custom attributes, the values are validated against the attribute definition regex, and if it is incorrect, a cue message or default error message is shown and restricts invalid values from being saved. Fixes: #6866
12 lines
266 B
JavaScript
12 lines
266 B
JavaScript
export default {
|
|
methods: {
|
|
getRegexp(regexPatternValue) {
|
|
let lastSlash = regexPatternValue.lastIndexOf('/');
|
|
return new RegExp(
|
|
regexPatternValue.slice(1, lastSlash),
|
|
regexPatternValue.slice(lastSlash + 1)
|
|
);
|
|
},
|
|
},
|
|
};
|