-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into GN-4937-snippet-previews
- Loading branch information
Showing
8 changed files
with
145 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'frontend-gelinkt-notuleren': minor | ||
--- | ||
|
||
Add meeting details modal to inauguration-meeting creation flow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,71 @@ | ||
import Route from '@ember/routing/route'; | ||
import { service } from '@ember/service'; | ||
import { format } from 'date-fns/fp'; | ||
|
||
export default class InboxMeetingsNewRoute extends Route { | ||
@service currentSession; | ||
@service router; | ||
@service store; | ||
|
||
queryParams = { | ||
type: { | ||
refreshModel: true, | ||
}, | ||
}; | ||
|
||
beforeModel() { | ||
if (!this.currentSession.canWrite) { | ||
this.router.replaceWith('inbox.meetings'); | ||
} | ||
} | ||
|
||
model() { | ||
model(params) { | ||
const type = params.type; | ||
switch (type) { | ||
case 'common': | ||
return this.createCommonMeeting(); | ||
case 'inauguration-meeting': | ||
return this.createInaugurationMeeting(); | ||
} | ||
} | ||
|
||
async createCommonMeeting() { | ||
let now = new Date(); | ||
return this.store.createRecord('zitting', { | ||
geplandeStart: now, | ||
gestartOpTijdstip: now, | ||
}); | ||
} | ||
|
||
async createInaugurationMeeting() { | ||
let now = new Date(); | ||
const bestuursorgaan = ( | ||
await this.store.query('bestuursorgaan', { | ||
include: [ | ||
'is-tijdsspecialisatie-van.bestuurseenheid', | ||
'is-tijdsspecialisatie-van.classificatie', | ||
].join(','), | ||
filter: { | ||
':or:': { | ||
':gte:binding-einde': format('yyyy-mm-dd')(now), | ||
':has-no:binding-einde': true, | ||
}, | ||
'is-tijdsspecialisatie-van': { | ||
bestuurseenheid: { | ||
id: this.currentSession.group.id, | ||
}, | ||
classificatie: { | ||
':uri:': | ||
'http://data.vlaanderen.be/id/concept/BestuursorgaanClassificatieCode/5ab0e9b8a3b2ca7c5e000005', | ||
}, | ||
}, | ||
}, | ||
}) | ||
)[0]; | ||
return this.store.createRecord('installatievergadering', { | ||
geplandeStart: now, | ||
gestartOpTijdstip: now, | ||
bestuursorgaan, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.