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

fix typos in constants.ts, Form.tsx #4185

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ should change the heading of the (upcoming) version to include a major version b

-->

# 5.18.4

## Dev / docs / playground

- Fixed typo in `constants.ts`, `Form.tsx`

# 5.18.3

## @rjsf/semantic-ui
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
RegistryWidgetsType,
RJSFSchema,
RJSFValidationError,
RJSF_ADDITONAL_PROPERTIES_FLAG,
RJSF_ADDITIONAL_PROPERTIES_FLAG,
SchemaUtilsType,
shouldRender,
SUBMIT_BTN_OPTIONS_KEY,
Expand Down Expand Up @@ -112,7 +112,7 @@ export interface FormProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
onFocus?: (id: string, data: any) => void;
// <form /> HTML attributes
/** The value of this prop will be passed to the `accept-charset` HTML attribute on the form */
acceptcharset?: string;
acceptCharset?: string;
HanJaeJoon marked this conversation as resolved.
Show resolved Hide resolved
/** The value of this prop will be passed to the `action` HTML attribute on the form
*
* NOTE: this just renders the `action` attribute in the HTML markup. There is no real network request being sent to
Expand Down Expand Up @@ -537,7 +537,7 @@ export default class Form<
if (typeof _obj[key] === 'object') {
const newPaths = paths.map((path) => [...path, key]);
// If an object is marked with additionalProperties, all its keys are valid
if (_obj[key][RJSF_ADDITONAL_PROPERTIES_FLAG] && _obj[key][NAME_KEY] !== '') {
if (_obj[key][RJSF_ADDITIONAL_PROPERTIES_FLAG] && _obj[key][NAME_KEY] !== '') {
acc.push(_obj[key][NAME_KEY]);
} else {
getAllPaths(_obj[key], acc, newPaths);
Expand Down Expand Up @@ -870,7 +870,7 @@ export default class Form<
action,
autoComplete,
enctype,
acceptcharset,
acceptCharset,
HanJaeJoon marked this conversation as resolved.
Show resolved Hide resolved
noHtml5Validate = false,
disabled = false,
readonly = false,
Expand Down Expand Up @@ -905,7 +905,7 @@ export default class Form<
action={action}
autoComplete={autoComplete}
encType={enctype}
acceptCharset={acceptcharset}
acceptCharset={acceptCharset}
HanJaeJoon marked this conversation as resolved.
Show resolved Hide resolved
noValidate={noHtml5Validate}
onSubmit={this.onSubmit}
as={as}
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Below are the list of all the keys into various elements of a RJSFSchema or UiSchema that are used by the various
* utility functions. In addition to those keys, there are the special `ADDITIONAL_PROPERTY_FLAG` and
* `RJSF_ADDITONAL_PROPERTIES_FLAG` flags that is added to a schema under certain conditions by the `retrieveSchema()`
* `RJSF_ADDITIONAL_PROPERTIES_FLAG` flags that is added to a schema under certain conditions by the `retrieveSchema()`
* utility.
*/
export const ADDITIONAL_PROPERTY_FLAG = '__additional_property';
Expand All @@ -23,7 +23,7 @@ export const PROPERTIES_KEY = 'properties';
export const REQUIRED_KEY = 'required';
export const SUBMIT_BTN_OPTIONS_KEY = 'submitButtonOptions';
export const REF_KEY = '$ref';
export const RJSF_ADDITONAL_PROPERTIES_FLAG = '__rjsf_additionalProperties';
export const RJSF_ADDITIONAL_PROPERTIES_FLAG = '__rjsf_additionalProperties';
HanJaeJoon marked this conversation as resolved.
Show resolved Hide resolved
export const ROOT_SCHEMA_PREFIX = '__rjsf_rootSchema';
export const UI_FIELD_KEY = 'ui:field';
export const UI_WIDGET_KEY = 'ui:widget';
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/schema/toPathSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ONE_OF_KEY,
PROPERTIES_KEY,
REF_KEY,
RJSF_ADDITONAL_PROPERTIES_FLAG,
RJSF_ADDITIONAL_PROPERTIES_FLAG,
} from '../constants';
import getDiscriminatorFieldFromSchema from '../getDiscriminatorFieldFromSchema';
import { FormContextType, PathSchema, RJSFSchema, StrictRJSFSchema, ValidatorType } from '../types';
Expand Down Expand Up @@ -69,7 +69,7 @@ function toPathSchemaInternal<T = any, S extends StrictRJSFSchema = RJSFSchema,
}

if (ADDITIONAL_PROPERTIES_KEY in schema && schema[ADDITIONAL_PROPERTIES_KEY] !== false) {
set(pathSchema, RJSF_ADDITONAL_PROPERTIES_FLAG, true);
set(pathSchema, RJSF_ADDITIONAL_PROPERTIES_FLAG, true);
}

if (ITEMS_KEY in schema && Array.isArray(formData)) {
Expand Down
4 changes: 2 additions & 2 deletions packages/validator-ajv8/src/createAjvInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import addFormats, { FormatsPluginOptions } from 'ajv-formats';
import isObject from 'lodash/isObject';

import { CustomValidatorOptionsType } from './types';
import { ADDITIONAL_PROPERTY_FLAG, RJSF_ADDITONAL_PROPERTIES_FLAG } from '@rjsf/utils';
import { ADDITIONAL_PROPERTY_FLAG, RJSF_ADDITIONAL_PROPERTIES_FLAG } from '@rjsf/utils';

export const AJV_CONFIG: Options = {
allErrors: true,
Expand Down Expand Up @@ -50,7 +50,7 @@ export default function createAjvInstance(

// Add RJSF-specific additional properties keywords so Ajv doesn't report errors if strict is enabled.
ajv.addKeyword(ADDITIONAL_PROPERTY_FLAG);
ajv.addKeyword(RJSF_ADDITONAL_PROPERTIES_FLAG);
ajv.addKeyword(RJSF_ADDITIONAL_PROPERTIES_FLAG);

// add more schemas to validate against
if (Array.isArray(additionalMetaSchemas)) {
Expand Down