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

Service delivery reporting features #60

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
39c31bb
qhouyee/29/service-delivery-reporting: clean up css on summary section
qhouyee Jan 24, 2025
c414ceb
Merge remote-tracking branch 'remotes/origin/main' into qhouyee/29/se…
qhouyee Jan 24, 2025
181e0eb
qhouyee/29/service-delivery-reporting: add pricing model form
qhouyee Jan 24, 2025
f152bfe
qhouyee/29/service-delivery-reporting: simplify array design to use f…
qhouyee Feb 12, 2025
69b7e78
qhouyee/29/service-delivery-reporting: modified mechanics to add a ne…
qhouyee Feb 12, 2025
9161c5e
qhouyee/29/service-delivery-reporting: modify the delete button for t…
qhouyee Feb 12, 2025
9baa843
Merge remote-tracking branch 'remotes/origin/main' into qhouyee/29/se…
qhouyee Feb 13, 2025
af722c9
qhouyee/29/service-delivery-reporting: remove the last empty row in a…
qhouyee Feb 13, 2025
0e1a74e
qhouyee/29/service-delivery-reporting: added a button to access prici…
qhouyee Feb 17, 2025
8508b30
qhouyee/29/service-delivery-reporting: parse existing pricing model i…
qhouyee Feb 17, 2025
0857450
qhouyee/29/service-delivery-reporting: update loading state for displ…
qhouyee Feb 17, 2025
7459643
Merge remote-tracking branch 'remotes/origin/main' into qhouyee/29/se…
qhouyee Feb 19, 2025
2b01020
qhouyee/29/service-delivery-reporting: fixed css after merged
qhouyee Feb 19, 2025
f94b0ac
qhouyee/29/service-delivery-reporting: fix wrong form state variable
qhouyee Feb 19, 2025
d0b25e4
qhouyee/29/service-delivery-reporting: simplify task submit action
qhouyee Feb 19, 2025
9fa5f6a
qhouyee/29/service-delivery-reporting: fix changes to the array or it…
qhouyee Feb 19, 2025
32590b4
qhouyee/29/service-delivery-reporting: refactor to extract date from …
qhouyee Feb 19, 2025
95af5b8
qhouyee/29/service-delivery-reporting: refactor to retrieve concepts …
qhouyee Feb 21, 2025
a9fe590
qhouyee/29/service-delivery-reporting: updated in documentation
qhouyee Feb 21, 2025
73b807e
qhouyee/29/service-delivery-reporting: remove extra logging
qhouyee Feb 21, 2025
b341684
qhouyee/29/service-delivery-reporting: extract form field rendering i…
qhouyee Feb 21, 2025
cb47289
qhouyee/29/service-delivery-reporting: update form template retrieved…
qhouyee Feb 21, 2025
bd83ae9
qhouyee/29/service-delivery-reporting: remove unused imports
qhouyee Feb 21, 2025
c44c7ca
qhouyee/29/service-delivery-reporting: update form section to reuse t…
qhouyee Feb 21, 2025
e8a28f7
qhouyee/29/service-delivery-reporting: added an option-based form sec…
qhouyee Feb 21, 2025
e0c5568
qhouyee/29/service-delivery-reporting: refactor form-template to use …
qhouyee Feb 21, 2025
9affb5b
qhouyee/29/service-delivery-reporting: updated branch form section to…
qhouyee Feb 21, 2025
963b548
qhouyee/29/service-delivery-reporting: fix for RegistryFieldValues to…
qhouyee Feb 24, 2025
d1ddb75
qhouyee/29/service-delivery-reporting: fix to display concepts with p…
qhouyee Feb 24, 2025
367a39b
qhouyee/29/service-delivery-reporting: remove form type being sent to…
qhouyee Feb 26, 2025
73ba282
qhouyee/29/service-delivery-reporting: add an initial id based on the…
qhouyee Feb 26, 2025
6a438d6
qhouyee/29/service-delivery-reporting: removed pricing related code
qhouyee Feb 27, 2025
f4ffb6c
qhouyee/29/service-delivery-reporting: bug fix for dependent form se…
qhouyee Feb 28, 2025
edac81f
qhouyee/29/service-delivery-reporting: bug fix for dependency to use…
qhouyee Feb 28, 2025
acbef1e
qhouyee/29/service-delivery-reporting: bug fix for not updating the a…
qhouyee Feb 28, 2025
6491ec4
qhouyee/29/service-delivery-reporting: updated branch and field array…
qhouyee Mar 5, 2025
1946745
qhouyee/29/service-delivery-reporting: update initial start value to …
qhouyee Mar 5, 2025
b7efc4a
qhouyee/29/service-delivery-reporting: update branch matching functio…
qhouyee Mar 5, 2025
0434e25
Merge remote-tracking branch 'remotes/origin/main' into qhouyee/29/se…
qhouyee Mar 6, 2025
3588d99
qhouyee/29/service-delivery-reporting: fix merge related bugs
qhouyee Mar 6, 2025
27e92bc
qhouyee/29/service-delivery-reporting: tidy array field design
qhouyee Mar 6, 2025
af63c8d
Merge remote-tracking branch 'remotes/origin/main' into qhouyee/29/se…
qhouyee Mar 6, 2025
42707ad
qhouyee/29/service-delivery-reporting: fix missing onsubmit button
qhouyee Mar 7, 2025
7c5b027
qhouyee/29/service-delivery-reporting: fix default value changes in t…
qhouyee Mar 7, 2025
d18bd94
qhouyee/29/service-delivery-reporting: update array design
qhouyee Mar 7, 2025
33cd182
qhouyee/29/service-delivery-reporting: updated button colors for dark…
qhouyee Mar 7, 2025
0ff2b5f
qhouyee/29/service-delivery-reporting: update summary accordion design
qhouyee Mar 7, 2025
f7c4f96
qhouyee/29/service-delivery-reporting: bump version
qhouyee Mar 7, 2025
cd0df2d
Update version to 5.17.0 in package.json and docker-compose.yml
Mar 7, 2025
a05d068
qhouyee/29/service-delivery-reporting: prevent default form submit tr…
qhouyee Mar 7, 2025
bbe4718
Merge branch 'qhouyee/29/service-delivery-reporting' of https://githu…
qhouyee Mar 7, 2025
9d61c1b
qhouyee/29/service-delivery-reporting: enable return button in all forms
qhouyee Mar 7, 2025
aca5e1f
qhouyee/29/service-delivery-reporting: consolidate transparency in th…
qhouyee Mar 7, 2025
a8ead7a
qhouyee/29/service-delivery-reporting: added refresh option in the ta…
qhouyee Mar 7, 2025
76d8006
qhouyee/29/service-delivery-reporting: fix invalid display on depende…
qhouyee Mar 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@

