-
Notifications
You must be signed in to change notification settings - Fork 49
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
Be able to edit scheduleEntries from activity and to edit activityResponsibles #4375
Be able to edit scheduleEntries from activity and to edit activityResponsibles #4375
Conversation
⛔ Feature branch deployment currently inactive.If the PR is still open, you can add the |
@carlobeltrame moved it to the right side. |
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.
Just as info:
There was once another proposal to add this feature: #1379
</tbody> | ||
</table> | ||
<DialogActivityEdit | ||
v-if="activity" |
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.
you should hide or disable the button for guests. (if the activity is not editable)
if (!this.hideHeaderFields) { | ||
const untouchedActivityResponsibles = intersectionWith( | ||
this.initialResponsibles, | ||
this.entityData.activityResponsibles, | ||
(a, b) => { | ||
return a.campCollaboration._meta.self === b.campCollaboration._meta.self | ||
} | ||
) | ||
|
||
const differentActivityResponsibles = differenceWith( | ||
[...this.initialResponsibles, ...this.entityData.activityResponsibles], | ||
untouchedActivityResponsibles, | ||
(a, b) => { | ||
return a.campCollaboration._meta.self === b.campCollaboration._meta.self | ||
} | ||
) | ||
|
||
differentActivityResponsibles.forEach((activityResponsible) => { | ||
if (activityResponsible?._meta?.self) { | ||
promises.push(this.api.del(activityResponsible._meta.self)) | ||
} else { | ||
promises.push( | ||
this.activityResponsibles.$post({ | ||
activity: this.currentActivity._meta.self, | ||
campCollaboration: activityResponsible.campCollaboration._meta.self, | ||
}) | ||
) | ||
} | ||
}) | ||
} |
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 think this is solved little to simple. (even though i see a lot of thought process)
- This should not be in the update logic of the scheduleEntries
- In this function all the promises to update things (scheduleEntries, the activity itself) are collected and awaited. This should be preserved.
I would split the 2 changes in separate PR and first add the possibility to edit the scheduleEntries in the Activity View.
And then add the responsibles to the activty dialog in the picasso.
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.
@BacLuc "too simple"? What should I make more complicated/different?
- This should not be in the update logic of the scheduleEntries
Why?
- … This should be preserved.
It is, it just adds the update scheduleEntries to the same promises array as scheduleEntries and activity.
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.
@BacLuc "too simple"? What should I make more complicated/different?
- This should not be in the update logic of the scheduleEntries
Why?
But you don't want to send the post/delete requests for the activityResponsibles for each ScheduleEntry.
(The delete and posts for the same insertion/deletion are sent for each scheduleEntry once as i read the code).
- … This should be preserved.
It is, it just adds the update scheduleEntries to the same promises array as scheduleEntries and activity.
but something seems to not work:
Screencast from 07.01.2024 14:24:44.webm
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.
uups, sorry.
Its not in the update for the scheduleentries.
@BacLuc hmm, do you know why this was not merged? |
I don't know it, but i vaguely remember that this was at the time we switched to api-platform. |
It makes sense to be able to edit the activity properties from the activity view.
![Bildschirmfoto 2024-01-02 um 23 56 11](https://private-user-images.githubusercontent.com/3001985/293804431-9ff6b56f-d3e3-4f7e-9db5-4230ea2be9fe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MDM5NjksIm5iZiI6MTcyMzkwMzY2OSwicGF0aCI6Ii8zMDAxOTg1LzI5MzgwNDQzMS05ZmY2YjU2Zi1kM2UzLTRmN2UtOWRiNS00MjMwZWEyYmU5ZmUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTQwNzQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzBjYTAzNjYyNTU5NzJmNjU5Y2NhNDk5MjRiYTUxMDQ4ZTU4YTJkMzJhMjE5OTE1MGQ1MWEzMWVlY2I1OGY0MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.mrKG7m4WWa-GmVqISRis0TlbfxSBuqCziazOfs7AG0s)
(I thought it might be better to also be able to also be able to edit the title and category, to help people that did not get the trick to click on the title / category to change it.)
Also it makes sense to be able to edit the activity responsibles in the edit dialog.
![Bildschirmfoto 2024-01-02 um 23 55 48](https://private-user-images.githubusercontent.com/3001985/293804386-a31d26f4-f77f-4e95-9326-7f782a9f538e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MDM5NjksIm5iZiI6MTcyMzkwMzY2OSwicGF0aCI6Ii8zMDAxOTg1LzI5MzgwNDM4Ni1hMzFkMjZmNC1mNzdmLTRlOTUtOTMyNi03Zjc4MmE5ZjUzOGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MTdUMTQwNzQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTFjYjQwZDc0NjA5YjEyYmQ1ZmNiYjA0NWExYWIzNDIyYzM5MzA4ZTY3MWU2MWQ1ZWE3ZTdjMjhmMzU2YmNmZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.q4lxRzun7qJlyEiWbc52yk9CGkzjjJY58uCWN589msE)
This is restricted to the edit dialog and is not implemented for the creation dialog.