Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/regulatory statements #325

Merged
merged 48 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d6a2aab
bump @lblod/ember-rdfa-editor-citaten-plugin to 0.17.3
nvdk Jul 8, 2022
3ef47e4
added ember-rdfa-editor-table-of-contents-plugin
nvdk Jul 8, 2022
9810450
table of contents working pending plugin update
lagartoverde Jul 12, 2022
0d3351e
update article structure plugin
lagartoverde Jul 12, 2022
4f8f623
fix scroll issue on regulatory statements
Dietr Jul 12, 2022
816f490
update plugins
lagartoverde Jul 15, 2022
18a7720
add mockup of regulatory statements
Dietr Aug 12, 2022
ae8d8eb
add modal
Dietr Aug 12, 2022
7c53a74
prototype overview
Dietr Aug 16, 2022
dcf0c9c
add versions, reduce columns
Dietr Aug 16, 2022
b8bbcc0
design tweaks
Dietr Aug 25, 2022
01a09c4
bump caniuse browser definitions
Sep 12, 2022
a3985d5
regulatory statements overview: fetch data from backend
Sep 12, 2022
d164bb9
abstract document creator for reuse in regulatory statements
Sep 12, 2022
6cabc35
initial wiring of regulatory statements prototype
Sep 12, 2022
164b72e
Fetch templates from backend
lagartoverde Sep 13, 2022
c63dffb
it should work, needs testing
lagartoverde Sep 13, 2022
0769906
now working, needs a lot more features
lagartoverde Sep 16, 2022
40f8ae3
show view
lagartoverde Sep 16, 2022
726e3d9
add save
lagartoverde Sep 19, 2022
e836ed7
refactor(cleanup): replace var with const
abeforgit Sep 23, 2022
029561a
fix(rb-templates): use a regex that doesnt interpret variables
abeforgit Sep 23, 2022
dee04d4
chore(deps): bump editor and some plugins
abeforgit Sep 23, 2022
20c65f0
chore(deps): bump roadsign to last bugfix
abeforgit Sep 23, 2022
c8167c9
Merge pull request #326 from lblod/bug/fix-rb-integration
abeforgit Sep 23, 2022
32a00f2
Merge branch 'feature/regulatory-statements' into futurenow
nvdk Sep 26, 2022
24700f1
fix overview
nvdk Sep 27, 2022
10b0e73
remove log statement
nvdk Sep 27, 2022
d0ce44d
enable insert variable plugin
nvdk Sep 27, 2022
7aa37b9
fix label of title in creation form
nvdk Sep 27, 2022
26734d5
enable the proper plugins in GN for regulatory statements
nvdk Sep 28, 2022
b63842a
Merge branch 'master' of github.com:lblod/frontend-gelinkt-notuleren …
nvdk Sep 30, 2022
093a963
Filter based on valid through
lagartoverde Oct 4, 2022
60d110b
add dossier and say prefixes
elpoelma Oct 4, 2022
8f889a0
Changed query to make it more semantically correct, need testing when…
lagartoverde Oct 4, 2022
aa3cb19
update toc plugin which fixes issues with overflowing entries
elpoelma Oct 4, 2022
bf33d0b
add lblodgn prefix and lblodgn:ReglementaireBijlage uri
elpoelma Oct 4, 2022
7ee4f44
Merge branch 'master' into feature/regulatory-statements
nvdk Oct 5, 2022
689fa7c
Fixed typo in query
lagartoverde Oct 5, 2022
2494efc
Merge branch 'feature/regulatory-statements' into feature/filter-base…
abeforgit Oct 5, 2022
ffdd2a5
Merge pull request #333 from lblod/feature/filter-based-on-valid-thro…
abeforgit Oct 5, 2022
abc6776
Merge branch 'feature/regulatory-statements' into chore/bump-table-of…
abeforgit Oct 5, 2022
527b5ce
Merge pull request #334 from lblod/chore/bump-table-of-contents-plugin
abeforgit Oct 5, 2022
abd875c
chore(dx): add dev RB backends to dev environment setup
abeforgit Oct 5, 2022
eefbd86
Merge pull request #335 from lblod/chore/add-rb-endpoints-to-devenv
abeforgit Oct 5, 2022
e1928d9
fix(RS): fix default sorting, search and pagination for RS overview
abeforgit Oct 5, 2022
ce36083
fix(agendapoints): make the pagesize param actually do something
abeforgit Oct 5, 2022
170dc78
Merge pull request #336 from lblod/bug/sort-regulatory-statements
abeforgit Oct 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 58 additions & 0 deletions app/components/app-chrome-statement.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<nav>
<div class="au-c-app-chrome">
<AuToolbar @size="small" class="au-u-padding-bottom-none">
<AuToolbarGroup>
<AuLink @route={{@returnRoute}} @skin="secondary">
<AuIcon @icon="arrow-left" @alignment="left" />
{{@returnRouteText}}
</AuLink>
<span class="au-c-app-chrome__entity">{{this.currentSession.group.classificatie.label}} {{this.currentSession.group.naam}}</span>
</AuToolbarGroup>
<AuToolbarGroup>
<ul class="au-c-list-horizontal au-u-padding-right-tiny">
<li class="au-c-list-horizontal__item">
<span class="au-c-app-chrome__status">
Bewaard op 31-05-2022
</span>
</li>
</ul>
</AuToolbarGroup>
</AuToolbar>
<AuToolbar @size="small" class="au-u-padding-top-none">
<AuToolbarGroup>
<div>
<AuPill @skin="default">
Ontwerp
</AuPill>
</div>
<EditorDocumentTitle @title="Titel reglementaire bijlage" @editActive={{@editorDocument.isNew}} @onChange={{this.updateDocumentTitle}} @readOnly={{@readOnly}} />
</AuToolbarGroup>
<AuToolbarGroup>
<AuButtonGroup @inline={{true}} role="tablist" aria-label="editor-tabs">
<AuButton class="au-u-margin-bottom-none is-active" @skin="secondary" @icon="document" @iconAlignment="left" aria-selected="false" aria-controls="panel-1" id="tab-1" tabindex="0">
Document
</AuButton>
<AuButton class="au-u-margin-bottom-none" @skin="secondary" @icon="attachment" @iconAlignment="left" role="tab" aria-selected="true" aria-controls="panel-2" id="tab-2" tabindex="-1">
Versies (0)
</AuButton>
</AuButtonGroup>
<AuDropdown @title="Bestand acties" @buttonLabel="Bestand opties" @alignment="right">
<AuButton @skin="tertiary" role="menuitem">
<AuIcon @icon="copy" @alignment="left" />
Kopieer reglementaire bijlage
</AuButton>
<AuButton @skin="tertiary" role="menuitem">
<AuIcon @icon="export" @alignment="left" />
Exporteer als HTML
</AuButton>
<AuButton @skin="tertiary" @alert="true" role="menuitem">
<AuIcon @icon="bin" @alignment="left" />
Naar prullenmand
</AuButton>
</AuDropdown>