[//]: # (Note that version headers need to start with "## " characters to be picked up by some automated scripts)

## 5.17.0

### Changes

- Added form branches and arrays
- Added option to generate report
- Updated form extraction workflow following changes in the backend
- Consolidation of form parsing methods
- Improve dark mode design for the registry

### Bug Fixes

- Fix missing functions for action buttons

## 5.16.15

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.16.15
5.17.0
2 changes: 1 addition & 1 deletion code/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "viz",
"version": "5.16.15",
"version": "5.17.0",
"private": true,
"type": "module",
"jest": {
Expand Down
38 changes: 29 additions & 9 deletions code/src/types/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,44 @@ export const PROPERTY_GROUP_TYPE = "PropertyGroup";
export const ONTOLOGY_CONCEPT_ROOT = "root";
export const FORM_IDENTIFIER = "form";

interface RegistryFieldValue {
export interface SparqlResponseField {
value: string;
type: string;
dataType: string;
lang: string;
}

export type RegistryFieldValues = Record<string, RegistryFieldValue>;
export type RegistryFieldValues = Record<string, SparqlResponseField | SparqlResponseField[]>;

export type OntologyConceptMappings = Record<string, OntologyConcept[]>;

export type OntologyConcept = {
type: RegistryFieldValue;
label: RegistryFieldValue;
description: RegistryFieldValue;
parent?: RegistryFieldValue;
type: SparqlResponseField;
label: SparqlResponseField;
description: SparqlResponseField;
parent?: SparqlResponseField;
};

export interface FormOptionType {
label: string;
value: string;
}

export interface FormArrayItemOption {
fieldId: string;
label: string;
placeholder?: string
}

export type FormTemplate = {
"@context": Record<string, string>;
node: NodeShape[];
property: PropertyShapeOrGroup[];
};

export interface NodeShape {
label: JsonLdLiteral;
comment: JsonLdLiteral;
property: PropertyShapeOrGroup[];
};

Expand All @@ -45,12 +58,12 @@ export interface PropertyShape {
description: JsonLdLiteral;
order: number;
fieldId?: string; // Not present but appended after
defaultValue?: RegistryFieldValue;
defaultValue?: SparqlResponseField | SparqlResponseField[];
group?: JsonLdInstance;
datatype?: string;
class?: JsonLdInstance;
dependentOn?: JsonLdInstance;
in?: JsonLdInstance;
dependentOn?: DependentInstance;
in?: JsonLdInstance[];
minCount?: JsonLdLiteral;
maxCount?: JsonLdLiteral;
minInclusive?: JsonLdLiteral;
Expand All @@ -69,6 +82,12 @@ export interface PropertyGroup {
comment: JsonLdLiteral;
order: number;
property: PropertyShape[];
multipleProperty?: PropertyShape[];
}

interface DependentInstance {
"@id": string;
label?: string;
}

interface JsonLdInstance {
Expand Down Expand Up @@ -105,4 +124,5 @@ export interface RegistryTaskOption {
id: string;
contract: string;
status: string;
date: string;
}
15 changes: 14 additions & 1 deletion code/src/ui/css/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
--border-primary: #b6b6bf;
--border-secondary: #a5a5b3;
--border-tertiary: #9898af;

/* Button */
--description-box: #a9d9d1;
--button-color-secondary: #18677a;
--button-color-secondary-hover: #0B4452;
}
}

Expand Down Expand Up @@ -55,6 +60,11 @@
--border-primary: #434b55;
--border-secondary: #6c7989;
--border-tertiary: #7f8ea1;

/* Button */
--description-box: #2B816F;
--button-color-secondary: #7ACADB;
--button-color-secondary-hover: #35A7C0;
}
}

Expand All @@ -78,7 +88,7 @@
/* Button colors */
--button-color-primary: #83C38D;
--button-color-primary-active: #65A671;
--description-box: #a9d9d1;
--alert-color: 191, 74, 42;
}

