Skip to content

Commit 83fd73b

Browse files
committed
Wildcard subdomains - UI improvements
1 parent 8f5a7e6 commit 83fd73b

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/css/popup.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,11 @@ manage things like container crud */
18171817
}
18181818

18191819
#edit-sites-assigned .hostname .subdomain.wildcardSubdomain {
1820-
opacity: 0.2;
1820+
background-color: var(--identity-icon-color);
1821+
border-radius: 8px;
1822+
margin-right: 4px;
1823+
padding-left: 10px;
1824+
padding-right: 10px;
18211825
}
18221826

18231827
.assigned-sites-list > div {

src/js/popup.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,6 +1377,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
13771377

13781378
// Populating the panel: name and icon
13791379
document.getElementById("edit-assignments-title").textContent = identity.name;
1380+
document.getElementById("edit-sites-assigned").setAttribute("data-identity-color", identity.color);
13801381

13811382
const userContextId = Logic.currentUserContextId();
13821383
const assignments = await Logic.getAssignmentObjectByContainer(userContextId);
@@ -1427,7 +1428,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
14271428
});
14281429
// Wildcard click-to-toggle subdomains
14291430
trElement.querySelectorAll(".subdomain").forEach((subdomainLink) => {
1430-
subdomainLink.addEventListener("click", async (e) => {
1431+
subdomainLink.addEventListener("click", (e) => {
14311432
const wildcardHostname = e.target.getAttribute("data-wildcardHostname");
14321433
Utils.setWildcardHostnameForAssignment(assumedUrl, wildcardHostname);
14331434
if (wildcardHostname) {
@@ -1454,14 +1455,14 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
14541455
if (wildcardHostname && wildcardHostname !== hostname) {
14551456
if (hostname.endsWith(wildcardHostname)) {
14561457
return {
1457-
wildcard: hostname.substring(0, hostname.length - wildcardHostname.length),
1458+
wildcard: "★",
14581459
remaining: wildcardHostname
14591460
};
14601461
} else {
14611462
// In case something got corrupted, allow user to fix error
1462-
// by clicking "____" link to clear corrupted wildcard hostname
1463+
// by clicking '★' link to clear corrupted wildcard hostname
14631464
return {
1464-
wildcard: "___",
1465+
wildcard: "",
14651466
remaining: hostname
14661467
};
14671468
}
@@ -1480,6 +1481,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
14801481
// Add wildcard subdomain(s)
14811482
if (subdomains.wildcard) {
14821483
result.appendChild(this.assignmentSubdomainLink(null, subdomains.wildcard));
1484+
result.appendChild(document.createTextNode("."));
14831485
}
14841486

14851487
// Add non-wildcard subdomains
@@ -1503,6 +1505,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
15031505
result.className = "subdomain";
15041506
if (wildcardHostnameOnClick) {
15051507
result.setAttribute("data-wildcardHostname", wildcardHostnameOnClick);
1508+
result.title = `*.${wildcardHostnameOnClick}`;
15061509
} else {
15071510
result.classList.add("wildcardSubdomain");
15081511
}

0 commit comments

Comments
 (0)