-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 3654 - History: User interface, part 1 (#3657) * 3654 - pt1 ui and placeholder * use flex * remove extra comments * deepscan * update button History display logic * add DataSelector.History * update toggle history * 3654 - History: User interface, part 2 [RFC] (#3670) * add NavigationHistory component * add nav component * 3654 - History: Refactor folder structure and separate concerns (#3683) * 3654 - NavigationHistory -> History * 3654 - useHistoryActive -> useIsHistoryActive * 3654 - separate concerns for History (Hooks, Items) * 3654 - move history to NavAssessment * remove unnecessary filter * fix imports * 3654 - History: Minimal History layout (#3688) * 3654 - return type * 3654 - fix History Navigation classes * 3654 - minimal history layout * 3654 History: Add Endpoint for History (#3689) * 3654 - initial commit for history backend * use req.params for sectionName and target * 3654 - use history endpoint * 3654 - include user * 3654 - History: Show selected history entry (#3694) * 3654 - show history data on selecting history item * remove unused comment string * 3654 - reset to original state (#3695) * requireViewHistory (#3699) * fix old activity log for datasources (#3703) * 3696 - reset history on navigate (#3704) * 3654 - Update History UI (#3708) * 3654 -Remove sectionName from HistoryTarget + Rename ButtonType blackMap -> black (#3722) * 3654 - Remove sectionName from HistoryTarget * 3654 - Rename ButtonType black -> blackMap * 3654 - History: Fix old data source entries migration step (#3724) * fix migration data-sources-reference-to-text-only * use processEnv and nullcheck appUri * 3654 - History: Use TablePaginated (#3727) * 3654 - History: Use TablePaginated * 3654 - fix deepscan * 3654 - Add state history compare item + button ui (#3732) * 3654 - History: compare data sources (#3734) * 3654 - History: compare data sources * 3654 - History: reset table paginated data * 3654 - Fix deepscan * 3654 - Fix deepscan * 3654 - Update comments * 3654 - update UI * 3654 - History: Skeleton loader + Custom Counter (#3741) * 3654 - History: Skeleton loader + Custom Counter * 3654 - History: change/s en * 3654 - History: Update translations + refactor/cleanup Select (#3749) * 3654 - History: refactor/cleanup Select * 3654 - update navigation border right style * 3654 - update translations --------- Co-authored-by: Mino Togna <minotogna@users.noreply.github.com> Co-authored-by: minotogna <mino.togna@gmail.com>
- Loading branch information
1 parent
497a1d7
commit af88835
Showing
125 changed files
with
1,710 additions
and
262 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
31 changes: 31 additions & 0 deletions
31
src/client/components/Inputs/Select/hooks/useClassNames.ts
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,31 @@ | ||
import { useMemo } from 'react' | ||
import { Props as ReactSelectProps } from 'react-select' | ||
|
||
import classNames from 'classnames' | ||
|
||
import { SelectProps } from 'client/components/Inputs/Select/types' | ||
|
||
type Returned = ReactSelectProps['classNames'] | ||
|
||
export const useClassNames = (props: SelectProps): Returned => { | ||
const { classNames: classes } = props | ||
|
||
return useMemo<Returned>(() => { | ||
return { | ||
container: () => classNames('select__container', classes?.container), | ||
control: ({ isDisabled, isFocused }) => classNames('select__control', { isDisabled, isFocused }), | ||
group: () => 'select__group', | ||
groupHeading: () => 'select__groupHeading', | ||
input: ({ isDisabled }) => classNames('select__input', { isDisabled }), | ||
menu: ({ placement }) => classNames('select__menu', placement), | ||
menuList: () => classNames('select__menuList'), | ||
multiValue: ({ isDisabled }) => classNames('select__multiValue', { isDisabled }), | ||
multiValueLabel: ({ isDisabled }) => classNames('select__multiValueLabel', { isDisabled }), | ||
multiValueRemove: ({ isDisabled }) => classNames('select__multiValueRemove', { isDisabled }), | ||
option: ({ isFocused, isMulti, isSelected }) => classNames('select__option', { isFocused, isMulti, isSelected }), | ||
placeholder: () => `select__placeholder`, | ||
singleValue: () => 'select__singleValue', | ||
valueContainer: () => 'select__valueContainer', | ||
} | ||
}, [classes?.container]) | ||
} |
26 changes: 26 additions & 0 deletions
26
src/client/components/Inputs/Select/hooks/useComponents.ts
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,26 @@ | ||
import { useMemo } from 'react' | ||
import { Props as ReactSelectProps } from 'react-select' | ||
|
||
import { | ||
ClearIndicator, | ||
DropdownIndicator, | ||
IndicatorsContainer, | ||
MultiSelectOption, | ||
} from 'client/components/Inputs/Select/Indicators' | ||
import { SelectProps } from 'client/components/Inputs/Select/types' | ||
|
||
type Returned = ReactSelectProps['components'] | ||
|
||
export const useComponents = (props: SelectProps): Returned => { | ||
const { isMulti } = props | ||
|
||
return useMemo<Returned>(() => { | ||
return { | ||
ClearIndicator, | ||
DropdownIndicator, | ||
IndicatorsContainer, | ||
IndicatorSeparator: null, | ||
Option: isMulti ? MultiSelectOption : null, | ||
} | ||
}, [isMulti]) | ||
} |
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,17 @@ | ||
import { useMemo } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
import { ToggleAllOptions } from 'client/components/Inputs/Select/toggleAllOptions' | ||
import { OptionsOrGroups, SelectProps } from 'client/components/Inputs/Select/types' | ||
|
||
export const useOptions = (props: SelectProps): OptionsOrGroups => { | ||
const { isMulti, options, toggleAll, value } = props | ||
|
||
const { t } = useTranslation() | ||
|
||
return useMemo<OptionsOrGroups>(() => { | ||
if (!isMulti || !toggleAll) return options | ||
|
||
return [ToggleAllOptions.newOption({ value, t }), ...options] | ||
}, [isMulti, options, t, toggleAll, value]) | ||
} |
38 changes: 0 additions & 38 deletions
38
src/client/components/Inputs/Select/hooks/useToggleAllConfig.ts
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
import { TFunction } from 'i18next' | ||
|
||
import { Option, ValueInput } from 'client/components/Inputs/Select/types' | ||
|
||
const VALUE = '*' | ||
|
||
const newOption = (props: { value: ValueInput; t: TFunction }): Option => { | ||
const { value, t } = props | ||
|
||
const label = Array.isArray(value) && value.length === 0 ? t('common.selectAll') : t('common.unselectAll') | ||
return { label, value: VALUE } | ||
} | ||
|
||
export const ToggleAllOptions = { | ||
VALUE, | ||
newOption, | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/client/components/Navigation/NavAssessment/History/History.tsx
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,22 @@ | ||
import React from 'react' | ||
|
||
import { useHistory } from 'client/store/data/hooks/useHistory' | ||
import Items from 'client/components/Navigation/NavAssessment/History/Items' | ||
|
||
import { useResetHistory } from './hooks/useResetHistory' | ||
|
||
const History: React.FC = () => { | ||
const history = useHistory() | ||
|
||
useResetHistory() | ||
|
||
return ( | ||
<div> | ||
{Object.entries(history.items).map(([key, items]) => { | ||
return <Items key={key} items={items} /> | ||
})} | ||
</div> | ||
) | ||
} | ||
|
||
export default History |
Oops, something went wrong.