Improved unmarked tag detection

This commit is contained in:
Jiang Yio 2023-05-01 17:19:52 -04:00
parent ec841b9591
commit c53a9654b5

View File

@ -97,14 +97,19 @@
methods: { methods: {
strHashHSL, strHashHSL,
gettags(row) { gettags(row) {
var res = {}, matches; var res = {}, re, matches;
if((row.RESOURCENAME) && (matches = row.RESOURCENAME.replace(/\W+/g, '-').replace(/^-+|-+$/g, ''))) res[matches.toLowerCase()] = matches; if((row.RESOURCENAME) && (matches = row.RESOURCENAME.replace(/\W+/g, '-').replace(/^-+|-+$/g, ''))) res[matches.toLowerCase()] = matches;
if(row.WALKIN != '0') res['walkin'] = 'WALKIN'; if(row.WALKIN != '0') res['walkin'] = 'WALKIN';
if(row.CANCELLED != '0') res['cancelled'] = 'CANCELLED'; if(row.CANCELLED != '0') res['cancelled'] = 'CANCELLED';
else if(row.NOSHOW != '0') res['noshow'] = 'NOSHOW'; else if(row.NOSHOW != '0') res['noshow'] = 'NOSHOW';
else if(row.CHECKOUT) res['checkedout'] = 'CHECKEDOUT'; else if(row.CHECKOUT) res['checkedout'] = 'CHECKEDOUT';
else if(row.CHECKIN) res['checkedin'] = 'CHECKEDIN'; else if(row.CHECKIN) res['checkedin'] = 'CHECKEDIN';
if((row.NOTE) && (matches = row.NOTE.match(/#[0-9a-z][\w-]*/gi))) matches.reduce((acc, val) => (acc[val.substring(1).toLowerCase()] = val.substring(1), acc), res); if(row.NOTE) {
re = /#([0-9a-z][\w-]*)/gi;
while(matches = re.exec(row.NOTE)) res[matches[1].toLowerCase()] = matches[1];
re = /Dr[\.\s]*\b([a-z][\w-]*)/gi;
while(matches = re.exec(row.NOTE)) res[matches[1].toLowerCase()] = matches[1];
}
return res; return res;
}, },
filter_conj(tags) { filter_conj(tags) {