-
Notifications
You must be signed in to change notification settings - Fork 209
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
Profile import auto refresh when some or all packages are not found #1655
base: develop
Are you sure you want to change the base?
Conversation
…t, not all of the mods are known
…out failed profile import
@@ -123,7 +125,7 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) { | |||
} | |||
|
|||
// Check that selected profile zip is valid and proceed. | |||
async validateProfileFile(files: string[] | null) { | |||
async validateProfileFile(files: string[] | null, isRetry: boolean = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isRetry
is never used.
@@ -144,6 +146,25 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) { | |||
} | |||
|
|||
this.profileImportFilePath = files[0]; | |||
|
|||
if (this.profileMods.known.length === 0 || this.profileMods.unknown.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: I think we're only interested in the number of unknown mods here? Checking number of known mods won't probably hurt, but at the same time refreshing the mod list can only solve issues with unknown mods.
@@ -144,6 +146,25 @@ export default class ImportProfileModal extends mixins(ProfilesMixin) { | |||
} | |||
|
|||
this.profileImportFilePath = files[0]; | |||
|
|||
if (this.profileMods.known.length === 0 || this.profileMods.unknown.length > 0) { | |||
// Sometimes the reason some packages are unknown is that the mod is out of date, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: should "mod is out of date" say "mod list is out of date"?
try { | ||
this.activeStep = 'REFRESH_MOD_LIST'; | ||
await this.$store.dispatch('tsMods/syncPackageList'); | ||
this.profileMods = await ProfileUtils.exportModsToCombos( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Is this needed? syncPackageList
should update the mod list in Vuex, and that's watched by updateProfileModsOnOnlineModListRefresh
, which does the same thing as this line? Seems to me we do this thing twice now?
<ModalCard v-else-if="activeStep === 'REVIEW_IMPORT'" key="REVIEW_IMPORT" :is-active="isOpen" @close-modal="closeModal"> | ||
<template v-slot:header> | ||
<h2 class="modal-title">Packages to be installed</h2> | ||
</template> | ||
<template v-slot:body> | ||
<OnlineModList :paged-mod-list="knownProfileMods" :read-only="true" /> | ||
<OnlineModList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit unrelated to the changes, but I would probably change the order so that warning box is shown on top and the OnlineModList
below it. The rationale is that for large profiles user might not scroll the list to the bottom and don't then see the warning.
<ModalCard v-else-if="activeStep === 'REVIEW_IMPORT'" key="REVIEW_IMPORT" :is-active="isOpen" @close-modal="closeModal"> | ||
<template v-slot:header> | ||
<h2 class="modal-title">Packages to be installed</h2> | ||
</template> | ||
<template v-slot:body> | ||
<OnlineModList :paged-mod-list="knownProfileMods" :read-only="true" /> | ||
<OnlineModList | ||
v-if="profileMods.known.length > 0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: I think this should check knownProfileMods.length
as that's what gets passed to the component.
<p v-else> | ||
None of the packages in the profile were found on Thunderstore. | ||
</p> | ||
<div v-if="profileMods.known.length === 0 || profileMods.unknown.length > 0" class="notification is-warning margin-top"> | ||
<p v-if="profileMods.known.length === 0"> | ||
None of the packages in the profile were found on Thunderstore: | ||
These packages were not found: | ||
</p> | ||
<p v-else> | ||
Some of the packages in the profile were not found on Thunderstore: | ||
These packages in the profile were found on Thunderstore: | ||
</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would perhaps reconsider how these three paragraphs work together. First saying no packages were found and then listing all the packages seems redundant. Saying "These packages in the profile were found on Thunderstore" and then listing unknownProfileModNames
seems like a bug?
Should this perhaps just say "These packages in the profile were not found on Thunderstore" (notice the "not") inside the yellow box and then list the unknown mods for all cases?
No description provided.