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

CampProgram: fix create activity #2213

Merged
merged 3 commits into from
Nov 15, 2021

Conversation

BacLuc
Copy link
Contributor

@BacLuc BacLuc commented Nov 10, 2021

Unschönheiten:

  • Merge patch der ScheduleEntries hat (noch) nicht funktioniert. Ich kann sonst auch den letzten commit weglassen, dann geht das editieren der ScheduleEntries nicht.

Fehler:

  • color.match is not a function. Sollte jemand in einem separaten PR lösen, scheint ein Fehler im zusammenspiel von unserem code + vcalendar zu sein. (ich bin momentan wenig motiviert)

@BacLuc BacLuc changed the title CampProgram; fix create activity CampProgram: fix create activity Nov 10, 2021
Copy link
Member

@manuelmeister manuelmeister left a comment

Choose a reason for hiding this comment

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

Cool, ich kann das sonst morgen versuchen.

#[ApiProperty(writable: false, example: '["/schedule_entries/1a2b3c4d"]')]
#[Groups(['read'])]
#[Assert\Valid]
#[ApiProperty(writableLink: true, example: '["/schedule_entries/1a2b3c4d"]')]
Copy link
Member

Choose a reason for hiding this comment

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

Das Example für OpenAPI solltest du noch anpassen, siehe Camp->$periods. Nur die required Felder würden mir reichen, sodass man einen Startpunkt zum Copy Pasten hat in Swagger.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

*/
#[ApiProperty(writable: false, example: '["/schedule_entries/1a2b3c4d"]')]
#[Groups(['read'])]
#[Assert\Valid]
Copy link
Member

Choose a reason for hiding this comment

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

Beim Camp habe ich noch eine Validierung #[Assert\Count(min: 1, groups: ['create'])], wäre hier wohl auch sinnvoll oder? Vorschlag von Forte war ja mal, beim Löschen des letzten ScheduleEntries wird auch die Activity gelöscht.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

With the changes made with api platform.
Also use period iri instead of id to filter activies in Picasso.vue.
Remove periodId from the payload and send period iri in DialogActivityCreate.vue.
Use category iri to reference the category in DialogActivityForm.vue.

Use cascade persist in the Activity Entity to persist created ScheduleEntries.
Checked with docker-compose exec php     bin/console doctrine:migrations:diff that no migration is necessary.
ScheduleEntry already has onDelete=cascade on the joincolumn.

Use $this->activity?->getCamp() instead of property access in ScheduleEntry
because when an activity is created, the camp is null (this is attached in the persister),
and Activity::getCamp returns the camp of the category.

Issue: ecamp#2029
Don't append "Id" to embedded entities
Use _meta.self as value instead of the object.

DialogBase for an edit dialog with embedded Entity is only used in DialogActivityEdit.vue.

Relates to ecamp#2198
Issue: ecamp#2029
Patch of an embedded collection did not work.
Relates to ecamp#2195

Issue: ecamp#2029
@carlobeltrame carlobeltrame merged commit a887b7f into ecamp:devel Nov 15, 2021
@BacLuc BacLuc deleted the campprogram-fix-create-activity branch November 22, 2021 13:35
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