-
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 pull request #694 from lblod/GN-4909-mandatee-sync
GN-4909: inauguration meeting synchronization support
- Loading branch information
Showing
31 changed files
with
1,351 additions
and
13 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': patch | ||
--- | ||
|
||
Update `@lblod/ember-rdfa-editor` to version 10.3.0 |
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 | ||
--- | ||
|
||
Addition of a generic `SimpleModal` component. This component is an extension of the `AuModal` component. It is less opinionated as the content can be completely configured (no predefined content). |
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 | ||
--- | ||
|
||
Addition of a basic meeting synchronization flow which allows users to synchronize an inauguration meeting with a configured LMB endpoint. |
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
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,30 @@ | ||
{{#if @modalOpen}} | ||
{{#in-element this.destinationElement insertBefore=null}} | ||
<div class='au-c-modal-backdrop {{if @modalOpen "is-visible"}}'></div> | ||
<div | ||
id='{{@id}}' | ||
class={{class-names | ||
'au-c-modal' | ||
this.size | ||
this.padding | ||
this.overflow | ||
(if @modalOpen 'is-visible') | ||
}} | ||
role='dialog' | ||
tabindex='-1' | ||
{{focus-trap | ||
isActive=@modalOpen | ||
additionalElements=this.additionalElements | ||
focusTrapOptions=(hash | ||
initialFocus=@initialFocus | ||
fallbackFocus=this.fallbackFocus | ||
escapeDeactivates=this.handleEscapePress | ||
allowOutsideClick=true | ||
) | ||
}} | ||
...attributes | ||
> | ||
{{yield}} | ||
</div> | ||
{{/in-element}} | ||
{{/if}} |
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,78 @@ | ||
/** | ||
* Based on https://github.com/appuniversum/ember-appuniversum/blob/3e2765ce76f4346876638f47e181aa69f193c401/addon/components/au-modal.gts | ||
* The MIT License (MIT) | ||
* Copyright (c) 2020 | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
|
||
const FOCUS_TRAP_ADDITIONAL_ELEMENTS = ['#ember-basic-dropdown-wormhole']; | ||
export default class SimpleModal extends Component { | ||
destinationElement; | ||
|
||
constructor(owner, args) { | ||
super(owner, args); | ||
|
||
this.destinationElement = document.querySelector( | ||
'[data-au-modal-container]', | ||
); | ||
} | ||
|
||
get size() { | ||
if (this.args.size === 'fullscreen') return 'au-c-modal--fullscreen'; | ||
if (this.args.size === 'large') return 'au-c-modal--large'; | ||
else return ''; | ||
} | ||
|
||
get padding() { | ||
if (this.args.padding === 'none') return 'au-c-modal--flush'; | ||
else return ''; | ||
} | ||
|
||
get overflow() { | ||
if (this.args.overflow) return 'au-c-modal--overflow'; | ||
else return ''; | ||
} | ||
|
||
get initialFocus() { | ||
return this.args.initialFocus; | ||
} | ||
|
||
get fallbackFocus() { | ||
return '.au-c-modal'; | ||
} | ||
|
||
get additionalElements() { | ||
return FOCUS_TRAP_ADDITIONAL_ELEMENTS.filter( | ||
(element) => document.querySelector(element) !== null, | ||
); | ||
} | ||
|
||
@action | ||
handleCloseClick() { | ||
if (this.isClosable) { | ||
this.closeModal(); | ||
} | ||
} | ||
|
||
@action | ||
handleEscapePress() { | ||
if (this.isClosable) { | ||
this.closeModal(); | ||
} | ||
|
||
// escapeDeactivates should be set to false since we don't want the focus-trap to deactivate if the modal stays open | ||
// which could happen if the consumer doesn't change the `@modalOpen` argument in the callback. | ||
return false; | ||
} | ||
|
||
@action | ||
closeModal() { | ||
this.args.closeModal?.(); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
app/components/inauguration-meeting/synchronization-toast.hbs
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,41 @@ | ||
{{#if @options.success}} | ||
<AuAlert | ||
@skin='success' | ||
@icon='check' | ||
@size='small' | ||
@closable={{true}} | ||
@onClose={{@close}} | ||
> | ||
<p class='au-u-medium'> | ||
{{t 'inauguration-meeting.synchronization.toast.success.title'}} | ||
</p> | ||
</AuAlert> | ||
{{else}} | ||
<AuAlert | ||
@skin='warning' | ||
@icon='alert-triangle' | ||
@size='small' | ||
@closable={{true}} | ||
@onClose={{@close}} | ||
> | ||
<p class='au-u-medium'>{{t | ||
'inauguration-meeting.synchronization.toast.failure.title' | ||
}}</p> | ||
<p> | ||
{{html-safe | ||
(t | ||
'inauguration-meeting.synchronization.toast.failure.body.paragraph-1' | ||
link=this.lmbEndpoint | ||
) | ||
}} | ||
</p> | ||
<p> | ||
{{html-safe | ||
(t | ||
'inauguration-meeting.synchronization.toast.failure.body.paragraph-2' | ||
email='[email protected]' | ||
) | ||
}} | ||
</p> | ||
</AuAlert> | ||
{{/if}} |
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,8 @@ | ||
import Component from '@glimmer/component'; | ||
import ENV from 'frontend-gelinkt-notuleren/config/environment'; | ||
|
||
export default class InaugurationMeetingSynchronizationToast extends Component { | ||
get lmbEndpoint() { | ||
return ENV.lmbEndpoint; | ||
} | ||
} |
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,73 @@ | ||
{{#if this.synchronizationStatus.value}} | ||
<AuButton | ||
@icon={{this.buttonIcon}} | ||
class={{this.buttonClass}} | ||
{{on 'click' this.openModal}} | ||
> | ||
{{this.synchronizationStatus.value.label}} | ||
</AuButton> | ||
{{/if}} | ||
<Common::SimpleModal @modalOpen={{this.modalOpen}} @closeModal={{this.cancel}}> | ||
<AuToolbar class='au-u-padding meeting__sync-modal__header' as |Group|> | ||
<Group> | ||
<AuHeading @level='1' @skin='2'> | ||
{{t 'inauguration-meeting.synchronization.modal.title'}} | ||
</AuHeading> | ||
</Group> | ||
<Group> | ||
<AuButton | ||
{{on 'click' this.cancel}} | ||
@skin='naked' | ||
@disabled={{this.synchronize.isRunning}} | ||
> | ||
{{t 'inauguration-meeting.synchronization.modal.actions.cancel'}} | ||
</AuButton> | ||
<AuButton | ||
{{on 'click' (perform this.synchronize)}} | ||
@icon='synchronize' | ||
@skin='primary' | ||
@loading={{this.synchronize.isRunning}} | ||
> | ||
{{t 'inauguration-meeting.synchronization.modal.actions.synchronize'}} | ||
</AuButton> | ||
</Group> | ||
</AuToolbar> | ||
|
||
<div class='au-u-padding au-o-flow--small'> | ||
<p>{{html-safe | ||
(t | ||
'inauguration-meeting.synchronization.modal.info.paragraph-1' | ||
link=this.lmbEndpoint | ||
) | ||
}}</p> | ||
<p>{{t 'inauguration-meeting.synchronization.modal.info.paragraph-2'}}</p> | ||
<AuHeading @level='2' @skin='5'> | ||
{{t 'inauguration-meeting.synchronization.modal.attendee-list.title'}} | ||
</AuHeading> | ||
<p class='au-u-italic'> | ||
{{t | ||
'inauguration-meeting.synchronization.modal.attendee-list.no-changes' | ||
}} | ||
</p> | ||
<AuHeading @level='2' @skin='5'> | ||
{{t 'inauguration-meeting.synchronization.modal.decisions.title'}} | ||
</AuHeading> | ||
{{#if this.treatments.isLoading}} | ||
<AuLoader @padding='small' /> | ||
<AuHelpText>{{t 'participation-list.loading-loader'}}</AuHelpText> | ||
{{else}} | ||
<ol class='meeting__sync-modal__treatments'> | ||
{{#each this.treatments.value as |treatment|}} | ||
<li class='meeting__sync-modal__treatments__entry'> | ||
<AuHeading @level='3' @skin='4'> | ||
{{limit-content treatment.onderwerp.titel 80}} | ||
</AuHeading> | ||
<AuPill @icon='alert-triangle' @skin='warning'> | ||
{{t 'behandeling-van-agendapunten.sync-warning'}} | ||
</AuPill> | ||
</li> | ||
{{/each}} | ||
</ol> | ||
{{/if}} | ||
</div> | ||
</Common::SimpleModal> |
Oops, something went wrong.