@playpilot/tpi 8.38.1 → 8.38.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorial.mount.js +6 -6
- package/dist/link-injections.js +1 -1
- package/dist/mount.js +5 -5
- package/package.json +1 -1
- package/src/routes/components/Explore/Routes/ExploreHome.svelte +1 -1
- package/src/routes/components/Rails/TitlesRail.svelte +3 -1
- package/src/tests/routes/components/Rails/TitlesRail.test.js +6 -0
package/package.json
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
onexpand={(title) => track(TrackingEvent.ExploreTitleRailExpandClick, title, { rail: headings })}
|
|
58
58
|
fetchFunction={(page) => getListTitles({ ...params, page })}
|
|
59
59
|
size={properties.size || 'flexible'}
|
|
60
|
-
minimumLength={7} />
|
|
60
|
+
minimumLength={properties.minimum ?? 7} />
|
|
61
61
|
</div>
|
|
62
62
|
{/each}
|
|
63
63
|
{:catch}
|
|
@@ -168,6 +168,8 @@
|
|
|
168
168
|
{/each}
|
|
169
169
|
</Rail>
|
|
170
170
|
{:then titles}
|
|
171
|
+
{@const titlesWithoutDuplicates = titles.filter((a, i, titles) => titles.findIndex(b => (b.sid === a.sid)) === i)}
|
|
172
|
+
|
|
171
173
|
{#if titles?.length >= minimumLength}
|
|
172
174
|
<Rail
|
|
173
175
|
bind:slider
|
|
@@ -175,7 +177,7 @@
|
|
|
175
177
|
{heading}
|
|
176
178
|
onchange={(index) => onchange(titles, index)}
|
|
177
179
|
onresize={() => slider?.reposition()}>
|
|
178
|
-
{#each
|
|
180
|
+
{#each titlesWithoutDuplicates as title, index}
|
|
179
181
|
{@const expanded = isExpanded(title)}
|
|
180
182
|
{@const onclick = (event: MouseEvent): void => openTitle(event, titles, index)}
|
|
181
183
|
|
|
@@ -221,4 +221,10 @@ describe('TitlesRail.svelte', () => {
|
|
|
221
221
|
expect(window.location.href).toContain(`?route=modal&sid=${title.sid}`)
|
|
222
222
|
expect(openModal).not.toHaveBeenCalledWith()
|
|
223
223
|
})
|
|
224
|
+
|
|
225
|
+
it('Should remove duplicate titles', () => {
|
|
226
|
+
const { container } = render(TitlesRail, { titles: [title, title] })
|
|
227
|
+
|
|
228
|
+
expect(container.querySelectorAll('.title')).toHaveLength(1)
|
|
229
|
+
})
|
|
224
230
|
})
|