Skip to content

Commit

Permalink
refactor: more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Nov 6, 2024
1 parent 6b68b6d commit d219ad6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 125 deletions.
86 changes: 0 additions & 86 deletions src/components/sectionedForm/SectionFormSidebar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,89 +21,3 @@
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;
}
20 changes: 0 additions & 20 deletions src/lib/form/sectionedForm/useSelectedSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,3 @@ export const useSelectedSection = () => {
removeDefaultsFromUrl: true,
})
}

/* Helper to create a type-safe hook for useSelectedSection */
export const createUseSelectedSection = <
TSection extends string,
TDefault extends TSection
>(
sections: TSection[],
defaultSection: TDefault
) => {
const queryParamType = withDefault(
createEnumParam<TSection>(sections),
defaultSection
)
const useSelectedSection = () => {
return useQueryParam(FORM_SECTION_PARAM_KEY, queryParamType, {
removeDefaultsFromUrl: true,
})
}
return useSelectedSection
}
17 changes: 0 additions & 17 deletions src/lib/form/types.ts

This file was deleted.

5 changes: 3 additions & 2 deletions src/pages/dataSets/form/fieldFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DataSet, PickWithFieldFilters } from '../../../types/generated'
const fieldFilters = [
...DEFAULT_FIELD_FILTERS,
...ATTRIBUTE_VALUES_FIELD_FILTERS,
'categoryCombos[id,displayName]',
'categoryCombo[id,displayName]',
'dataElementDecoration',
'dataEntryForm[id]',
'dataInputPeriods',
Expand All @@ -22,12 +22,13 @@ const fieldFilters = [
'renderAsTabs',
'renderHorizontally',
'sections',
'style',
'skipOffline',
'timelyDays',
'validCommpleteOnly',
] as const

// DisplayOptions are handld by client only
// DisplayOptions are handled by client only, and thus dont have a generated type
// TODO: this should have a zod-schema and validation
type DisplayOptions = Record<string, unknown>

Expand Down

0 comments on commit d219ad6

Please sign in to comment.