Skip to content

Commit

Permalink
add a warning to attachment overview if no decisions were found (#205)
Browse files Browse the repository at this point in the history
* add a warning to attachment overview if no decisions were found

* linter prefers unless over if not

* change position of alert

* fix typo

Co-authored-by: Dieter Peirs <github@dieterpeirs.com>
  • Loading branch information
nvdk and Dietr committed Oct 6, 2021
1 parent 7090d75 commit b312c83
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/components/document-attachments.hbs
@@ -1,4 +1,4 @@
<div class="au-o-box au-c-theme-gray-200">
<div class="au-o-box au-o-box--small au-c-theme-gray-200">
<AuFileUpload @title={{t "attachments.attach" }} @helpTextDragDrop={{t "attachments.drag" }} @modelName={{"file"}}
@endPoint={{"/files"}} @onFinishUpload={{perform this.uploadedAttachement}} @maxFileSizeMB="1024"
@multiple={{true}} />
Expand Down Expand Up @@ -50,3 +50,11 @@
</div>
</div>
{{/if}}

{{#unless @decisions.length}}
<AuToolbar @border="top" @nowrap="true" @size="small">
<AuAlert @alertIcon="alert-triangle" @alertTitle={{t "attachments.noDecisionsFound"}} @alertskin="warning" class="au-u-margin-bottom-none au-u-1-1">
<p>{{t "attachments.decisionRequired"}}</p>
</AuAlert>
</AuToolbar>
{{/unless}}
2 changes: 2 additions & 0 deletions translations/en-us.yaml
Expand Up @@ -364,6 +364,8 @@ attachments:
typePlaceholder: none
regulatory: regulatory
saveAndGo: Save and go to attachments
noDecisionsFound: No decisions found
decisionRequired: Only attachments linked to a decision are included in the publication.
documentCreator:
titleField: Agendapoint title
template: Template
Expand Down
2 changes: 2 additions & 0 deletions translations/nl-BE.yaml
Expand Up @@ -363,6 +363,8 @@ attachments:
typePlaceholder: geen
regulatory: regelgevend
saveAndGo: Opslaan en bijlagen toevoegen
noDecisionsFound: Geen besluiten gevonden
decisionRequired: Enkel bijlagen bij een besluit worden opgenomen in de publicatie.
documentCreator:
titleField: Titel agendapunt
template: Sjabloon
Expand Down

0 comments on commit b312c83

Please sign in to comment.