Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
JabX committed Jan 26, 2024
1 parent 7c1a426 commit 9315d7a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/collections/src/list/contextual-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function ContextualActions({
icon={
(isMosaic || !Operation.type || Operation.type.includes("icon")
? Operation.icon
: undefined) as Icon
: undefined)!
}
label={!isMosaic && FinalButton === Button ? Operation.label : undefined}
onBlur={tryHideMenu}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/network/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/prefer-promise-reject-errors */
import {isObject, merge, toPairs} from "lodash";

import {config} from "../utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/src/components/select-radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function SelectRadio<T extends DomainFieldType>({

return (
<RadioButton
key={optVal || "undefined"}
key={optVal ?? "undefined"}
label={i18next.t(optLabel)}
name={`${name!}-${optVal}`}
theme={theme}
Expand Down
10 changes: 5 additions & 5 deletions packages/forms/src/fields/field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export function Field<F extends FieldEntry>(props: FieldComponents & FieldOption
id={id}
label={label}
style={!disableInlineSizing ? {width: `${labelRatio}%`} : {}}
theme={themeable({label: theme.label()}, domainLCP.theme || {}, labelProps.theme || {})}
theme={themeable({label: theme.label()}, domainLCP.theme ?? {}, labelProps.theme ?? {})}
/>
) : null}
<div
Expand All @@ -209,21 +209,21 @@ export function Field<F extends FieldEntry>(props: FieldComponents & FieldOption
{...domainSCP}
{...selectProps}
{...iProps}
theme={themeable(domainSCP.theme || {}, selectProps.theme || {})}
theme={themeable(domainSCP.theme ?? {}, selectProps.theme ?? {})}
/>
) : inputType === "autocomplete" ? (
<AutocompleteComponent
{...domainACP}
{...autocompleteProps}
{...iProps}
theme={themeable(domainACP.theme || {}, autocompleteProps.theme || {})}
theme={themeable(domainACP.theme ?? {}, autocompleteProps.theme ?? {})}
/>
) : (
<InputComponent
{...domainICP}
{...inputProps}
{...iProps}
theme={themeable(domainICP.theme || {}, inputProps.theme || {})}
theme={themeable(domainICP.theme ?? {}, inputProps.theme ?? {})}
/>
)
) : (
Expand All @@ -232,7 +232,7 @@ export function Field<F extends FieldEntry>(props: FieldComponents & FieldOption
{...displayProps}
formatter={displayFormatter}
keyResolver={autocompleteProps.keyResolver}
theme={themeable(domainDCP.theme || {}, displayProps.theme || {})}
theme={themeable(domainDCP.theme ?? {}, displayProps.theme ?? {})}
type={type}
value={value}
values={selectProps.values}
Expand Down
4 changes: 2 additions & 2 deletions packages/legacy/src/entity/auto-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ export abstract class AutoForm<P, ST extends StoreListNode | StoreNode> extends
const data = await load(...params);
runInAction(() => {
if (isStoreListNode(this.storeData)) {
this.storeData.replaceNodes(data || []);
this.storeData.replaceNodes(data ?? []);
} else {
this.storeData.replace(data || {});
this.storeData.replace(data ?? {});
}
this.isLoading = false;
});
Expand Down
2 changes: 1 addition & 1 deletion packages/stores/src/entity/string-for.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ export function stringFor<F extends FieldEntry>(field: EntityField<F>, values: R
}
} = field;
const found = values.find(val => val[values.$valueKey] === value);
const processedValue = found?.[values.$labelKey] || value;
const processedValue = found?.[values.$labelKey] ?? value;
return displayFormatter(processedValue);
}
6 changes: 3 additions & 3 deletions packages/stores/src/reference/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export function makeReferenceStore<T extends Record<string, ReferenceDefinition>
for (const ref in refConfig) {
// On initialise un champ "caché" qui contient la liste de référence, avec une liste vide, ainsi que les clés de valeur et libellé, le résolveur de libellé et la surcharge de filter.
referenceStore[`_${ref}`] = observable.array([], {deep: false});
referenceStore[`_${ref}`].$valueKey = refConfig[ref].valueKey || "code";
referenceStore[`_${ref}`].$labelKey = refConfig[ref].labelKey || "label";
referenceStore[`_${ref}`].$valueKey = refConfig[ref].valueKey ?? "code";
referenceStore[`_${ref}`].$labelKey = refConfig[ref].labelKey ?? "label";
referenceStore[`_${ref}`].getLabel = (value: any) => getLabel(value, referenceStore[`_${ref}`]);
referenceStore[`_${ref}`].filter = (callbackFn: any) => filter(referenceStore[`_${ref}`], callbackFn);
referenceStore[`_${ref}_trackingIds`] = new Map<string, string[]>();
Expand Down Expand Up @@ -91,7 +91,7 @@ export function makeReferenceStore<T extends Record<string, ReferenceDefinition>
}
};

referenceStore.track = (trackingIds: string | string[], ...refNames: (string & keyof T)[]) => {
referenceStore.track = (trackingIds: string[] | string, ...refNames: (string & keyof T)[]) => {
if (!refNames.length) {
refNames = Object.keys(refConfig);
}
Expand Down

0 comments on commit 9315d7a

Please sign in to comment.