-
Notifications
You must be signed in to change notification settings - Fork 2
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
Changes from all 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 3ef47e4
added ember-rdfa-editor-table-of-contents-plugin
nvdk 9810450
table of contents working pending plugin update
lagartoverde 0d3351e
update article structure plugin
lagartoverde 4f8f623
fix scroll issue on regulatory statements
Dietr 816f490
update plugins
lagartoverde 18a7720
add mockup of regulatory statements
Dietr ae8d8eb
add modal
Dietr 7c53a74
prototype overview
Dietr dcf0c9c
add versions, reduce columns
Dietr b8bbcc0
design tweaks
Dietr 01a09c4
bump caniuse browser definitions
a3985d5
regulatory statements overview: fetch data from backend
d164bb9
abstract document creator for reuse in regulatory statements
6cabc35
initial wiring of regulatory statements prototype
164b72e
Fetch templates from backend
lagartoverde c63dffb
it should work, needs testing
lagartoverde 0769906
now working, needs a lot more features
lagartoverde 40f8ae3
show view
lagartoverde 726e3d9
add save
lagartoverde e836ed7
refactor(cleanup): replace var with const
abeforgit 029561a
fix(rb-templates): use a regex that doesnt interpret variables
abeforgit dee04d4
chore(deps): bump editor and some plugins
abeforgit 20c65f0
chore(deps): bump roadsign to last bugfix
abeforgit c8167c9
Merge pull request #326 from lblod/bug/fix-rb-integration
abeforgit 32a00f2
Merge branch 'feature/regulatory-statements' into futurenow
nvdk 24700f1
fix overview
nvdk 10b0e73
remove log statement
nvdk d0ce44d
enable insert variable plugin
nvdk 7aa37b9
fix label of title in creation form
nvdk 26734d5
enable the proper plugins in GN for regulatory statements
nvdk b63842a
Merge branch 'master' of github.com:lblod/frontend-gelinkt-notuleren …
nvdk 093a963
Filter based on valid through
lagartoverde 60d110b
add dossier and say prefixes
elpoelma 8f889a0
Changed query to make it more semantically correct, need testing when…
lagartoverde aa3cb19
update toc plugin which fixes issues with overflowing entries
elpoelma bf33d0b
add lblodgn prefix and lblodgn:ReglementaireBijlage uri
elpoelma 7ee4f44
Merge branch 'master' into feature/regulatory-statements
nvdk 689fa7c
Fixed typo in query
lagartoverde 2494efc
Merge branch 'feature/regulatory-statements' into feature/filter-base…
abeforgit ffdd2a5
Merge pull request #333 from lblod/feature/filter-based-on-valid-thro…
abeforgit abc6776
Merge branch 'feature/regulatory-statements' into chore/bump-table-of…
abeforgit 527b5ce
Merge pull request #334 from lblod/chore/bump-table-of-contents-plugin
abeforgit abd875c
chore(dx): add dev RB backends to dev environment setup
abeforgit eefbd86
Merge pull request #335 from lblod/chore/add-rb-endpoints-to-devenv
abeforgit e1928d9
fix(RS): fix default sorting, search and pagination for RS overview
abeforgit ce36083
fix(agendapoints): make the pagesize param actually do something
abeforgit 170dc78
Merge pull request #336 from lblod/bug/sort-regulatory-statements
abeforgit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,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> |
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,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; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -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: '§', | ||
}, | ||
], | ||
}; |
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,28 @@ | ||
import Controller from '@ember/controller'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { inject as service } from '@ember/service'; | ||
import { restartableTask, timeout } from 'ember-concurrency'; | ||
|
||
export default class InboxRegulatoryStatementsController extends Controller { | ||
@tracked page = 0; | ||
@tracked pageSize = 20; | ||
@tracked filter = ''; | ||
@tracked searchValue = this.filter; | ||
@tracked debounceTime = 2000; | ||
|
||
@service currentSession; | ||
@service router; | ||
sort = '-current-version.updated-on'; | ||
|
||
@restartableTask | ||
*updateFilter(event) { | ||
this.searchValue = event.target.value; | ||
yield timeout(this.debounceTime); | ||
this.filter = this.searchValue; | ||
this.page = 0; | ||
} | ||
|
||
get readOnly() { | ||
return !this.currentSession.canWrite && this.currentSession.canRead; | ||
} | ||
} |
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,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; | ||
} | ||
} |
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,56 @@ | ||
import Controller from '@ember/controller'; | ||
import { action } from '@ember/object'; | ||
import { PLUGIN_CONFIGS } from 'frontend-gelinkt-notuleren/config/constants'; | ||
import { task } from 'ember-concurrency'; | ||
|
||
export default class RegulatoryStatementsRoute extends Controller { | ||
editor; | ||
plugins = [ | ||
'article-structure', | ||
{ name: 'rdfa-toc', options: { config: PLUGIN_CONFIGS.TABLE_OF_CONTENTS } }, | ||
'template-variable', | ||
'rdfa-date', | ||
'import-snippet', | ||
'citaten-plugin', | ||
]; | ||
|
||
get dirty() { | ||
return this.editorDocument.content !== this.editor.htmlContent; | ||
} | ||
|
||
get editorDocument() { | ||
return this._editorDocument || this.model.editorDocument; | ||
} | ||
|
||
get documentContainer() { | ||
return this.model.documentContainer; | ||
} | ||
|
||
@task | ||
*saveTask() { | ||
if (!this.editorDocument.title) { | ||
this.hasDocumentValidationErrors = true; | ||
} else { | ||
this.hasDocumentValidationErrors = false; | ||
const html = this.editor.htmlContent; | ||
const editorDocument = this.store.createRecord('editor-document'); | ||
editorDocument.content = html; | ||
editorDocument.createdOn = new Date(); | ||
editorDocument.updatedOn = new Date(); | ||
editorDocument.title = this.editorDocument.title; | ||
editorDocument.previousVersion = this.editorDocument; | ||
yield editorDocument.save(); | ||
this._editorDocument = editorDocument; | ||
|
||
const documentContainer = this.documentContainer; | ||
documentContainer.currentVersion = editorDocument; | ||
yield documentContainer.save(); | ||
} | ||
} | ||
|
||
@action | ||
handleRdfaEditorInit(controller) { | ||
controller.setHtmlContent(this.editorDocument.content); | ||
this.editor = controller; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is odd, reload doesn't require a param afaik:
https://api.emberjs.com/ember-data/3.28/classes/Model/methods/reload?anchor=reload
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.