Skip to content

Commit

Permalink
Merge branch 'development' of github.com:lblod/frontend-gelinkt-notul…
Browse files Browse the repository at this point in the history
…eren
  • Loading branch information
nvdk committed Jun 17, 2022
2 parents ce073aa + 6e4199f commit ab39fd5
Show file tree
Hide file tree
Showing 14 changed files with 4,325 additions and 2,987 deletions.
4 changes: 2 additions & 2 deletions app/components/app-chrome.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<div class="au-c-app-chrome">
<AuToolbar @size="small" class="au-u-padding-bottom-none">
<AuToolbarGroup>
<AuLink @route="inbox.agendapoints" @skin="secondary">
<AuLink @route={{@returnRoute}} @skin="secondary">
<AuIcon @icon="arrow-left" @alignment="left" />
Terug naar overzicht agendapunten
{{@returnRouteText}}
</AuLink>
<span class="au-c-app-chrome__entity">{{this.currentSession.group.classificatie.label}} {{this.currentSession.group.naam}}</span>
</AuToolbarGroup>
Expand Down
8 changes: 8 additions & 0 deletions app/controllers/inbox/irg-archive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';

export default class InboxIrgArchiveController extends Controller {
@tracked page = 0;
@tracked size = 10;
@tracked filter = '';
}
27 changes: 17 additions & 10 deletions app/controllers/meetings/publish/notulen.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default class MeetingsPublishNotulenController extends Controller {
behandelingContainerId = 'behandeling-van-agendapunten-container';
@tracked notulen;
@tracked errors;
@tracked validationErrors;
@tracked signedResources = [];
@tracked publishedResource;
@tracked publicBehandelingUris = [];
Expand All @@ -28,6 +29,7 @@ export default class MeetingsPublishNotulenController extends Controller {
resetController() {
this.notulen = null;
this.errors = null;
this.validationErrors = null;
this.signedResources = [];
this.publishedResource = null;
this.publicBehandelingUris = [];
Expand Down Expand Up @@ -84,16 +86,21 @@ export default class MeetingsPublishNotulenController extends Controller {
})
);
} else {
const { content, errors } =
yield this.createPrePublishedResource.perform();
const rslt = yield this.store.createRecord('versioned-notulen', {
zitting: this.model,
content: content,
});
this.publishedResource = undefined;
this.signedResources = [];
this.notulen = rslt;
this.errors = errors;
try {
const { content, errors } =
yield this.createPrePublishedResource.perform();
const rslt = yield this.store.createRecord('versioned-notulen', {
zitting: this.model,
content: content,
});
this.publishedResource = undefined;
this.signedResources = [];
this.notulen = rslt;
this.validationErrors = errors;
} catch (e) {
console.error(e);
this.errors = [e];
}
}
if (this.status !== 'published') {
const treatments = yield this.fetchTreatments.perform();
Expand Down
10 changes: 5 additions & 5 deletions app/routes/inbox/irg-archive.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';
import { EDITOR_FOLDERS } from '../../config/constants';

export default class InboxIrgArchiveRoute extends Route {
@service store;

queryParams = {
filter: { refreshModel: true },
page: { refreshModel: true },
sort: { refreshModel: true },
title: { refreshModel: true },
};

async model(params) {
Expand All @@ -19,10 +20,9 @@ export default class InboxIrgArchiveRoute extends Route {
number: params.page,
},
};
if (params.filter) {
options['filter[current-version][title]'] = params.filter;
if (params.title) {
options['filter[current-version][title]'] = params.title;
}
const result = await this.store.query('document-container', options);
return result;
return this.store.query('document-container', options);
}
}
5 changes: 3 additions & 2 deletions app/services/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ export default class PublishService extends Service {
} while (resp.status === 404 && maxIterations > 0);

if (resp.status !== 200) {
let errors = yield resp.text();
let errors;
try {
const json = yield resp.json();
if (json?.errors) {
errors = JSON.stringify(json.errors);
errors = json.errors[0]?.title || JSON.stringify(json.errors);
}
} catch (e) {
// throwing body text
errors = yield resp.text();
throw new Error(errors);
}
// throwing stringified json body
Expand Down
2 changes: 2 additions & 0 deletions app/templates/agendapoints/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
@uploading={{this.uploading}}
@toggleUpload={{this.toggleUpload}}
@toggleUploadAndSave={{this.toggleUploadAndSave}}
@returnRoute="inbox.agendapoints"
@returnRouteText={{t 'inbox.agendapoints.return'}}
/>

{{#if this.hasDocumentValidationErrors}}
Expand Down
2 changes: 2 additions & 0 deletions app/templates/agendapoints/show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
@exportHtmlFunction={{this.download}}
@readOnly={{true}}
@copyAgendapunt={{if this.readOnly undefined (perform this.copyAgendapunt)}}
@returnRoute="inbox.agendapoints"
@returnRouteText={{t 'inbox.agendapoints.return'}}
/>

<div class="au-c-body-container">
Expand Down
3 changes: 2 additions & 1 deletion app/templates/inbox/irg-archive.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{page-title (t "inbox.irgArchive.pageTitle")}}

<AuDataTable @content={{this.model}} @isLoading={{this.isLoadingModel}} @noDataMessage='' @sort={{this.sort}} @page={{this.page}} @size={{this.size}} as |table|>
<table.menu as |menu|>
<menu.general>
Expand All @@ -22,7 +23,7 @@
</c.header>
<c.body as |container|>
<td>
<LinkTo @route="irg-archive.show" @model={{container.id}}>{{container.currentVersion.title}}</LinkTo>
<AuLink @route="irg-archive.show" @model={{container.id}}>{{container.currentVersion.title}}</AuLink>
</td>
<td>
{{container.currentVersion.type.label}}
Expand Down
2 changes: 2 additions & 0 deletions app/templates/irg-archive/show.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
@documentContainer={{this.model.documentContainer}}
@exportHtmlFunction={{this.download}}
@readOnly={{true}}
@returnRoute="inbox.irg-archive"
@returnRouteText={{t 'inbox.irgArchive.return'}}
/>

<div class="au-c-body-container">
Expand Down
9 changes: 7 additions & 2 deletions app/templates/meetings/publish/notulen.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@
{{/in-element}}
{{/if}}
</PublicationPreview>
{{#if (and this.errors this.errors.length)}}
{{#if (and this.validationErrors this.validationErrors.length)}}
<AuAlert @alertIcon="alert-triangle" @alertTitle={{t "timelineStep.publishWarning"}} @alertSkin="error">
<ul>
{{#each this.errors as |error|}}
{{#each this.validationErrors as |error|}}
<li>{{error}}</li>
{{/each}}
</ul>
</AuAlert>
{{else if (and this.errors this.errors.length)}}
<AuAlert @alertIcon="alert-triangle" @alertSkin="error">
<p>{{t 'publish.seriousError'}}</p>
<code>{{this.errors.firstObject}}</code>
</AuAlert>
{{else}}
{{!-- Sign --}}
<PublicationSignatures
Expand Down
Loading

0 comments on commit ab39fd5

Please sign in to comment.