Skip to content

Commit

Permalink
feat(dataSet): dataSet sectionedForm
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Nov 6, 2024
1 parent 99edd10 commit 2205b2e
Show file tree
Hide file tree
Showing 26 changed files with 1,011 additions and 89 deletions.
92 changes: 60 additions & 32 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-10-23T11:07:53.225Z\n"
"PO-Revision-Date: 2024-10-23T11:07:53.225Z\n"
"POT-Creation-Date: 2024-11-04T20:16:04.917Z\n"
"PO-Revision-Date: 2024-11-04T20:16:04.918Z\n"

msgid "schemas"
msgstr "schemas"
Expand Down Expand Up @@ -123,21 +123,6 @@ msgstr "Failed to load {{label}}"
msgid "Failed to load"
msgstr "Failed to load"

msgid "Download"
msgstr "Download"

msgid "Merge"
msgstr "Merge"

msgid "Delete source data element values"
msgstr "Delete source data element values"

msgid "Last updated"
msgstr "Last updated"

msgid "Discard"
msgstr "Discard"

msgid "Aggregation level(s)"
msgstr "Aggregation level(s)"

Expand Down Expand Up @@ -237,6 +222,9 @@ msgstr "Created"
msgid "Last updated by"
msgstr "Last updated by"

msgid "Last updated"
msgstr "Last updated"

msgid "Id"
msgstr "Id"

Expand All @@ -258,6 +246,9 @@ msgstr "Details"
msgid "Failed to load details"
msgstr "Failed to load details"

msgid "Download"
msgstr "Download"

msgid "Download {{section}}"
msgstr "Download {{section}}"

Expand Down Expand Up @@ -297,6 +288,9 @@ msgstr "Clear all filters"
msgid "Category"
msgstr "Category"

msgid "Category option"
msgstr "Category option"

msgid "Category option group"
msgstr "Category option group"

Expand Down Expand Up @@ -435,9 +429,6 @@ msgstr "Search for a user or group"
msgid "Categories"
msgstr "Categories"

msgid "Category option"
msgstr "Category option"

msgid "Category options"
msgstr "Category options"

Expand Down Expand Up @@ -855,9 +846,15 @@ msgstr "Zero is significant"
msgid "Data dimension type"
msgstr "Data dimension type"

msgid "Ignore data approval"
msgstr "Ignore data approval"

msgid "This field requires a unique value, please choose another one"
msgstr "This field requires a unique value, please choose another one"

msgid "{{label}} (required)"
msgstr "{{label}} (required)"

msgid "No changes to be saved"
msgstr "No changes to be saved"

Expand All @@ -879,23 +876,27 @@ msgstr "Basic information"
msgid "Set up the basic information for this category."
msgstr "Set up the basic information for this category."

msgid "Explain the purpose of this category."
msgstr "Explain the purpose of this category."
msgid "Explain the purpose of this category option group."
msgstr "Explain the purpose of this category option group."

msgid "Data configuration"
msgstr "Data configuration"

msgid "Choose how this category will be used to capture and analyze"
msgstr "Choose how this category will be used to capture and analyze"
msgid "Choose how this category option group will be used to capture and analyze"
msgstr "Choose how this category option group will be used to capture and analyze"

msgid "Use as data dimension"
msgstr "Use as data dimension"

msgid "Category will be available to the analytics as another dimension"
msgstr "Category will be available to the analytics as another dimension"
msgid ""
"Category option group will be available to the analytics as another "
"dimension"
msgstr ""
"Category option group will be available to the analytics as another "
"dimension"

msgid "Choose the category options to include in this category."
msgstr "Choose the category options to include in this category."
msgid "Choose the category options to include in this category option group."
msgstr "Choose the category options to include in this category option group."

msgid "Available category options"
msgstr "Available category options"
Expand Down Expand Up @@ -933,6 +934,15 @@ msgstr "Filter selected categories"
msgid "At least one category is required"
msgstr "At least one category is required"

msgid "Set up the basic information for this category option group."
msgstr "Set up the basic information for this category option group."

msgid "Choose how this category option will be used to capture and analyze"
msgstr "Choose how this category option will be used to capture and analyze"

msgid "Choose the category options to include in this category."
msgstr "Choose the category options to include in this category."

msgid "Set up the basic information for this category option."
msgstr "Set up the basic information for this category option."

Expand Down Expand Up @@ -1081,6 +1091,24 @@ msgstr ""
"included. PHU will still be available for the PHU level, but not included "
"in the aggregations to the levels above."

msgid "Setup"
msgstr "Setup"

msgid "Data"
msgstr "Data"

msgid "Periods"
msgstr "Periods"

