Skip to content

Commit efc9847

Browse files
committed
Wildcard subdomains - UI improvements
1 parent 7003674 commit efc9847

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
@@ -1601,7 +1601,11 @@ manage things like container crud */
16011601
}
16021602

16031603
#edit-sites-assigned .hostname .subdomain.wildcardSubdomain {
1604-
opacity: 0.2;
1604+
background-color: var(--identity-icon-color);
1605+
border-radius: 8px;
1606+
margin-right: 4px;
1607+
padding-left: 10px;
1608+
padding-right: 10px;
16051609
}
16061610

16071611
.assigned-sites-list > div {

src/js/popup.js

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

13741374
// Populating the panel: name and icon
13751375
document.getElementById("edit-assignments-title").textContent = identity.name;
1376+
document.getElementById("edit-sites-assigned").setAttribute("data-identity-color", identity.color);
13761377

13771378
const userContextId = Logic.currentUserContextId();
13781379
const assignments = await Logic.getAssignmentObjectByContainer(userContextId);
@@ -1423,7 +1424,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
14231424
});
14241425
// Wildcard click-to-toggle subdomains
14251426
trElement.querySelectorAll(".subdomain").forEach((subdomainLink) => {
1426-
subdomainLink.addEventListener("click", async (e) => {
1427+
subdomainLink.addEventListener("click", (e) => {
14271428
const wildcardHostname = e.target.getAttribute("data-wildcardHostname");
14281429
Utils.setWildcardHostnameForAssignment(assumedUrl, wildcardHostname);
14291430
if (wildcardHostname) {
@@ -1450,14 +1451,14 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
14501451
if (wildcardHostname && wildcardHostname !== hostname) {
14511452
if (hostname.endsWith(wildcardHostname)) {
14521453
return {
1453-
wildcard: hostname.substring(0, hostname.length - wildcardHostname.length),
1454+
wildcard: "★",
14541455
remaining: wildcardHostname
14551456
};
14561457
} else {
14571458
// In case something got corrupted, allow user to fix error
1458-
// by clicking "____" link to clear corrupted wildcard hostname
1459+
// by clicking '★' link to clear corrupted wildcard hostname
14591460
return {
1460-
wildcard: "___",
1461+
wildcard: "",
14611462
remaining: hostname
14621463
};
14631464
}
@@ -1476,6 +1477,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
14761477
// Add wildcard subdomain(s)
14771478
if (subdomains.wildcard) {
14781479
result.appendChild(this.assignmentSubdomainLink(null, subdomains.wildcard));
1480+
result.appendChild(document.createTextNode("."));
14791481
}
14801482

14811483
// Add non-wildcard subdomains
@@ -1499,6 +1501,7 @@ Logic.registerPanel(P_CONTAINER_ASSIGNMENTS, {
14991501
result.className = "subdomain";
15001502
if (wildcardHostnameOnClick) {
15011503
result.setAttribute("data-wildcardHostname", wildcardHostnameOnClick);
1504+
result.title = `*.${wildcardHostnameOnClick}`;
15021505
} else {
15031506
result.classList.add("wildcardSubdomain");
15041507
}

0 commit comments

Comments
 (0)