-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade to ui@5 (TECH-387) (#476)
Implements TECH-387 Upgrades ui-core dep to ui@5 (which has a lot of breaking changes) Relates to dhis2/data-visualizer-app#1068 and dhis2/dashboard-app#891 Major topics: * PeriodSelector refactored to use name again * DynamicDimension refactored, note: won't work with pagination! * New stories for Filter, PeriodDimension and DynamicDimension * Any component using Transfer, SingleSelect or MultiSelect should've been updated
- Loading branch information
1 parent
24b60a0
commit 8045a6e
Showing
45 changed files
with
579 additions
and
474 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
|
||
import ItemSelector from '../components/DynamicDimension/ItemSelector' | ||
|
||
const items = [ | ||
{ id: '1', name: 'One' }, | ||
{ id: '2', name: 'Two' }, | ||
{ id: '3', name: 'Three' }, | ||
{ id: '4', name: 'Four' }, | ||
{ id: '5', name: 'Five' }, | ||
] | ||
|
||
storiesOf('DynamicDimension', module).add('ItemSelector none selected', () => { | ||
return ( | ||
<ItemSelector | ||
onSelect={selected => console.log(selected)} | ||
allItems={items} | ||
/> | ||
) | ||
}) | ||
|
||
storiesOf('DynamicDimension', module).add('ItemSelector one selected', () => { | ||
return ( | ||
<ItemSelector | ||
onSelect={selected => console.log(selected)} | ||
allItems={items} | ||
initialSelectedItemIds={[items[2].id]} | ||
/> | ||
) | ||
}) | ||
|
||
storiesOf('DynamicDimension', module).add( | ||
'ItemSelector one selected not in options', | ||
() => { | ||
return ( | ||
<> | ||
<ItemSelector | ||
onSelect={selected => console.log(selected)} | ||
allItems={items} | ||
initialSelectedItemIds={['6']} | ||
/> | ||
<p> | ||
Note: This currently does not work as ui (currently @5.0.1) | ||
does not yet support selected items that are not part of the | ||
options array{' '} | ||
<a href="https://jira.dhis2.org/browse/TECH-380"> | ||
https://jira.dhis2.org/browse/TECH-380 | ||
</a> | ||
</p> | ||
</> | ||
// TODO: fix the issue above | ||
) | ||
} | ||
) |
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,25 @@ | ||
import React, { useState } from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
|
||
import Filter from '../components/Filter/Filter' | ||
|
||
function FilterWithState() { | ||
const [text, setText] = useState(null) | ||
|
||
const onTextChange = value => setText(value) | ||
const onClearFilter = () => setText(null) | ||
return ( | ||
<Filter | ||
placeholder="Filter dimensions" | ||
text={text} | ||
onChange={onTextChange} | ||
onClear={onClearFilter} | ||
disableUnderline={true} | ||
type="search" | ||
/> | ||
) | ||
} | ||
|
||
storiesOf('Filter', module).add('default', () => { | ||
return <FilterWithState /> | ||
}) |
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
2 changes: 1 addition & 1 deletion
2
src/components/DimensionsPanel/List/styles/DimensionItem.style.js
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
2 changes: 1 addition & 1 deletion
2
src/components/DimensionsPanel/List/styles/DimensionList.style.js
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
2 changes: 1 addition & 1 deletion
2
src/components/DimensionsPanel/List/styles/RecommendedIcon.style.js
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
Oops, something went wrong.