Fix some inconsistencies in the scouting web page
When migrating to rules_js and Cypress, I found a few inconsistencies
that we should address:
1. Some pages used a `page-title` ID element for the header instead of
using the standard `.header` class.
2. Some of the IDs we generated are technically invalid. Cypress
doesn't handle IDs with spaces.
This patch addresses both the inconsistencies. We use the same header
setup everywhere now. And we generate valid IDs.
The ID fixing function uses `replaceAll` which is only available
starting in ECMAScript 2021. So I upgraded to that version. It doesn't
appear to break anything.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: Id4ff050aab57f86e187e06de395dda4f3e3424bf
diff --git a/scouting/www/notes/notes.component.ts b/scouting/www/notes/notes.component.ts
index f503e2d..c746ef9 100644
--- a/scouting/www/notes/notes.component.ts
+++ b/scouting/www/notes/notes.component.ts
@@ -175,4 +175,8 @@
this.errorMessage = '';
this.section = 'TeamSelection';
}
+
+ labelToId(label: String): String {
+ return label.replaceAll(' ', '_').toLowerCase();
+ }
}