<AuButton>Bewaar</AuButton>
</AuToolbarGroup>
</AuToolbar>
</div>
</nav>
25 changes: 25 additions & 0 deletions app/components/app-chrome-statement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Component from '@glimmer/component';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';
import { DRAFT_STATUS_ID } from 'frontend-gelinkt-notuleren/utils/constants';

export default class AppChromeComponent extends Component {
@service currentSession;
@service features;

get documentStatus() {
const status = this.args.documentContainer?.get('status');
return status;
}

get isNotAllowedToTrash() {
return (
!this.documentStatus || this.documentStatus.get('id') != DRAFT_STATUS_ID
);
}

@action
updateDocumentTitle(title) {
this.args.editorDocument.title = title;
}
}
2 changes: 1 addition & 1 deletion app/components/document-creator.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
invalidTemplate=this.invalidTemplate
updateTitle=this.updateTitle
selectedTemplate=this.template
options=this.templateOptions
options=@templateOptions
onSelectTemplate=this.onSelectTemplate
)
create=this.create
Expand Down
28 changes: 6 additions & 22 deletions app/components/document-creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
import { task } from 'ember-concurrency';
import {
DRAFT_FOLDER_ID,
DRAFT_STATUS_ID,
} from 'frontend-gelinkt-notuleren/utils/constants';
import { DRAFT_STATUS_ID } from 'frontend-gelinkt-notuleren/utils/constants';
import instantiateUuids from '@lblod/ember-rdfa-editor-standard-template-plugin/utils/instantiate-uuids';

