Skip to content

Commit

Permalink
Merge branch 'master' into feat/config-per-admin-unit
Browse files Browse the repository at this point in the history
  • Loading branch information
lagartoverde authored Dec 5, 2024
2 parents cbadf05 + 6204440 commit 847e77d
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 50 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-moons-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'frontend-gelinkt-notuleren': patch
---

Wrap downloaded docs for correct uf8
5 changes: 5 additions & 0 deletions .changeset/two-walls-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'frontend-gelinkt-notuleren': patch
---

Update the date time picker to use the au time picker
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# frontend-gelinkt-notuleren

## 5.44.1

### Patch Changes

- [`b92513e`](https://github.com/lblod/frontend-gelinkt-notuleren/commit/b92513eea5a3afec6d230f86fb54d2ccdcd75115) Thanks [@elpoelma](https://github.com/elpoelma)! - Revert accidental `shouldEditRdfa` change

## 5.44.0

### Minor Changes
Expand Down
36 changes: 11 additions & 25 deletions app/components/date-time-picker.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,16 @@
/>
{{/let}}
</div>
<div class='au-o-grid__item au-u-1-5 au-u-1-6@small'>
{{#let (unique-id) as |id|}}
<AuLabel for={{id}}>{{t 'date-time-picker.hours'}}</AuLabel>
<Input
class='au-c-input au-c-input--block'
@type='number'
{{on 'input' (fn this.onChangeTime 'hours')}}
@value={{this.hours}}
max={{24}}
id={{id}}
/>
{{/let}}
</div>
<div class='au-o-grid__item au-u-1-5 au-u-1-6@small'>
{{#let (unique-id) as |id|}}
<AuLabel for={{id}}>{{t 'date-time-picker.minutes'}}</AuLabel>
<Input
class='au-c-input au-c-input--block'
@type='number'
{{on 'input' (fn this.onChangeTime 'minutes')}}
@value={{this.minutes}}
max={{60}}
id={{id}}
/>
{{/let}}
<div class='au-o-grid__item au-u-2-5 au-u-2-6@small'>
<AuTimePicker
@hoursLabel={{t 'date-time-picker.hours'}}
@minutesLabel={{t 'date-time-picker.minutes'}}
@nowLabel={{t 'date-plugin.card.now'}}
@hours={{this.hours}}
@minutes={{this.minutes}}
@showSeconds={{false}}
@showNow={{false}}
@onChange={{this.onChangeTime}}
/>
</div>
</div>
17 changes: 5 additions & 12 deletions app/components/date-time-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,11 @@ export default class DateTimePicker extends Component {
}

@action
onChangeTime(type, event) {
const value = event.target.value;
if (!this.date) {
this.date = new Date();
}
if (type === 'hours') {
if (value < 0 || value > 24) return;
this.date.setHours(value);
} else {
if (value < 0 || value > 60) return;
this.date.setMinutes(value);
}
onChangeTime(timeObject) {
if (!this.date) this.date = new Date();
this.date.setHours(timeObject.hours);
this.date.setMinutes(timeObject.minutes);
this.date.setSeconds(timeObject.seconds);
this.args.onChange(this.date);
}
}
Expand Down
19 changes: 11 additions & 8 deletions app/components/download-meeting-part.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ import { on } from '@ember/modifier';
import { task } from 'ember-concurrency';
import perform from 'ember-concurrency/helpers/perform';
import { generateExportTextFromEditorDocument } from 'frontend-gelinkt-notuleren/utils/generate-export-from-editor-document';
import { wrapDownloadedDocument } from 'frontend-gelinkt-notuleren/utils/wrap-downloaded-document';

export default class DownloadMeetingComponent extends Component {
export default class DownloadMeetingPartComponent extends Component {
@service publish;
@service intl;

get buttonSkin() {
return this.args.buttonSkin || 'link';
}
get icon() {
return this.downloadMeeting.last?.isSuccessful
return this.downloadMeetingPart.last?.isSuccessful
? 'circle-check'
: this.args.icon;
}
Expand All @@ -29,7 +30,7 @@ export default class DownloadMeetingComponent extends Component {
);
}

downloadMeeting = task(async () => {
downloadMeetingPart = task(async () => {
let route = `/prepublish/${this.args.documentType}`;
let html;
switch (this.args.documentType) {
Expand Down Expand Up @@ -59,7 +60,9 @@ export default class DownloadMeetingComponent extends Component {
if (this.args.callback) {
return this.args.callback(html);
} else {
const file = new Blob([html], { type: 'text/html' });
const file = new Blob([wrapDownloadedDocument(html)], {
type: 'text/html',
});
const linkElement = document.createElement('a');
linkElement.href = URL.createObjectURL(file);
linkElement.download = `${this.args.documentType}.html`;
Expand Down Expand Up @@ -109,15 +112,15 @@ export default class DownloadMeetingComponent extends Component {
<AuButton
@skin={{this.buttonSkin}}
@icon={{this.icon}}
@loading={{this.downloadMeeting.isRunning}}
@loading={{this.downloadMeetingPart.isRunning}}
@loadingMessage={{this.loadingText}}
class={{if
this.downloadMeeting.last.isSuccessful
this.downloadMeetingPart.last.isSuccessful
'download-meeting-part-downloaded'
}}
{{on 'click' (perform this.downloadMeeting)}}
{{on 'click' (perform this.downloadMeetingPart)}}
>
{{#if this.downloadMeeting.last.isSuccessful}}
{{#if this.downloadMeetingPart.last.isSuccessful}}
{{this.completedText}}
{{else}}
{{this.buttonText}}
Expand Down
5 changes: 4 additions & 1 deletion app/controllers/meetings/download/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { restartableTask, task } from 'ember-concurrency';
import { trackedTask } from 'reactiveweb/ember-concurrency';
import InstallatieVergaderingModel from 'frontend-gelinkt-notuleren/models/installatievergadering';
import { service } from '@ember/service';
import { wrapDownloadedDocument } from '../../../utils/wrap-downloaded-document';

export default class MeetingsDownloadController extends Controller {
@service publish;
Expand Down Expand Up @@ -53,7 +54,9 @@ export default class MeetingsDownloadController extends Controller {
});

downloadHtml(html, documentName) {
const file = new Blob([html], { type: 'text/html' });
const file = new Blob([wrapDownloadedDocument(html)], {
type: 'text/html',
});
const linkElement = document.createElement('a');
linkElement.href = URL.createObjectURL(file);
linkElement.download = `${documentName}.html`;
Expand Down
2 changes: 1 addition & 1 deletion app/templates/agendapoints/edit.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
@widgets={{this.widgets}}
@nodeViews={{this.nodeViews}}
@plugins={{this.plugins}}
@shouldEditRdfa={{true}}
@shouldEditRdfa={{false}}
@shouldShowRdfa={{true}}
>
<:toolbar>
Expand Down
14 changes: 14 additions & 0 deletions app/utils/wrap-downloaded-document.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export function wrapDownloadedDocument(html) {
const document = `
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
${html}
</body>
</html>
`;
return document;
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend-gelinkt-notuleren",
"version": "5.44.0",
"version": "5.44.1",
"private": true,
"description": "Ember frontend of the Gelinkt Notuleren application",
"repository": {
Expand Down

0 comments on commit 847e77d

Please sign in to comment.