Skip to content

Commit

Permalink
Merge pull request #288 from lblod/bug/irg-archive
Browse files Browse the repository at this point in the history
fixed linting, fixed nan on archive pagination, fixed filtering, fixed return link
  • Loading branch information
nvdk authored Jun 16, 2022
2 parents cd6a872 + f146c70 commit c37ea12
Show file tree
Hide file tree
Showing 10 changed files with 469 additions and 450 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 = '';
}
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);
}
}
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
Loading

0 comments on commit c37ea12

Please sign in to comment.