msgid "Organisation Units"
msgstr "Organisation Units"

msgid "Form"
msgstr "Form"

msgid "Advanced"
msgstr "Advanced"

msgid "Upload an image"
msgstr "Upload an image"

Expand Down Expand Up @@ -1136,11 +1164,11 @@ msgstr "Latitude"
msgid "Longitude"
msgstr "Longitude"

msgid "Reference assignments"
msgstr "Reference assignments"
msgid "Reference assignment"
msgstr "Reference assignment"

msgid "Assign the organisation unit to related models."
msgstr "Assign the organisation unit to related models."
msgid "Assign the organisation unit to related objects."
msgstr "Assign the organisation unit to related objects."

msgid "Available data sets"
msgstr "Available data sets"
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/FormBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type OwnProps<TValues = Record<string, unknown>> = {
includeAttributes?: boolean
}

type FormBaseProps<TValues> = FormProps<TValues> & OwnProps<TValues>
export type FormBaseProps<TValues> = FormProps<TValues> & OwnProps<TValues>

export function FormBase<TInitialValues extends MaybeModelWithAttributes>({
children,
Expand Down
23 changes: 23 additions & 0 deletions src/components/sectionedForm/DefaultSectionedFormSidebar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react'
import { useSectionedFormDescriptor, useSelectedSection } from '../../lib'
import {
SectionedFormSidebar,
SectionedFormSidebarItem,
} from './SectionedFormSidebar'

export const DefaultSectionedFormSidebar = () => {
const { sections } = useSectionedFormDescriptor()

const [selected] = useSelectedSection()

const items = sections.map((section) => (
<SectionedFormSidebarItem
key={section.name}
selected={selected === section.name}
sectionName={section.name}
>
{section.label}
</SectionedFormSidebarItem>
))
return <SectionedFormSidebar>{items}</SectionedFormSidebar>
}
26 changes: 26 additions & 0 deletions src/components/sectionedForm/SectionForm.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.defaultFormFooter {
}

.footerWrapper {
display: flex;
justify-content: space-between;
padding: 0 16px;
align-self: center;
gap: 4px;
}

.sectionActions {
display: flex;
gap: var(--spacers-dp8);
}

.verticalDivider {
border-left: 1px solid var(--colors-grey300);
height: 100%;
width: 20px;
}

.submitActions {
display: flex;
gap: 8px;
}
109 changes: 109 additions & 0 deletions src/components/sectionedForm/SectionFormSidebar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
.sidebar {
overflow: auto;
height: 100%;
}

.listItem {
box-shadow: 0px -1px 0px 0px var(--colors-grey300) inset;
padding: var(--spacers-dp16);
gap: 10px;
display: flex;
justify-content: space-between;
cursor: pointer;
}

.listItem:hover {
background-color: var(--colors-grey050);
}

.listItem.selected {
background-color: var(--colors-grey100);
box-shadow: 4px 0px 0px 0px var(--colors-blue700) inset;
cursor: initial;
}

.listItem header {
font-size: 14px;
font-weight: 500;
}

.listItem .checkInfo {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 8px;
}

.listItem .subtitle {
display: flex;
align-items: flex-start;
flex-wrap: wrap;
font-size: 12px;
gap: 4px;
color: var(--colors-grey700);
}

.noItemsMessage {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
font-size: 14px;
color: var(--colors-grey700);
}

.subtitleSection {
flex-shrink: 0;
}

.statusIcon {
flex-shrink: 0;
}

.listToolbar {
display: flex;
gap: 10px;
align-items: center;
padding: var(--spacers-dp8) var(--spacers-dp8) var(--spacers-dp8)
var(--spacers-dp16);
border-width: 1px 0px 1px;
border-style: solid;
border-color: var(--colors-grey400);
}

.toolbarTabs {
border-width: 1px 0px 0px;
border-style: solid;
border-color: var(--colors-grey400);
box-shadow: none;
}

.slowCheckInfo {
font-size: 14px;
display: flex;
align-items: center;
gap: 6px;
border-inline-start: 1px solid var(--colors-grey300);
padding-inline-start: 6px;
color: var(--colors-grey700);
}

/* disable borders and shadows from UI TabBar and Tab
Prevents "double" border
*/
.toolbarTabs div,
.toolbarTabs button {
box-shadow: none;
border: none !important;
}

.errorIcon {
display: flex;
align-items: center;
gap: 4px;
font-size: 14px;
}

.searchInput {
width: 180px;
}
1 change: 1 addition & 0 deletions src/components/sectionedForm/SectionedFormBase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const SectionedFormBase = () => {}
Empty file.
Loading

0 comments on commit 2205b2e

Please sign in to comment.