feat: MigrateService script setup #2432
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#2432
Loading…
Reference in New Issue
No description provided.
Delete Branch "dpschen/frontend:feature/feat-MigrationService-script-setup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi dpschen!
Thank you for creating a PR!
I've deployed the changes of this PR on a preview environment under this URL: https://2432-feature-feat-migrationservice-sc--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.
Have a nice day!
WIP: feat: MigrateService script setupto feat: MigrateService script setupShould we align the naming? Because we have
MigrateService
andMigrationService
I'd like to keep a distiction between the component and the service (the thing doing the requests to actually migrate). Maybe we should rename the component so that it does not contain
Service
?Simplest pattern I can think of:
Migrate.vue
=>Migration.vue
MigrateService.vue
=>MigrationHandler.vue
Other names I came up with:
Migrate.vue
:MigrationStart
MigrationSelection
MigrationOverview
MigrationIndex
MigrateService.vue
:Migration.vue
(if the other file is not already called that)MigrationHandler.vue
I wanted to make clear that it is in the latter component where the actual migration happens, thus the renaming of the first component.
I like that.
4461ef2f78
to743b46cf8a
Looks like the "get started" button does not do anything anymore:
Navigating back (with the browser's back button) breaks:
@ -0,0 +122,4 @@
return
}
authUrl.value = await migrationService.getAuthUrl().then(({url}) => url)
It looks like this call to the api happens but the
authUrl
stays empty.@ -0,0 +150,4 @@
lastMigrationDate.value = null
message.value = ''
let migrationConfig : MigrationConfig = {code: migratorAuthCode.value}
@konrad:
This
MigrationConfig
here is wrong. Since the config is passed to themigrate
method of the service which passes it to update, which wants aFile
(?) I'm not sure what type to define here. Any idea?Maybe
MigrationConfig | File
? TheFile
type is correct but only when the migrator requires a file to be uploaded. Otherwise it needs that code to make api calls to the third party api.The update function is defined in the
AbstractService
thus it's types as well.Have to find out how we can pass types there so that it supports different types depending on the use-case. I think it doesn't make sense to support the MigrationConfig type there.
743b46cf8a
to9734bf23d9
This is interesting. Seems like the
beforeRouteEnter
doesn't get triggered.Can you explain your flow? From which page did you navigate back from?
From
/migrate/todoist
(the page with the button I mentioned earlier).9734bf23d9
to9fbba878b5
9fbba878b5
to7ad3e1c158
7ad3e1c158
tof0f00068c4
f0f00068c4
to4564da7bfe
After migrating, this should show the message (not the json):
4564da7bfe
to102923295f
102923295f
todaba3cfe4f
Should be fixed
Clicking on either one of the new lists in the menu or the "refresh" button brings up this error:
daba3cfe4f
toea30bed822
Interesting. Seems like when passing the route props via the view component as parameter it doesn't change when the route changes.
When watching the route directly it does so before the route changes. Because of the route based properties get retriggered:
Solution seems to be to always watch the route via a watched param from the component.
I always prefered this approach but it also has its downsides, since there is an initial parsing of the route in the route config which bloats the overall app bundle, since every new page potentially adds more config).
I fixed the component that way. We probably have similar issues in other parts of the app. Potentially everywhere where we use
useRoute
instead of passing some route stuff via the props to the component.Edit:
To get to the error state shown in the screens I did the steps that you described.