export default class DocumentCreatorComponent extends Component {
@tracked title = '';
@tracked type;
@tracked template;
@tracked templateOptions = [];
@tracked invalidTitle;
@tracked invalidTemplate;
@tracked errorSaving;
Expand All @@ -22,11 +18,6 @@ export default class DocumentCreatorComponent extends Component {
@service rdfaEditorStandardTemplatePlugin;
@service currentSession;

constructor() {
super(...arguments);
this.ensureTemplates.perform();
}

@action
rollback() {
this.title = '';
Expand Down Expand Up @@ -86,19 +77,12 @@ export default class DocumentCreatorComponent extends Component {
}
}

@task
*ensureTemplates() {
const templates =
yield this.rdfaEditorStandardTemplatePlugin.fetchTemplates.perform();
this.templateOptions =
this.rdfaEditorStandardTemplatePlugin.templatesForContext(templates, [
'http://data.vlaanderen.be/ns/besluit#BehandelingVanAgendapunt',
]);
}

async buildTemplate() {
if (this.template) {
await this.template.reload(); // templatesForContext does not return body of template
if (this.template.reload) {
// regular templates from templatesForContext do not return body of template
await this.template.reload(this.template);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aah but here's the fun part
template is not an ember-data model here
look at the RegulatoryAttachmentsFetcher service
it makes a raw sparql request and from the bindings it creates an object which does have a reload method that takes an argument

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes sorry, forgot about this comment, basically I wanted to make it compatible with the old document creator and it was the best way I came up with

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone has a better idea feel free to suggest it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but, why? we already check if the object has a reload function and only execute reload then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I need a hook to fetch the template content, so I don't fetch all the contents before the user selects the one he wants to use.

}
return instantiateUuids(this.template.body);
} else return '';
}
Expand All @@ -123,7 +107,7 @@ export default class DocumentCreatorComponent extends Component {
);
container.folder = yield this.store.findRecord(
'editor-document-folder',
DRAFT_FOLDER_ID
this.args.folderId
);
container.publisher = this.currentSession.group;
container.currentVersion = editorDocument;
Expand Down
1 change: 0 additions & 1 deletion app/components/meeting-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export default class MeetingForm extends Component {
);
this.headerArticleTranslationString =
articlesBasedOnClassifcationMap[classification.get('uri')];
console.log(this.headerArticleTranslationString);
this.secretaris = yield this.zitting.get('secretaris');
this.voorzitter = yield this.zitting.get('voorzitter');
yield this.fetchParticipants.perform();
Expand Down
1 change: 0 additions & 1 deletion app/components/signatures/publication-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export default class SignaturesPublicationStatus extends Component {
@tracked ready = false;
@action
async loadResource() {
console.log(this.args.versionedResource.get('signedResources'));
this.signedResources =
(await this.args.versionedResource.get('signedResources')) || [];
this.publishedResource = await this.args.versionedResource.get(
Expand Down
16 changes: 16 additions & 0 deletions app/config/constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
export const EDITOR_FOLDERS = {
IRG_ARCHIVE: '17b39ab5-9da6-42fd-8568-2b1a848cd21c',
DECISION_DRAFTS: 'ae5feaed-7b70-4533-9417-10fbbc480a4c',
REGULATORY_STATEMENTS: 'd80d06d2-8fc2-4b12-821f-e88b2f035a44',
TRASH: '5A8304E8C093B00009000010',
};

export const PLUGIN_CONFIGS = {
TABLE_OF_CONTENTS: [
{
sectionPredicate: 'https://say.data.gift/ns/hasPart',
value: {
predicate: 'https://say.data.gift/ns/heading',
},
},
{
sectionPredicate: 'https://say.data.gift/ns/hasParagraph',
value: '§',
},
],
};
7 changes: 7 additions & 0 deletions app/controllers/inbox/agendapoints/new.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
import { EDITOR_FOLDERS } from 'frontend-gelinkt-notuleren/config/constants';

export default class InboxAgendapointsNewController extends Controller {
@service router;
@service plausible;

folderId = EDITOR_FOLDERS.DECISION_DRAFTS;

@action
redirectToAgendapoint(container, chosenTemplate) {
// Plausible Analytics: post custom event about the template used to create the agendapoint
Expand All @@ -19,4 +22,8 @@ export default class InboxAgendapointsNewController extends Controller {
cancelAgendapointCreation() {
this.router.transitionTo('inbox.agendapoints');
}

get templateOptions() {
return this.model;
}
}
29 changes: 29 additions & 0 deletions app/controllers/inbox/regulatory-statements/new.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';
import { EDITOR_FOLDERS } from 'frontend-gelinkt-notuleren/config/constants';

export default class InboxRegulatoryStatementsNewController extends Controller {
@service router;
@service plausible;

folderId = EDITOR_FOLDERS.REGULATORY_STATEMENTS;

@action
redirectToStatement(container, chosenTemplate) {
// Plausible Analytics: post custom event about the template used to create the agendapoint
this.plausible.trackEvent('Create regulatory-statement', {
templateTitle: chosenTemplate.title,
});
this.router.transitionTo('regulatory-statements.edit', container.id);
}

@action
cancelCreation() {
this.router.transitionTo('inbox.regulatory-statements');
}

get templateOptions() {
return this.model;
}
}
21 changes: 21 additions & 0 deletions app/controllers/regulatory-statements/edit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { PLUGIN_CONFIGS } from 'frontend-gelinkt-notuleren/config/constants';

export default class RegulatoryStatementsRoute extends Controller {
plugins = [
'article-structure',
{ name: 'rdfa-toc', options: { config: PLUGIN_CONFIGS.TABLE_OF_CONTENTS } },
];

@action
rdfaEditorInit(controller) {
controller.executeCommand(
'insert-component',
'inline-components/table-of-contents',
{},
{},
false
);
}
}
6 changes: 6 additions & 0 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Router.map(function () {
this.route('agendapoints', function () {
this.route('new');
});
this.route('regulatory-statements', function () {
this.route('new');
});
this.route('meetings', function () {
this.route('new');
});
Expand Down Expand Up @@ -64,4 +67,7 @@ Router.map(function () {
this.route('irg-archive', function () {
this.route('show', { path: ':id' });
});
this.route('regulatory-statements', function () {
this.route('edit', { path: ':id' });
});
});
10 changes: 10 additions & 0 deletions app/routes/inbox/agendapoints/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@ import { inject as service } from '@ember/service';
export default class InboxAgendapointsNewRoute extends Route {
@service currentSession;
@service router;
@service rdfaEditorStandardTemplatePlugin;

beforeModel() {
if (!this.currentSession.canWrite) {
this.router.replaceWith('inbox.agendapoints');
}
}

async model() {
const templates =
await this.rdfaEditorStandardTemplatePlugin.fetchTemplates.perform();
return this.rdfaEditorStandardTemplatePlugin.templatesForContext(
templates,
['http://data.vlaanderen.be/ns/besluit#BehandelingVanAgendapunt']
);
}
}
28 changes: 28 additions & 0 deletions app/routes/inbox/regulatory-statements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Route from '@ember/routing/route';
import { EDITOR_FOLDERS } from '../../config/constants';
import { inject as service } from '@ember/service';

export default class InboxRegulatoryStatementsRoute extends Route {
@service store;

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

async model(params) {
const options = {
sort: params.sort,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this view should sort on date created by default
https://binnenland.atlassian.net/browse/GN-3735 tracked here if too much work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include: 'status,current-version',
'filter[folder][:id:]': EDITOR_FOLDERS.REGULATORY_STATEMENTS,
page: {
number: params.page,
},
};
if (params.filter) {
options['filter[current-version][title]'] = params.filter;
}
return this.store.query('document-container', options);
}
}
19 changes: 19 additions & 0 deletions app/routes/inbox/regulatory-statements/new.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class InboxRegulatoryStatementsNewRoute extends Route {
@service currentSession;
@service router;
@service regulatoryAttachmentsFetcher;

beforeModel() {
if (!this.currentSession.canWrite) {
this.router.replaceWith('inbox.regulatory-statements');
}
}

async model() {
const templates = await this.regulatoryAttachmentsFetcher.fetch.perform();
return templates;
}
}
1 change: 0 additions & 1 deletion app/routes/meetings/publish/uittreksels/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default class MeetingsPublishUittrekselsRoute extends Route.extend(
};

mergeQueryOptions(params) {
console.log(params);
const query = {
include: 'behandeling.versioned-behandeling',
filter: { zitting: { ':id:': this.meetingId } },
Expand Down