-
-
Notifications
You must be signed in to change notification settings - Fork 32
PWA share target implementation #129
base: main
Are you sure you want to change the base?
Conversation
vite.config.ts
Outdated
@@ -202,6 +202,15 @@ export default defineConfig(({mode}) => { | |||
url: '/teams', | |||
}, | |||
], | |||
share_target: { | |||
action: '/_share-target', |
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.
If that's a route, why not use the vue routing system?
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.
This bit is required for the PWA manifest to register the app as a share-target
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.
@kolaente, I did change the share_target to use the GET
method, and now with the processing added to index.ts everthing seems to work as I intended :)
I'll remove the draft status as its ready for review.
{ | ||
path: '/tasks/create', | ||
name: 'task.create', | ||
beforeEnter: async (to, from, next) => { |
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.
Please put this logic in a new component.
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.
Not sure how that would work, as there is no view for this. The intention is to show the newly created task (resulting in a TaskDetailView) and thus the logic is implemented in the beforeEnter
handling instead.
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.
Can you create a new view which does nothing but contains the logic you have here and then redirects (maybe show a loading spinner etc. while we're at it)? This kind of logic should not go into a beforeEnter handler.
This is an intitial step towards the implementation of a
share_target
for PWA, as requested in go-vikunja/vikunja#117.The intended workings of it are to register a
share_target
for the PWA to accept text, which would then be used to create a new task with the provided text as Title & Description of this task, and then to open the task view for the user to further edit.Registration of the handler, receiving the provided data, and forwarding to a task view upon success are working as expected. However use of the
TaskStore
andAuthStore
causepnpm run build
to error out with seemingly useless parsing errors.I'm no frontend dev and quite unfamiliar with anything JS. Hopefully someone with more experience is able to further aid the implementation of this feature.
Resolves go-vikunja/vikunja#117