Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract shared code into DocumentList #275

Merged
merged 23 commits into from
Feb 2, 2024
Merged

Conversation

kkuepper
Copy link
Member

No description provided.

@kkuepper kkuepper requested a review from SimonSimCity January 24, 2024 18:58
@kkuepper
Copy link
Member Author

@SimonSimCity I'm still working on implementing the "See all" pages. But you can already review this part.

Copy link

codecov bot commented Jan 24, 2024

Codecov Report

Attention: 285 lines in your changes are missing coverage. Please review.

Comparison is base (dc21075) 10.47% compared to head (2e2f536) 10.36%.

Files Patch % Lines
components/DocumentList.vue 0.00% 180 Missing and 1 partial ⚠️
composables/browse.ts 0.00% 28 Missing ⚠️
utils/setTitleOfDocumentList.ts 0.00% 12 Missing and 1 partial ⚠️
composables/playlist.ts 0.00% 8 Missing ⚠️
pages/browse/audiobooks.vue 0.00% 7 Missing and 1 partial ⚠️
pages/browse/events.vue 0.00% 7 Missing and 1 partial ⚠️
pages/browse/music.vue 0.00% 5 Missing and 1 partial ⚠️
pages/browse/podcasts.vue 0.00% 5 Missing and 1 partial ⚠️
pages/featured.vue 0.00% 5 Missing and 1 partial ⚠️
pages/index.vue 0.00% 6 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #275      +/-   ##
==========================================
- Coverage   10.47%   10.36%   -0.12%     
==========================================
  Files          97      101       +4     
  Lines        4497     4545      +48     
  Branches      181      185       +4     
==========================================
  Hits          471      471              
- Misses       3934     3978      +44     
- Partials       92       96       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-meadow-01b17e903-275.westeurope.3.azurestaticapps.net

Copy link
Collaborator

@SimonSimCity SimonSimCity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now reviewed it as if it was a normal PR 😅 Apart from these changes, I'd merge it straight away. Codewise I only see an improvement, and some conceptual arrangements which someone not familiar with deeper concepts would have to read himself into (not for time-to-time contributors).

@kkuepper
Copy link
Member Author

@SimonSimCity I also need to update bmm-sdk-fetch since I found 2 bugs in the definition when working with this PR. Until that happens the linter will fail.

@SimonSimCity
Copy link
Collaborator

@kkuepper Currently the linter fails because:

components/DocumentModels.vue(121,17): error TS2367: This comparison appears to be unintentional because the types '"track" | "album" | "playlist" | "podcast" | "InfoMessage" | "Tile" | "contributor" | "listening_streak" | "recommendation" | "tile_message" | "tile_video" | "track_collection" | "year_in_review"' and '"chapter_header"' have no overlap.

The reason for chapter_header not being valid option on the type property is because it already has been filtered out - it can by definition not be part of this list anymore (see composables/discover.ts).

If you want, we can elaborate about it - as I don't quite know the concept you're trying to set here, I guess - that's at least what I read off the responses you wrote to my comments ...

@kkuepper
Copy link
Member Author

kkuepper commented Feb 1, 2024

@kkuepper Currently the linter fails because:

components/DocumentModels.vue(121,17): error TS2367: This comparison appears to be unintentional because the types '"track" | "album" | "playlist" | "podcast" | "InfoMessage" | "Tile" | "contributor" | "listening_streak" | "recommendation" | "tile_message" | "tile_video" | "track_collection" | "year_in_review"' and '"chapter_header"' have no overlap.

The reason for chapter_header not being valid option on the type property is because it already has been filtered out - it can by definition not be part of this list anymore (see composables/discover.ts).

If you want, we can elaborate about it - as I don't quite know the concept you're trying to set here, I guess - that's at least what I read off the responses you wrote to my comments ...

Updating bmm-sdk fixed that issue.

Copy link

github-actions bot commented Feb 1, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-meadow-01b17e903-275.westeurope.3.azurestaticapps.net

@kkuepper kkuepper marked this pull request as ready for review February 1, 2024 21:25
@kkuepper
Copy link
Member Author

kkuepper commented Feb 1, 2024

@SimonSimCity @sifferhans It's ready for final review / merge.

Copy link
Collaborator

@sifferhans sifferhans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good:)

Copy link

github-actions bot commented Feb 1, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-meadow-01b17e903-275.westeurope.3.azurestaticapps.net

@kkuepper kkuepper requested a review from SimonSimCity February 2, 2024 13:00
watch(
props,
() => {
toolbarTitleStore().setToolbarTitle(props.list?.title ?? " ");
Copy link
Collaborator

@SimonSimCity SimonSimCity Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do all pages who use this for listing set the title here? My suggestion is that the title should rather be handled by the page than by a component.

Copy link
Member Author

@kkuepper kkuepper Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean. If the server returns a DocumentList it also provides the title.

To make it obvious on the page that the title will be set, I could create a method SetTitleFromDocumentList() or so.

Copy link
Collaborator

@SimonSimCity SimonSimCity Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well... I'd rather put these lines into each page... For me, the title is a part of the page and should not be controlled by a component. By this, you can use this component at more pages, also on one page multiple times.

</template>
</ul>
<template v-else>
<DocumentModels v-if="models !== null" :models="models"></DocumentModels>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the component DocumentList here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the question

pages/index.vue Outdated
</template>
</ol>
</template>
<DocumentModels v-if="models !== null" :models="models"></DocumentModels>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the component DocumentList here?

toolbarTitle.value = title;
}

return { setReactiveToolbarTitle, toolbarTitle, setToolbarTitle };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation is prone to the problem, that the title will be overwritten if the reactive title is updated late.


export default function reactiveApi<Data, Error>(data: AsyncData<Data, Error>) {
const stopHandler = watch(
() => contentLanguageStore().contentLanguages,
[
() => useNuxtApp().$i18n.locale,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that probably doesn't work

Copy link

github-actions bot commented Feb 2, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-meadow-01b17e903-275.westeurope.3.azurestaticapps.net

@kkuepper kkuepper changed the title extract shared code into DocumentModels extract shared code into DocumentList Feb 2, 2024
@SimonSimCity SimonSimCity merged commit 0e63b93 into main Feb 2, 2024
8 of 10 checks passed
@SimonSimCity SimonSimCity deleted the feature/document-models branch February 2, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants