Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix formiojs tests #145

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const getDateValidationFormat = (component: DayComponent) => {

export const isPartialDay = (component: DayComponent, value: string | undefined) => {
if (!value) {
return false;
return true;
}
const [DAY, MONTH, YEAR] = component.dayFirst ? [0, 1, 2] : [1, 0, 2];
const values = value.split('/');
Expand Down
18 changes: 9 additions & 9 deletions src/utils/formUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1129,15 +1129,15 @@ export function findComponent(components: any, key: any, path: any, fn: any) {
});
}

const isCheckboxComponent = (component: Component): component is CheckboxComponent => component.type === 'checkbox';
const isDataGridComponent = (component: Component): component is DataGridComponent => component.type === 'datagrid';
const isEditGridComponent = (component: Component): component is EditGridComponent => component.type === 'editgrid';
const isDataTableComponent = (component: Component): component is DataTableComponent => component.type === 'datatable';
const hasChildComponents = (component: any): component is HasChildComponents => component.components != null;
const isDateTimeComponent = (component: Component): component is DateTimeComponent => component.type === 'datetime';
const isSelectBoxesComponent = (component: Component): component is SelectBoxesComponent => component.type === 'selectboxes';
const isTextAreaComponent = (component: Component): component is TextAreaComponent => component.type === 'textarea';
const isTextFieldComponent = (component: Component): component is TextFieldComponent => component.type === 'textfield';
const isCheckboxComponent = (component: any): component is CheckboxComponent => component?.type === 'checkbox';
const isDataGridComponent = (component: any): component is DataGridComponent => component?.type === 'datagrid';
const isEditGridComponent = (component: any): component is EditGridComponent => component?.type === 'editgrid';
const isDataTableComponent = (component: any): component is DataTableComponent => component?.type === 'datatable';
const hasChildComponents = (component: any): component is HasChildComponents => component?.components != null;
const isDateTimeComponent = (component: any): component is DateTimeComponent => component?.type === 'datetime';
const isSelectBoxesComponent = (component: any): component is SelectBoxesComponent => component?.type === 'selectboxes';
const isTextAreaComponent = (component: any): component is TextAreaComponent => component?.type === 'textarea';
const isTextFieldComponent = (component: any): component is TextFieldComponent => component?.type === 'textfield';

export function getEmptyValue(component: Component) {
switch (component.type) {
Expand Down
Loading