-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(detailsPanel): add detailsPanel in list-view #358
Merged
Merged
Changes from 48 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
fe4bdfa
feat(datastore): add hook for accessing datastore
Birkbjo f53db76
fix(types): fix types for section handle
Birkbjo 6231edb
feat(constants): add constants for columns and translated properties
Birkbjo 29dad8a
fix: update types for sectionlistcolumns
Birkbjo 5702039
fix: add selector to usedatastore
Birkbjo 3156dd1
feat(managecolumns): manage columns implementation
Birkbjo 8a08d34
fix: integrate selectedcoluns with list
Birkbjo fd3b02c
fix: mergecolumns
Birkbjo a7c1c6c
fix: managecolumns style
Birkbjo 8ee8c0a
refactor: managecolumns
Birkbjo 38f22e6
chore: add remeda util lib
Birkbjo befd522
refactor: refactor to config for listviews
Birkbjo e799d2b
refactor: manage list view
Birkbjo fbb1a20
fix: respect order of selected columns
Birkbjo d3c4625
fix(datastore): always use put for datastore
Birkbjo c39fd99
Merge branch 'master' into DHIS2-15562/manage-columns
Birkbjo 14c7c05
refactor: allow arbitrary path as column
Birkbjo 4858135
refactor: remove remeda, implement uniqueBy
Birkbjo 5df49bd
fix: add uniqueBy
Birkbjo dbc4f82
fix: add test for path
Birkbjo 0f6efc0
fix: add maxDepth to getFieldFilterFromPath
Birkbjo a88586e
fix: fix some tests
Birkbjo 85dff70
fix: remove typepath file
Birkbjo 2d07750
refactor: cleanup
Birkbjo 63ae5b9
fix(constants): prevent circular dependency (#354)
Mohammer5 f767ac2
fix(managelistview): enforce at least one column
Birkbjo 02e96ea
refactor: rename DataStoreModelListView schema
Birkbjo ebe3c28
refactor: rename useDataStoreValuesQuery
Birkbjo c34f3ba
Merge branch 'master' into DHIS2-15562/manage-columns
Birkbjo 5f3aae3
refactor(modelvale): simplify modelvalue
Birkbjo 25568ed
fix: fix imports
Birkbjo ebec718
refactor: remove component from list config
Birkbjo cc8de37
fix: fix tests
Birkbjo b1551c0
refactor: minor cleanup
Birkbjo 8d18a7a
Merge branch 'master' into DHIS2-15562/manage-columns
Birkbjo 438c64c
feat(detailpanel): initial detailsPanel implementation
Birkbjo cf1f18e
refactor(detailspanel): cleanup details panel implementation, add err…
Birkbjo 7ac06cd
fix: responsive layout with detailspanel
Birkbjo f3da8ed
refactor: fix wrong name of sectionlistheader
Birkbjo 6771447
refactor: minor cleanup
Birkbjo c4ccbb5
fix: fix id missing in details response
Birkbjo 66f56e9
fix: add ui to resolution for alpha version
Birkbjo 01c3401
fix: fix type errors
Birkbjo 5b7b519
Merge branch 'master' into DHIS2-14652/feat/details-panel
Birkbjo 5e4e8f9
refactor(details): make detailspanelcontent more composable
Birkbjo 2e01ab4
fix(details): use correct property for lastUpdated
Birkbjo dead6f4
fix(details): add lastupdatedby
Birkbjo 7fd98e3
fix(details): add createdBy, fallback to created if no lastUpdatedBy
Birkbjo 8cb0c0c
fix(list): list header as grid-member
Birkbjo ea703c9
fix(test): fix failing test
Birkbjo b3d0899
chore(deps): update ui alpha version
Birkbjo 983c653
fix(types): fix wrong types
Birkbjo 503cc90
Merge branch 'master' into DHIS2-14652/feat/details-panel
Birkbjo 148b322
Merge branch 'master' into DHIS2-14652/feat/details-panel
Birkbjo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export * from './Sidenav' | ||
export { SidenavFilter } from './SidenavFilter' | ||
export type { OnChangeInput, OnChangeCallback } from './SidenavFilter' |
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,38 @@ | ||
import { useTimeZoneConversion } from '@dhis2/app-runtime' | ||
import React, { useState } from 'react' | ||
import { selectedLocale } from '../../lib' | ||
|
||
type DateTimeFormatOptions = Intl.DateTimeFormatOptions | ||
|
||
const defaultDateTimeFormatter = new Intl.DateTimeFormat(selectedLocale, { | ||
dateStyle: 'medium', | ||
timeStyle: 'medium', | ||
}) | ||
|
||
type ClientDateTimeProps = { | ||
value?: string | ||
options?: DateTimeFormatOptions | ||
} | ||
|
||
export const ClientDateTime = ({ value, options }: ClientDateTimeProps) => { | ||
// NOTE: options cannot change after initial render | ||
// this is to prevent having to memo the options object in the consuming component | ||
const [dateTimeFormatter] = useState<Intl.DateTimeFormat>(() => | ||
options | ||
? new Intl.DateTimeFormat(selectedLocale, options) | ||
: defaultDateTimeFormatter | ||
) | ||
const { fromServerDate } = useTimeZoneConversion() | ||
|
||
if (!value) { | ||
return null | ||
} | ||
|
||
const clientDate = fromServerDate(value) | ||
|
||
return ( | ||
<span title={clientDate.getClientZonedISOString()}> | ||
{dateTimeFormatter.format(clientDate)} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ClientDateTime' |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is alpha up2date with ui@master? I suppose that in that case this is fine, otherwise it might cause issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to wait until including this? Maybe in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah maybe you could extract the upgrade to ui@alpha and we handle adding the details panel separate from that (but we can keep the fixes for wrong prop usage here, would be a shame to have those)