Skip to content

Commit

Permalink
unify duplicate authorities (synolib 3.2.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
nleanba committed Dec 20, 2024
1 parent 9a173f6 commit 4a11b10
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 53 deletions.
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"imports": {
"@luca/esbuild-deno-loader": "jsr:@luca/esbuild-deno-loader@^0.11.0",
"@plazi/synolib": "jsr:@plazi/synolib@3.1.1",
"@plazi/synolib": "jsr:@plazi/synolib@^3.2.1",
"@std/collections": "jsr:@std/collections@^1.0.9",
"yasqe": "npm:@triply/yasqe@^4.2.28",
"yasr": "npm:@triply/yasr@^4.2.28",
Expand Down
8 changes: 4 additions & 4 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 6 additions & 39 deletions dist/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ syno-treatment.open {
color: var(--text-color-muted);
}

.aka {
font-size: 0.75rem;
color: var(--text-color-muted);
font-weight: normal;
}

.uri:not(:empty) {
font-size: 0.8rem;
line-height: 1rem;
Expand Down Expand Up @@ -321,45 +327,6 @@ ul {
margin: 0;
}

.treatmentline {
display: block;
position: relative;
margin: 0;
transition: all 200ms;
clear: both;

&>s-icon,
&>svg {
height: 20px;
vertical-align: sub;
margin: 0 0.2rem 0 -1.2rem;
}

>.icon.button {
float: right;
}

.hidden {
max-height: 0;
overflow: hidden;
transition: all 200ms;
}

&.expanded {
/* position: absolute; */
background: var(--nav-background);
z-index: 10;
border-radius: 0.2rem;
padding: 0.2rem;
margin: 0.2rem -0.2rem;

.hidden {
max-height: 200rem;
overflow: auto;
}
}
}

.icon.button {
border-radius: 1rem;
border: none;
Expand Down
27 changes: 18 additions & 9 deletions src/components/SynoName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import type {
import { distinct } from "@std/collections/distinct";
import "./Icons.ts";
import {
SynoColTreatment,
type SynoStatus,
SynoTreatment,
} from "./SynoTreatment.ts";
import "./WikidataButtons.ts";
import { css, html, LitElement, nothing } from "lit";
import { html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators.js";
import { until } from "lit/directives/until.js";

Expand Down Expand Up @@ -54,6 +53,9 @@ export class SynoAuthName extends LitElement {
return 0;
});

const authorities = new Set(this.authorizedName.authorities);
authorities.delete(this.authorizedName.authority);

return html`
<h3 id=${
this.authorizedName.colURI
Expand All @@ -62,14 +64,21 @@ export class SynoAuthName extends LitElement {
}>
<i class="ditto">${this.authorizedName.displayName}</i>
${this.authorizedName.authority}
${
this.authorizedName.taxonConceptURI
? html`<a class="taxon uri" id=${
encodeURIComponent(this.authorizedName.taxonConceptURI)
} href=${this.authorizedName.taxonConceptURI} target="_blank">${
shortUrl(this.authorizedName.taxonConceptURI)
}<s-icon icon="link"></s-icon></a>`
${
authorities.size > 0
? html`<span class="aka">Authority also given as “${
[...authorities].join("”, “")
}</span>`
: nothing
}
${
this.authorizedName.taxonConceptURIs.map((tc) =>
html`<a class="taxon uri" id=${
encodeURIComponent(tc)
} href=${tc} target="_blank">${
shortUrl(tc)
}<s-icon icon="link"></s-icon></a>`
)
}
</h3>
<ul>
Expand Down

0 comments on commit 4a11b10

Please sign in to comment.