STRUCT is optional in TEXTELR
This commit is contained in:
parent
cff3202a1b
commit
5080b139b7
3 changed files with 9 additions and 7 deletions
|
@ -13,13 +13,13 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if showArticles}
|
{#if showArticles}
|
||||||
{#each [...iterArrayOrSingleton(textelr.STRUCT.LIEN_ART)] as lienArt}
|
{#each [...iterArrayOrSingleton(textelr.STRUCT?.LIEN_ART)] as lienArt}
|
||||||
{@const article = data.article?.[lienArt["@id"]]}
|
{@const article = data.article?.[lienArt["@id"]]}
|
||||||
{#if article !== undefined}
|
{#if article !== undefined}
|
||||||
<ArticleView {article} {data} level={level + 1} />
|
<ArticleView {article} {data} level={level + 1} />
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
{:else if textelr.STRUCT.LIEN_ART !== undefined}
|
{:else if textelr.STRUCT?.LIEN_ART !== undefined}
|
||||||
<ul class="inline">
|
<ul class="inline">
|
||||||
{#each [...iterArrayOrSingleton(textelr.STRUCT.LIEN_ART)] as lienArt}
|
{#each [...iterArrayOrSingleton(textelr.STRUCT.LIEN_ART)] as lienArt}
|
||||||
<li class="inline after:content-[',_'] after:last:content-['']">
|
<li class="inline after:content-[',_'] after:last:content-['']">
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#each [...iterArrayOrSingleton(textelr.STRUCT.LIEN_SECTION_TA)] as lienSectionTa}
|
{#each [...iterArrayOrSingleton(textelr.STRUCT?.LIEN_SECTION_TA)] as lienSectionTa}
|
||||||
{@const sectionTa = data.section_ta?.[lienSectionTa["@id"]]}
|
{@const sectionTa = data.section_ta?.[lienSectionTa["@id"]]}
|
||||||
{#if sectionTa !== undefined}
|
{#if sectionTa !== undefined}
|
||||||
<SectionTaView {data} level={level + 1} {sectionTa} {showArticles} />
|
<SectionTaView {data} level={level + 1} {sectionTa} {showArticles} />
|
||||||
|
|
|
@ -457,7 +457,7 @@ export interface Textelr {
|
||||||
META_TEXTE_CHRONICLE: MetaTexteChronicle
|
META_TEXTE_CHRONICLE: MetaTexteChronicle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
STRUCT: {
|
STRUCT?: {
|
||||||
LIEN_ART?: LienArt | LienArt[]
|
LIEN_ART?: LienArt | LienArt[]
|
||||||
LIEN_SECTION_TA?: LienSectionTa | LienSectionTa[]
|
LIEN_SECTION_TA?: LienSectionTa | LienSectionTa[]
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ export class Aggregator {
|
||||||
this.textekali[id] = textekali
|
this.textekali[id] = textekali
|
||||||
|
|
||||||
if (this.follow.has("STRUCT.LIEN_ART.@id")) {
|
if (this.follow.has("STRUCT.LIEN_ART.@id")) {
|
||||||
for (const lien of iterArrayOrSingleton(textekali.STRUCT.LIEN_ART)) {
|
for (const lien of iterArrayOrSingleton(textekali.STRUCT?.LIEN_ART)) {
|
||||||
this.requestId(lien["@id"])
|
this.requestId(lien["@id"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,13 +84,15 @@ export class Aggregator {
|
||||||
this.textelr[id] = textelr
|
this.textelr[id] = textelr
|
||||||
|
|
||||||
if (this.follow.has("STRUCT.LIEN_ART.@id")) {
|
if (this.follow.has("STRUCT.LIEN_ART.@id")) {
|
||||||
for (const lien of iterArrayOrSingleton(textelr.STRUCT.LIEN_ART)) {
|
for (const lien of iterArrayOrSingleton(textelr.STRUCT?.LIEN_ART)) {
|
||||||
this.requestId(lien["@id"])
|
this.requestId(lien["@id"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.follow.has("STRUCT.LIEN_SECTION_TA.@id")) {
|
if (this.follow.has("STRUCT.LIEN_SECTION_TA.@id")) {
|
||||||
for (const lien of iterArrayOrSingleton(textelr.STRUCT.LIEN_SECTION_TA)) {
|
for (const lien of iterArrayOrSingleton(
|
||||||
|
textelr.STRUCT?.LIEN_SECTION_TA,
|
||||||
|
)) {
|
||||||
this.requestId(lien["@id"])
|
this.requestId(lien["@id"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue