messagesOfPathAndDescendant

This commit is contained in:
Niels Lyngsø
2024-08-09 21:36:00 +02:00
parent 32524300d9
commit ca307ba990

View File

@@ -35,7 +35,6 @@ export class UmbValidationMessagesManager {
return this.#messages.getValue().length !== 0;
}
/*
messagesOfPathAndDescendant(path: string): Observable<Array<UmbValidationMessage>> {
// Find messages that starts with the given path, if the path is longer then require a dot or [ as the next character. using a more performant way than Regex:
return this.#messages.asObservablePart((msgs) =>
@@ -46,7 +45,6 @@ export class UmbValidationMessagesManager {
),
);
}
*/
messagesOfTypeAndPath(type: UmbValidationMessageType, path: string): Observable<Array<UmbValidationMessage>> {
// Find messages that matches the given type and path.
@@ -83,6 +81,10 @@ export class UmbValidationMessagesManager {
this.#messages.append(messages.map((message) => ({ type, key: UmbId.new(), path, message })));
}
/*appendMessages(messages: Array<UmbValidationMessage>): void {
this.#messages.append(messages);
}*/
removeMessageByKey(key: string): void {
this.#messages.removeOne(key);
}