forked from MapComplete/MapComplete
Various small fixes, add indication of which tags are added for power users
This commit is contained in:
parent
a55767c1e9
commit
47d755e59f
9 changed files with 147 additions and 59 deletions
|
@ -7,6 +7,8 @@ export abstract class TagsFilter {
|
|||
matchesProperties(properties: any) : boolean{
|
||||
return this.matches(TagUtils.proprtiesToKV(properties));
|
||||
}
|
||||
|
||||
abstract asHumanString();
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,6 +53,10 @@ export class Regex extends TagsFilter {
|
|||
substituteValues(tags: any) : TagsFilter{
|
||||
throw "Substituting values is not supported on regex tags"
|
||||
}
|
||||
|
||||
asHumanString() {
|
||||
return this._k+"~="+this._r;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -143,6 +149,10 @@ export class Tag extends TagsFilter {
|
|||
|
||||
return new Tag(this.key, TagUtils.ApplyTemplate(this.value as string, tags));
|
||||
}
|
||||
|
||||
asHumanString() {
|
||||
return this.key+"="+this.value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -190,6 +200,10 @@ export class Or extends TagsFilter {
|
|||
}
|
||||
return new Or(newChoices);
|
||||
}
|
||||
|
||||
asHumanString() {
|
||||
return this.or.map(t => t.asHumanString()).join("|");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -247,6 +261,10 @@ export class And extends TagsFilter {
|
|||
}
|
||||
return new And(newChoices);
|
||||
}
|
||||
|
||||
asHumanString() {
|
||||
return this.and.map(t => t.asHumanString()).join("&");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -269,6 +287,10 @@ export class Not extends TagsFilter{
|
|||
substituteValues(tags: any): TagsFilter {
|
||||
return new Not(this.not.substituteValues(tags));
|
||||
}
|
||||
|
||||
asHumanString() {
|
||||
return "!"+this.not.asHumanString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue