Skip to content

Commit

Permalink
fix: update statuslines
Browse files Browse the repository at this point in the history
  • Loading branch information
janthijs committed Oct 31, 2023
1 parent fb7270a commit 2274474
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 69 deletions.
35 changes: 21 additions & 14 deletions src/client/pages/VergunningDetail/RvvSloterweg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,20 @@ export function getRVVSloterwegLineItems(
const isReceived =
(!vergunning.dateWorkflowActive || !vergunning.dateWorkflowVerleend) &&
!vergunning.decision;
const isInprogress = !!vergunning.dateWorkflowActive && !vergunning.decision;
const isGranted = !!vergunning.dateWorkflowVerleend && !vergunning.decision;
const isInprogress = !!vergunning.dateWorkflowActive;
const isGranted = !!vergunning.dateWorkflowVerleend;

const isExpired =
(vergunning.dateEnd && isGranted
(vergunning.dateEnd && isGranted && !vergunning.decision
? new Date(vergunning.dateEnd) < new Date()
: false) ||
vergunning.decision === RVV_SLOTERWEG_RESULT_UPDATED_WIHT_NEW_KENTEKEN;

const hasDecision =
isRevoked ||
isMatured ||
vergunning.decision === RVV_SLOTERWEG_RESULT_UPDATED_WIHT_NEW_KENTEKEN;

const lineItems: StatusLineItem[] = [
{
id: 'status-ontvangen',
Expand All @@ -46,20 +51,22 @@ export function getRVVSloterwegLineItems(
datePublished: vergunning.dateWorkflowActive ?? '',
description: '',
documents: [],
isActive: isInprogress && !isGranted,
isActive: isInprogress && !isGranted && !isRevoked,
isChecked: isInprogress,
});
}

lineItems.push({
id: 'status-in-verleend',
status: 'Verleend',
datePublished: vergunning.dateWorkflowVerleend ?? '',
description: '',
documents: [],
isActive: isGranted,
isChecked: !!vergunning.dateWorkflowVerleend,
});
if (isGranted || (!isGranted && !isRevoked)) {
lineItems.push({
id: 'status-in-verleend',
status: 'Verleend',
datePublished: vergunning.dateWorkflowVerleend ?? '',
description: '',
documents: [],
isActive: isGranted && !hasDecision,
isChecked: !!vergunning.dateWorkflowVerleend || hasDecision,
});
}

if (isRevoked) {
lineItems.push({
Expand Down Expand Up @@ -101,7 +108,7 @@ export function getRVVSloterwegLineItems(
});
}

if (isGranted && !isExpired) {
if (isGranted && !isExpired && !isMatured && !isRevoked) {
lineItems.push({
id: 'status-verlopen-placeholder',
status: 'Verlopen',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4561,6 +4561,20 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Nieuw/
12 juli 2023
</p>
</div>
<div
class="_InfoDetail_6f1df2"
>
<h3
class="amsterdam-heading amsterdam-heading--4 _Label_6f1df2"
>
Tot
</h3>
<p
class="_Value_6f1df2"
>
22 juli 2023
</p>
</div>
</div>
</div>
<div
Expand Down Expand Up @@ -4643,10 +4657,10 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Nieuw/
class="_StatusConnection_a12ff2"
>
<span
class="_ConnectLine_a12ff2"
class="_ConnectLine_a12ff2 _ConnectLine--checked_a12ff2"
/>
<span
class="_Checkmark_a12ff2"
class="_Checkmark_a12ff2 _Checkmark--checked_a12ff2"
/>
</div>
<div
Expand All @@ -4657,6 +4671,11 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Nieuw/
>
Verleend
</strong>
<time
class="_StatusDate_a12ff2"
>
02 juli 2023
</time>
</div>
<div
class="_Panel_a12ff2 _Panel--description_a12ff2"
Expand Down Expand Up @@ -5137,6 +5156,20 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Nieuw/
12 juli 2023
</p>
</div>
<div
class="_InfoDetail_6f1df2"
>
<h3
class="amsterdam-heading amsterdam-heading--4 _Label_6f1df2"
>
Tot
</h3>
<p
class="_Value_6f1df2"
>
22 juli 2023
</p>
</div>
</div>
</div>
<div
Expand Down Expand Up @@ -5219,10 +5252,10 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Nieuw/
class="_StatusConnection_a12ff2"
>
<span
class="_ConnectLine_a12ff2"
class="_ConnectLine_a12ff2 _ConnectLine--checked_a12ff2"
/>
<span
class="_Checkmark_a12ff2"
class="_Checkmark_a12ff2 _Checkmark--checked_a12ff2"
/>
</div>
<div
Expand All @@ -5233,6 +5266,11 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Nieuw/
>
Verleend
</strong>
<time
class="_StatusDate_a12ff2"
>
02 juli 2023
</time>
</div>
<div
class="_Panel_a12ff2 _Panel--description_a12ff2"
Expand Down Expand Up @@ -5274,7 +5312,7 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Nieuw/
<time
class="_StatusDate_a12ff2"
>
03 juli 2023
22 juli 2023
</time>
</div>
<div
Expand Down Expand Up @@ -5535,10 +5573,10 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Wijzig
class="_StatusConnection_a12ff2"
>
<span
class="_ConnectLine_a12ff2"
class="_ConnectLine_a12ff2 _ConnectLine--checked_a12ff2"
/>
<span
class="_Checkmark_a12ff2"
class="_Checkmark_a12ff2 _Checkmark--checked_a12ff2"
/>
</div>
<div
Expand Down Expand Up @@ -5567,44 +5605,6 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Wijzig
/>
</div>
</li>
<li
class="_ListItem_a12ff2"
>
<div
class="_ListItemInner_a12ff2"
>
<div
aria-label="Vinkje, processtap gereed"
class="_StatusConnection_a12ff2"
>
<span
class="_ConnectLine_a12ff2"
/>
<span
class="_Checkmark_a12ff2"
/>
</div>
<div
class="_Panel_a12ff2 _Panel--status_a12ff2"
>
<strong
class="_StatusTitle_a12ff2"
>
Verleend
</strong>
</div>
<div
class="_Panel_a12ff2 _Panel--description_a12ff2"
>
<div
class="_PanelContent_a12ff2"
/>
</div>
<div
class="_Panel_a12ff2 _Panel--documents_a12ff2"
/>
</div>
</li>
<li
class="_ListItem_a12ff2 _ListItem--highlight_a12ff2"
>
Expand Down Expand Up @@ -5908,10 +5908,10 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Wijzig
class="_StatusConnection_a12ff2"
>
<span
class="_ConnectLine_a12ff2"
class="_ConnectLine_a12ff2 _ConnectLine--checked_a12ff2"
/>
<span
class="_Checkmark_a12ff2"
class="_Checkmark_a12ff2 _Checkmark--checked_a12ff2"
/>
</div>
<div
Expand Down Expand Up @@ -5941,7 +5941,7 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Wijzig
</div>
</li>
<li
class="_ListItem_a12ff2"
class="_ListItem_a12ff2 _ListItem--highlight_a12ff2"
>
<div
class="_ListItemInner_a12ff2"
Expand All @@ -5951,10 +5951,10 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Wijzig
class="_StatusConnection_a12ff2"
>
<span
class="_ConnectLine_a12ff2 _ConnectLine--end-checked_a12ff2"
class="_ConnectLine_a12ff2 _ConnectLine--middle-checked-next_a12ff2"
/>
<span
class="_Checkmark_a12ff2 _Checkmark--checked_a12ff2"
class="_Checkmark_a12ff2 _Checkmark--active_a12ff2 _Checkmark--checked_a12ff2"
/>
</div>
<div
Expand Down Expand Up @@ -5983,6 +5983,44 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Wijzig
/>
</div>
</li>
<li
class="_ListItem_a12ff2"
>
<div
class="_ListItemInner_a12ff2"
>
<div
aria-label="Vinkje, processtap gereed"
class="_StatusConnection_a12ff2"
>
<span
class="_ConnectLine_a12ff2 _ConnectLine--end_a12ff2"
/>
<span
class="_Checkmark_a12ff2"
/>
</div>
<div
class="_Panel_a12ff2 _Panel--status_a12ff2"
>
<strong
class="_StatusTitle_a12ff2"
>
Verlopen
</strong>
</div>
<div
class="_Panel_a12ff2 _Panel--description_a12ff2"
>
<div
class="_PanelContent_a12ff2"
/>
</div>
<div
class="_Panel_a12ff2 _Panel--documents_a12ff2"
/>
</div>
</li>
</ul>
</div>
</main>
Expand Down Expand Up @@ -6602,10 +6640,10 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Wijzig
class="_StatusConnection_a12ff2"
>
<span
class="_ConnectLine_a12ff2"
class="_ConnectLine_a12ff2 _ConnectLine--checked_a12ff2"
/>
<span
class="_Checkmark_a12ff2"
class="_Checkmark_a12ff2 _Checkmark--checked_a12ff2"
/>
</div>
<div
Expand Down Expand Up @@ -6705,7 +6743,7 @@ exports[`<VergunningDetail /> > RVV Sloterweg > RVV ontheffing Sloterweg (Wijzig
<time
class="_StatusDate_a12ff2"
>
03 juli 2023
22 juli 2023
</time>
</div>
<div
Expand Down
4 changes: 2 additions & 2 deletions src/server/mock-data/json/vergunningen.json
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@
"status": "iets?",
"decision": "Verlopen",
"dateWorkflowActive": "2023-07-02T00:00:00",
"dateWorkflowVerleend": null,
"dateWorkflowVerleend": "2023-07-02T00:00:00",
"processed": true,
"dateStart": "2023-07-12T00:00:00",
"dateEnd": "2023-07-22T00:00:00",
Expand All @@ -1220,7 +1220,7 @@
"status": "iets?",
"decision": "Ingetrokken",
"dateWorkflowActive": "2023-07-02T00:00:00",
"dateWorkflowVerleend": null,
"dateWorkflowVerleend": "2023-07-02T00:00:00",
"processed": true,
"dateStart": "2023-07-12T00:00:00",
"dateEnd": "2023-07-22T00:00:00",
Expand Down

0 comments on commit 2274474

Please sign in to comment.