* {
Expand Down Expand Up @@ -119,6 +129,9 @@ img {
background-color: transparent !important;
}

ul {
list-style-type: none;
}

/**
Constants for our own CSS classes (across all themes).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default function RegistryRowActions(props: Readonly<RegistryRowActionsPro
id: recordId,
status: status,
contract: props.row.contract,
date: props.row.date,
});
} else {
// Move to the view modal page for the specific record
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ export default function RegistryTableComponent(props: Readonly<RegistryTableComp
</div>
{task && <TaskModal
entityType={props.entityType}
date={selectedDate}
registryAgentApi={props.registryAgentApi}
isOpen={isTaskModalOpen}
task={task}
Expand Down
9 changes: 7 additions & 2 deletions code/src/ui/graphic/table/registry/registry-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ export default function RegistryTable(props: Readonly<RegistryTableProps>) {
// Extract only the value into the data to simplify
return props.instances.map((instance) => {
const flattenInstance: Record<string, string> = {};
Object.keys(instance).map((field) => {
flattenInstance[field] = instance[field].value;
Object.keys(instance).forEach((field) => {
const fieldValue = instance[field];
if (Array.isArray(fieldValue)) {
flattenInstance[field] = fieldValue[0]?.value; // Handle array of SparqlResponseField
} else {
flattenInstance[field] = fieldValue?.value;
}
});
return flattenInstance;
});
Expand Down
9 changes: 3 additions & 6 deletions code/src/ui/graphic/table/registry/ribbon/summary.module.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
.container {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
}

.action {
height: 0.5rem;
width: 99%;
margin-top: -0.25rem !important;
margin-left: 0.5rem;
justify-content: start !important;
margin-left: 0;
}

@media only screen and (max-width: 480px) {
Expand All @@ -19,6 +17,5 @@

.action {
width: 50%;
margin-left: 0;
}
}
10 changes: 5 additions & 5 deletions code/src/ui/graphic/table/registry/ribbon/summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { useEffect, useState } from 'react';

import { Routes } from 'io/config/routes';
import { RegistryFieldValues } from 'types/form';
import { getData } from 'utils/server-actions';
import RedirectButton from 'ui/interaction/action/redirect/redirect-button';
import Accordion from 'ui/text/accordion/accordion';
import AccordionField from 'ui/text/accordion/accordion-field';
import RedirectButton from 'ui/interaction/action/redirect/redirect-button';
import { getData } from 'utils/server-actions';

interface SummarySectionProps {
id: string;
Expand All @@ -31,8 +31,8 @@ export default function SummarySection(props: Readonly<SummarySectionProps>) {
const fetchData = async (): Promise<void> => {
setIsLoading(true);
try {
const contract: RegistryFieldValues[] = await getData(props.registryAgentApi, props.entityType, props.id, null, true);
setContract(contract[0]);
const contractRes: RegistryFieldValues[] = await getData(props.registryAgentApi, props.entityType, props.id, null, true);
setContract(contractRes[0]);
setIsLoading(false);
} catch (error) {
console.error("Error fetching instances", error);
Expand All @@ -47,7 +47,7 @@ export default function SummarySection(props: Readonly<SummarySectionProps>) {
title="Description"
isLoading={isLoading}
>{contract && Object.keys(contract).map((field, index) => {
if (field != "id" && contract[field].value) {
if (field != "id" && !Array.isArray(contract[field]) && contract[field].value) {
return <AccordionField
key={field + index}
name={field}
Expand Down
21 changes: 12 additions & 9 deletions code/src/ui/graphic/table/registry/ribbon/table-ribbon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ export default function TableRibbon(props: Readonly<TableRibbonProps>) {
url={`${Routes.REGISTRY_PENDING}/${props.entityType}`}
isActive={props.lifecycleStage == Routes.REGISTRY_PENDING}
isHoverableDisabled={true}
isTransparent={true}
className={styles["registry-nav-button"]}
styling={{
active: styles["active-state"],
text: styles["transparent-button-text"],
}}
/>
<RedirectButton
Expand All @@ -73,10 +73,10 @@ export default function TableRibbon(props: Readonly<TableRibbonProps>) {
url={`${Routes.REGISTRY_ACTIVE}/${props.entityType}`}
isActive={props.lifecycleStage == Routes.REGISTRY_ACTIVE || props.lifecycleStage == Routes.REGISTRY_TASK_DATE}
isHoverableDisabled={true}
isTransparent={true}
className={styles["registry-nav-button"]}
styling={{
active: styles["active-state"],
text: styles["transparent-button-text"],
}}
/>
<RedirectButton
Expand All @@ -85,10 +85,10 @@ export default function TableRibbon(props: Readonly<TableRibbonProps>) {
url={`${Routes.REGISTRY_ARCHIVE}/${props.entityType}`}
isActive={props.lifecycleStage == Routes.REGISTRY_ARCHIVE}
isHoverableDisabled={true}
isTransparent={true}
className={styles["registry-nav-button"]}
styling={{
active: styles["active-state"],
text: styles["transparent-button-text"],
}}
/>
</div>
Expand All @@ -99,10 +99,7 @@ export default function TableRibbon(props: Readonly<TableRibbonProps>) {
<ClickActionButton
icon={"cached"}
onClick={triggerRefresh}
className={styles["transparent-button"]}
styling={{
text: styles["transparent-button-text"],
}}
isTransparent={true}
/>
<div className={styles["action-ribbon"]}>
{(authorised || !isKeycloakEnabled) &&
Expand Down Expand Up @@ -152,12 +149,18 @@ export default function TableRibbon(props: Readonly<TableRibbonProps>) {
isActive={props.lifecycleStage == Routes.REGISTRY_TASK_DATE}
/>
)}
{props.lifecycleStage == Routes.REGISTRY_REPORT && (
{props.lifecycleStage == Routes.REGISTRY_REPORT && (<>
<ReturnButton
icon="first_page"
label={`back to ${props.entityType}s`}
/>
)}
<RedirectButton
icon="print"
label="generate report"
url={`${Routes.REGISTRY_EDIT}/pricing/${props.path}`}
isActive={false}
/>
</>)}
<DownloadButton instances={props.instances} />
</div>
</div>
Expand Down
20 changes: 0 additions & 20 deletions code/src/ui/graphic/table/registry/ribbon/table.ribbon.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,6 @@
background: transparent;
}

.transparent-button {
background: none !important;
border: none !important;
}

.transparent-button:hover {
background: none !important;
transform: none !important;
box-shadow: none !important;
}

.transparent-button-text {
font-size: var(--font-size-secondary-text);
color: var(--text-color-primary) !important;
}

.transparent-button-text:hover {
color: var(--text-color-links-hover) !important;
}

@media only screen and (max-width: 480px) {
.menu {
justify-content: flex-start;
Expand Down
Loading