Skip to content

Commit

Permalink
refactor: use strings directly instead of wrapping in an object
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkrulltott committed Feb 26, 2024
1 parent 51ace42 commit 7868787
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions src/components/Dialogs/Conditions/AlphanumericCondition.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const BaseCondition = ({
key={key}
value={key}
label={value}
dataTest={'alphanumeric-condition-type'}
dataTest="alphanumeric-condition-type"
/>
)
)}
Expand All @@ -105,7 +105,7 @@ const BaseCondition = ({
onChange={({ checked }) => toggleCaseSensitive(checked)}
dense
className={classes.caseSensitiveCheckbox}
dataTest={'condition-case-sensitive-checkbox'}
dataTest="condition-case-sensitive-checkbox"
/>
)}
<Button
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialogs/Conditions/ConditionsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ const ConditionsManager = ({
content={i18n.t(
'Only available for repeatable stages'
)}
dataTest={'repeatable-events-tooltip'}
dataTest="repeatable-events-tooltip"
>
{repeatableTab}
</Tooltip>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialogs/Conditions/DateCondition.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const BaseCondition = ({ condition, onChange, onRemove, type, max }) => {
key={key}
value={key}
label={value}
dataTest={'date-condition-type'}
dataTest="date-condition-type"
/>
))}
</SingleSelectField>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dialogs/Conditions/NumericCondition.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const NumericCondition = ({
key={key}
value={key}
label={value}
dataTest={'numeric-condition-type'}
dataTest="numeric-condition-type"
/>
))}
<MenuDivider dense />
Expand All @@ -141,7 +141,7 @@ const NumericCondition = ({
value={OPERATOR_IN}
label={i18n.t('is one of preset options')}
disabled={numberOfConditions > 1}
dataTest={'numeric-condition-type'}
dataTest="numeric-condition-type"
/>
</SingleSelectField>
{operator &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialogs/Conditions/OrgUnitCondition.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const OrgUnitCondition = ({
].filter((path) => path)}
selected={selected.path && [selected.path]}
onChange={(item) => setValues(item)}
dataTest={'org-unit-tree'}
dataTest="org-unit-tree"
singleSelection
/>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dialogs/Conditions/RepeatableEvents.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const RepeatableEvents = ({ dimensionId }) => {
value={mostRecent.toString()}
onChange={({ value }) => onMostRecentChange(value)}
min="0"
dataTest={'most-recent-input'}
dataTest="most-recent-input"
/>
</div>
<div className={classes.repeatableWrapper}>
Expand All @@ -103,7 +103,7 @@ const RepeatableEvents = ({ dimensionId }) => {
value={oldest.toString()}
onChange={({ value }) => onOldestChange(value)}
min="0"
dataTest={'oldest-input'}
dataTest="oldest-input"
/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialogs/DynamicDimension.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const DynamicDimension = ({

return dimension ? (
<DimensionModal
dataTest={'dynamic-dimension-modal'}
dataTest="dynamic-dimension-modal"
isInLayout={isInLayout}
onClose={closeModal}
title={dimension.name}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dialogs/FixedDimension.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const FixedDimension = ({
}
dense
className={classes.verticalCheckbox}
dataTest={'program-status-checkbox'}
dataTest="program-status-checkbox"
/>
))}
</div>
Expand Down Expand Up @@ -199,7 +199,7 @@ const FixedDimension = ({
}
dense
className={classes.verticalCheckbox}
dataTest={'event-status-checkbox'}
dataTest="event-status-checkbox"
/>
))}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialogs/PeriodDimension/PeriodDimension.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const PeriodDimension = ({ dimension, onClose }) => {

return dimension ? (
<DimensionModal
dataTest={'period-dimension-modal'}
dataTest="period-dimension-modal"
isInLayout={isInLayout}
onClose={onClose}
title={dimension.name}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dialogs/PeriodDimension/StartEndDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const StartEndDate = ({
label={i18n.t('Start date')}
inputWidth="200px"
max="9999-12-31"
dataTest={'start-date-input'}
dataTest="start-date-input"
/>
<div className={styles.icon}>
<IconArrowRight16 color={colors.grey500} />
Expand All @@ -48,7 +48,7 @@ export const StartEndDate = ({
label={i18n.t('End date')}
inputWidth="200px"
max="9999-12-31"
dataTest={'end-date-input'}
dataTest="end-date-input"
/>
</div>
</Field>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialogs/common/TransferLeftHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const TransferLeftHeader = ({ searchTerm, setSearchTerm, dataTest }) => (
dataTest={`${dataTest}-filter-input-field`}
dense
initialFocus
type={'search'}
type="search"
/>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/MainSidebar/MainDimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const MainDimensions = () => {
return (
<MainSidebarSection
header={i18n.t('Global dimensions')}
dataTest={'main-dimensions-sidebar'}
dataTest="main-dimensions-sidebar"
>
{draggableDimensions.map((dimension) => (
<span className={styles.span} key={dimension.id}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/MainSidebar/MainSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const MainSidebar = () => {
)}
{!(selectedProgramId || selectedEntityTypeId) ? (
<Tooltip
dataTest={'no-input-tooltip'}
dataTest="no-input-tooltip"
content={i18n.t('Choose an input first')}
closeDelay={0}
placement="bottom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ProgramDimensions = () => {
return (
<MainSidebarSection
header={i18n.t('Program dimensions')}
dataTest={'program-dimensions'}
dataTest="program-dimensions"
>
{draggableDimensions.map((dimension) => (
<span key={dimension.id} className={styles.span}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const ProgramDimensionsFilter = ({
value={searchTerm}
onChange={({ value }) => setSearchTerm(value)}
dense
type={'search'}
type="search"
placeholder={i18n.t('Search data dimensions')}
/>
<SingleSelect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const StageFilter = ({ stages, selected, setSelected }) => {
dense
selected={selected || STAGE_ALL}
onChange={onChange}
dataTest={'stage-select'}
dataTest="stage-select"
>
<SingleSelectOption label={i18n.t('All')} value={STAGE_ALL} />
{stages.map(({ id, name }) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const StageSelect = ({ stages }) => {
dense
selected={selectedStageId}
onChange={onChange}
dataTest={'stage-select'}
dataTest="stage-select"
filterable
noMatchText={i18n.t('No stages found')}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const TypeSelect = () => {
onChange={({ selected }) => setSelectedTypeId(selected)}
placeholder={i18n.t('Choose a type')}
maxHeight="max(60vh, 460px)"
dataTest={'type-select'}
dataTest="type-select"
filterable
noMatchText={i18n.t('No types found')}
loading={fetching}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const TrackedEntityDimensionsMenuItem = ({
onClick={onClick}
selected={selected}
count={count}
dataTest={'tracked-entity-button'}
dataTest="tracked-entity-button"
/>
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const TrackedEntityDimensionsPanel = ({ visible }) => {
onChange={({ value }) => setSearchTerm(value)}
dense
placeholder={i18n.t('Search dimensions')}
type={'search'}
dataTest={'search-te-dimension-input'}
type="search"
dataTest="search-te-dimension-input"
/>
<div className={styles.programSelect}>
<ProgramFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const YourDimensionsPanel = ({ visible }) => {
onChange={({ value }) => setSearchTerm(value)}
dense
placeholder={i18n.t('Search your dimensions')}
type={'search'}
dataTest={'search-dimension-input'}
type="search"
dataTest="search-dimension-input"
/>
</div>
<DimensionsList
Expand Down
10 changes: 5 additions & 5 deletions src/components/Visualization/Visualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export const Visualization = ({
)
: undefined
}
dataTest={'table-cell'}
dataTest="table-cell"
>
<div
style={
Expand Down Expand Up @@ -544,7 +544,7 @@ export const Visualization = ({
sizeClass,
'bordered'
)}
dataTest={'table-header'}
dataTest="table-header"
>
{formatCellHeader(header)}
</DataTableColumnHeader>
Expand All @@ -558,18 +558,18 @@ export const Visualization = ({
fontSizeClass,
sizeClass
)}
dataTest={'table-header'}
dataTest="table-header"
/>
)
)}
</DataTableRow>
</DataTableHead>
{/* https://jira.dhis2.org/browse/LIBS-278 */}
<DataTableBody dataTest={'table-body'}>
<DataTableBody dataTest="table-body">
{data.rows.map((row, rowIndex) => (
<DataTableRow
key={rowIndex}
dataTest={'table-row'}
dataTest="table-row"
>
{row.map((value, columnIndex) =>
cellIsUndefined(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const LegendDisplayStyle = () => (
label: i18n.t('Legend changes text color'),
},
]}
dataTest={'legend-display-style'}
dataTest="legend-display-style"
/>
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const ShowLegendKey = () => (
option={{
name: OPTION_SHOW_LEGEND_KEY,
}}
dataTest={'option-legend-key'}
dataTest="option-legend-key"
/>
)

Expand Down

0 comments on commit 7868787

Please sign in to comment.