-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(list): resolve reference names (#360)
* feat(datastore): add hook for accessing datastore * fix(types): fix types for section handle * feat(constants): add constants for columns and translated properties * fix: update types for sectionlistcolumns * fix: add selector to usedatastore * feat(managecolumns): manage columns implementation * fix: integrate selectedcoluns with list * fix: mergecolumns * fix: managecolumns style * refactor: managecolumns * chore: add remeda util lib * refactor: refactor to config for listviews * refactor: manage list view * fix: respect order of selected columns * fix(datastore): always use put for datastore * refactor: allow arbitrary path as column * refactor: remove remeda, implement uniqueBy * fix: add uniqueBy * fix: add test for path * fix: add maxDepth to getFieldFilterFromPath * fix: fix some tests * fix: remove typepath file * refactor: cleanup * fix(constants): prevent circular dependency (#354) * fix(managelistview): enforce at least one column * refactor: rename DataStoreModelListView schema * refactor: rename useDataStoreValuesQuery * refactor(modelvale): simplify modelvalue * fix: fix imports * refactor: remove component from list config * fix: fix tests * refactor: minor cleanup * feat(detailpanel): initial detailsPanel implementation * refactor(detailspanel): cleanup details panel implementation, add error-boundary * fix: responsive layout with detailspanel * refactor: fix wrong name of sectionlistheader * refactor: minor cleanup * fix: fix id missing in details response * fix: add ui to resolution for alpha version * fix: fix type errors * refactor(details): make detailspanelcontent more composable * fix(list): rename to value type in list * fix: add type fro modelcollectionresponse * fix(list): resolve displayName for reference columns * fix(details): add created by field * fix: conlict in i18n * refactor: cleanup ts-ignore * fix: fix bad merge * fix(list): parse query filter * refactor: remove useModelGist * fix(test): fix list tests * fix(test): add missing mock files * refactor: some cleanup * fix(modelview): validate prevdata before saving --------- Co-authored-by: Jan-Gerke Salomon <[email protected]>
- Loading branch information
Showing
18 changed files
with
427 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import i18n from '@dhis2/d2-i18n' | ||
import React from 'react' | ||
|
||
type ModelReference = { | ||
id: string | ||
displayName: string | ||
} | ||
|
||
export const isModelReference = (value: unknown): value is ModelReference => { | ||
const asModelReference = value as ModelReference | ||
return !!asModelReference.displayName && !!asModelReference.id | ||
} | ||
|
||
export const ModelReference = ({ value }: { value?: ModelReference }) => { | ||
let displayValue = value?.displayName | ||
// default categoryCombos should display as None | ||
if (displayValue === 'default') { | ||
displayValue = i18n.t('None') | ||
} | ||
return <span>{displayValue}</span> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
export { useModelGist } from './useModelGist' | ||
export type { | ||
GistPaginator, | ||
GistParams, | ||
UseModelGistResultPaginated, | ||
UseModelGistResult, | ||
} from './useModelGist' | ||
export { isValidUid } from './uid' | ||
export { parsePublicAccessString } from './parsePublicAccess' | ||
export { getIn, stringToPathArray, getFieldFilterFromPath } from './path' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.