Skip to content

Commit

Permalink
fix: Updated unique value consideration logic to treat empty, null,…
Browse files Browse the repository at this point in the history
… u… (#501)

…ndefined values as value
  • Loading branch information
chavda-bhavik authored Feb 13, 2024
2 parents 65c89c4 + aad6547 commit 2dad04d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class BaseReview {
// uniqueCheck
case error.keyword === 'uniqueCheck':
case error.keyword === 'uniqueItemProperties':
message = `${String(data)} already exist in column, it must be unique`;
message = `${String(data)} already taken! Please enter unique value`;
break;
// custom date format
case error.keyword === 'format' && error.params.format === 'custom-date-time':
Expand Down Expand Up @@ -365,9 +365,7 @@ export class BaseReview {
keyword: 'uniqueCheck',
schema: false, // keyword value is not used, can be true
validate: function (data: any, dataPath: AnySchemaObject) {
if (!String(data)) {
return true;
}
if (!data) return true;
if (uniqueItems[dataPath.parentDataProperty].has(data)) {
return false;
}
Expand Down
10 changes: 4 additions & 6 deletions apps/web/design-system/custom-select/CustomSelect.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@ interface Params {
size: MantineSize;
}

export default createStyles((theme: MantineTheme, params: Params): Record<string, any> => {
console.log(theme.colors);

return {
export default createStyles(
(theme: MantineTheme, params: Params): Record<string, any> => ({
root: getRootStyles(),
label: getLabelStyles(theme),
description: getDescriptionStyles(theme),
Expand All @@ -102,5 +100,5 @@ export default createStyles((theme: MantineTheme, params: Params): Record<string
input: getInputStyles(theme, params.size),
itemsWrapper: getSelectItemsWrapper(theme),
item: getSelectItemStyles(theme, params.size),
};
});
})
);

0 comments on commit 2dad04d

Please sign in to comment.