Skip to content

Commit 74a703b

Browse files
Bugfixes v2.6.0 (#196)
* Restrict ICR editing to ABB and DV (#190) * Restrict ICR editing to ABB and DV * Only show pencil icon when able to edit * Fix process attachments not loading correctly (#191) * Update contact email on table error * Fix bug where attachments didn't load correctly * Dynamically update information asset breadcrumb (#192) * Get rid of information asset page back button * Dynamically set icr breadcrumb based on previous page * Update routing structure information assets * Update capitals on homepage * Restrict ICR editing to ABB and DV (#190) * Restrict ICR editing to ABB and DV * Only show pencil icon when able to edit * Fix process attachments not loading correctly (#191) * Update contact email on table error * Fix bug where attachments didn't load correctly * Merge remote-tracking branch 'origin/feature/v2.6.0-bugfixes' into feature/fix-icr-breadcrumb * Enlarge information asset description input field (#193) * Enlarge information asset description input field * Show newlines for description * Fix linting error * Restrict ICR editing to ABB and DV (#190) * Restrict ICR editing to ABB and DV * Only show pencil icon when able to edit * Fix process attachments not loading correctly (#191) * Update contact email on table error * Fix bug where attachments didn't load correctly * Dynamically update information asset breadcrumb (#192) * Get rid of information asset page back button * Dynamically set icr breadcrumb based on previous page * Update routing structure information assets * Update capitals on homepage * Restrict ICR editing to ABB and DV (#190) * Restrict ICR editing to ABB and DV * Only show pencil icon when able to edit * Fix process attachments not loading correctly (#191) * Update contact email on table error * Fix bug where attachments didn't load correctly * Merge remote-tracking branch 'origin/feature/v2.6.0-bugfixes' into feature/fix-icr-breadcrumb * Merge branch 'feature/v2.6.0-bugfixes' into feature/enlarge-icr-description-field * Display newlines on all description fields * Trim all description fields
1 parent a3f662c commit 74a703b

File tree

19 files changed

+147
-52
lines changed

19 files changed

+147
-52
lines changed

app/components/icr/versions.hbs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@
1616
@skin={{if version.isArchived "default" "success"}}
1717
>
1818
<AuLink
19-
@route="information-assets.edit"
19+
@route="information-assets.information-asset"
2020
@model={{version.id}}
21-
@query={{hash edit=null}}
21+
@query={{hash
22+
edit=null
23+
process=@process
24+
parentRoute=@parentRoute
25+
}}
2226
@icon="link"
2327
@skin={{if
2428
(eq version.id @versionedAsset.id)
@@ -46,4 +50,4 @@
4650
</li>
4751
{{/each}}
4852
</ol>
49-
{{/if}}
53+
{{/if}}

app/components/process/attachments.hbs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,12 @@
102102
<td>{{attachment._source}}
103103
{{#if attachment.informationAsset}}
104104
<AuLink
105-
@route="information-assets.edit"
105+
@route="information-assets.information-asset"
106106
@model={{attachment.informationAsset.id}}
107+
@query={{hash
108+
process=@process.id
109+
parentRoute=this.currentProcessRouteName
110+
}}
107111
>
108112
({{attachment.informationAsset.title}})
109113
</AuLink>
@@ -174,4 +178,4 @@
174178
>Verwijder</AuButton>
175179
</AuButtonGroup>
176180
</:footer>
177-
</AuModal>
181+
</AuModal>

app/components/process/attachments.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
import { getMessageForErrorCode } from 'frontend-openproceshuis/utils/error-messages';
1212

1313
export default class ProcessAttachments extends Component {
14+
@service router;
15+
1416
constructor() {
1517
super(...arguments);
1618
this.fetchAttachments.perform();
@@ -26,6 +28,10 @@ export default class ProcessAttachments extends Component {
2628
return this.args.process;
2729
}
2830

31+
get currentProcessRouteName() {
32+
return this.router.currentRouteName?.replace('.index', '');
33+
}
34+
2935
@tracked pageAttachments = 0;
3036
@tracked sortAttachments = 'name';
3137
sizeAttachments = 10;
@@ -127,8 +133,8 @@ export default class ProcessAttachments extends Component {
127133
if (infoAssetIds.length > 0) {
128134
infoAssetFiles = await this.store.query('file', {
129135
...baseQuery,
130-
'filter[information-asset][id]': infoAssetIds.join(','),
131-
include: 'information-asset',
136+
'filter[information-assets][id]': infoAssetIds.join(','),
137+
include: 'information-assets',
132138
});
133139
}
134140
const allFiles = [

app/components/process/details-card.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@
169169
<Item>
170170
<:label>Beschrijving</:label>
171171
<:content>
172-
{{or @process.description "/"}}
172+
<span class="u-preserve-line-breaks">{{or
173+
(trim @process.description)
174+
"/"
175+
}}</span>
173176
</:content>
174177
</Item>
175178
<Item>

app/components/process/icr-card.hbs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,9 @@
182182
{{on "click" (fn this.editAsset asset)}}
183183
>
184184
{{asset.title}}
185-
<AuIcon @icon="pencil" />
185+
{{#if @canEdit}}
186+
<AuIcon @icon="pencil" />
187+
{{/if}}
186188
</AuPill>
187189
{{/if}}
188190
{{/each}}
@@ -194,7 +196,12 @@
194196
</Item>
195197
<Item>
196198
<:label>Motivering of bijkomende informatie</:label>
197-
<:content>{{or @process.additionalInformation "/"}}</:content>
199+
<:content>
200+
<span class="u-preserve-line-breaks">{{or
201+
(trim @process.additionalInformation)
202+
"/"
203+
}}</span>
204+
</:content>
198205
</Item>
199206
<Item>
200207
<:label>Link naar maatregelen</:label>

app/components/process/icr-card.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ export default class ProcessIcrCardComponent extends Component {
8383
}
8484

8585
@action editAsset(asset) {
86-
this.router.transitionTo('information-assets.edit', asset.id, {
87-
queryParams: { edit: true, process: this.args.process.id },
86+
this.router.transitionTo('information-assets.information-asset', asset.id, {
87+
queryParams: {
88+
edit: true,
89+
process: this.args.process.id,
90+
parentRoute: this.router.currentRouteName?.replace('.index', ''),
91+
},
8892
});
8993
}
9094

app/components/table-message/error.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
contact op via mail
88
<a
99
class="au-c-link"
10-
href="mailto:ict.helpdesk.abb@vlaanderen.be"
11-
>ict.helpdesk.abb@vlaanderen.be</a>.
10+
href="mailto:loketlokaalbestuur@vlaanderen.be"
11+
>loketlokaalbestuur@vlaanderen.be</a>.
1212
</p>
1313
</TableMessage>

app/controllers/information-assets/edit.js renamed to app/controllers/information-assets/information-asset.js

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import { service } from '@ember/service';
44
import { tracked } from '@glimmer/tracking';
55
import { task } from 'ember-concurrency';
66
import ENV from 'frontend-openproceshuis/config/environment';
7-
export default class InformationAssetIndexController extends Controller {
7+
8+
export default class InformationAssetsInformationAssetController extends Controller {
89
queryParams = [
910
'edit',
1011
'process',
12+
'parentRoute',
1113
{ versionedAssetId: 'version' },
1214
{ pageAttachments: 'page-attachments' },
1315
{ sizeAttachments: 'size-attachments' },
@@ -22,6 +24,7 @@ export default class InformationAssetIndexController extends Controller {
2224

2325
@tracked edit = false;
2426
@tracked process = null;
27+
@tracked parentRoute = null;
2528
@tracked versionedAssetId = null;
2629
@tracked formIsValid = this.canonicalAsset.title?.trim().length > 0;
2730
@tracked isDeleteModalOpen = false;
@@ -53,6 +56,30 @@ export default class InformationAssetIndexController extends Controller {
5356
return this.model.versionedAssets;
5457
}
5558

59+
get originatingProcess() {
60+
if (!this.process) return null;
61+
62+
return this.canonicalAsset.processes.find(
63+
(process) => process.id === this.process,
64+
);
65+
}
66+
67+
get breadcrumbParentTitle() {
68+
return this.originatingProcess?.title ?? 'Informatie assets';
69+
}
70+
71+
get breadcrumbParentRoute() {
72+
return this.originatingProcess && this.parentRoute
73+
? this.parentRoute
74+
: 'information-assets.index';
75+
}
76+
77+
get breadcrumbParentModel() {
78+
return this.originatingProcess && this.parentRoute
79+
? this.originatingProcess.id
80+
: null;
81+
}
82+
5683
@action
5784
validateForm() {
5885
this.formIsValid = this.canonicalAsset.title?.trim().length > 0;
@@ -91,7 +118,10 @@ export default class InformationAssetIndexController extends Controller {
91118
});
92119
this.edit = false;
93120
if (this.process) {
94-
return this.router.transitionTo('processes.process', this.process);
121+
return this.router.transitionTo(
122+
this.parentRoute ?? 'processes.process',
123+
this.process,
124+
);
95125
}
96126
return;
97127
}
@@ -134,19 +164,24 @@ export default class InformationAssetIndexController extends Controller {
134164
await oldVersionedRecord.save();
135165

136166
if (this.process) {
137-
this.router.transitionTo('processes.process', this.process);
167+
this.router.transitionTo(
168+
this.parentRoute ?? 'processes.process',
169+
this.process,
170+
);
138171
} else {
139172
await this.router.transitionTo(
140-
'information-assets.edit',
173+
'information-assets.information-asset',
141174
canonicalRecord.id,
142175
{
143176
queryParams: {
144177
version: newVersionedRecord.id,
145178
edit: false,
179+
process: this.process,
180+
parentRoute: this.parentRoute,
146181
},
147182
},
148183
);
149-
this.router.refresh('information-assets.edit');
184+
this.router.refresh('information-assets.information-asset');
150185
}
151186

152187
this.edit = false;

app/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Router.map(function () {
4848
});
4949

5050
this.route('information-assets', { path: 'informatie-assets' }, function () {
51-
this.route('edit', { path: '/:id' });
51+
this.route('information-asset', { path: '/:id/' }, function () {});
5252
});
5353

5454
this.route('legal', { path: '/legaal' }, function () {

app/routes/information-assets/edit.js renamed to app/routes/information-assets/information-asset.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Route from '@ember/routing/route';
22
import { service } from '@ember/service';
33

4-
export default class InformationAssetIndexRoute extends Route {
4+
export default class InformationAssetsInformationAssetRoute extends Route {
55
@service session;
66
@service router;
77
@service store;
@@ -18,7 +18,7 @@ export default class InformationAssetIndexRoute extends Route {
1818
}
1919

2020
async model() {
21-
const params = this.paramsFor('information-assets.edit');
21+
const params = this.paramsFor('information-assets.information-asset');
2222
const id = params.id;
2323
const { versionedAssetId } = params;
2424

@@ -62,11 +62,15 @@ export default class InformationAssetIndexRoute extends Route {
6262

6363
const canonical = await versionedInformationAsset.canonical;
6464

65-
this.router.replaceWith('information-assets.edit', canonical.id, {
66-
queryParams: {
67-
...params,
68-
versionedAssetId,
65+
this.router.replaceWith(
66+
'information-assets.information-asset',
67+
canonical.id,
68+
{
69+
queryParams: {
70+
...params,
71+
versionedAssetId,
72+
},
6973
},
70-
});
74+
);
7175
}
7276
}

0 commit comments

Comments
 (0)