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: Validation when creating a new data model #14049

Merged
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
101657f
Move validation logic into hook
ErlingHauan Nov 11, 2024
71222a1
Remove period and space from regex
ErlingHauan Nov 11, 2024
289aeb4
Add separate case for empty name
ErlingHauan Nov 11, 2024
e554177
Rename createNewOpen --> isCreateNewOpen
ErlingHauan Nov 11, 2024
60dd1d5
Clear error on reopened popover, and autofocus input field
ErlingHauan Nov 11, 2024
718d122
Add check for max length
ErlingHauan Nov 11, 2024
8b0fa8e
Add check for C# reserved keyword
ErlingHauan Nov 12, 2024
4706506
Write tests for useValidateSchemaName
ErlingHauan Nov 13, 2024
f9c3df6
Update text resources
ErlingHauan Nov 13, 2024
099eff3
Fix bug where invalid model could be created with enter key
ErlingHauan Nov 14, 2024
9b5f3dd
Move hooks into 'hooks' folder
ErlingHauan Nov 14, 2024
c9864ae
Merge branch 'main' into 13364-validation-issues-when-creating-a-new-…
ErlingHauan Nov 14, 2024
539a955
Fix PR comments
ErlingHauan Nov 18, 2024
d655960
Merge branch 'main' into 13364-validation-issues-when-creating-a-new-…
ErlingHauan Nov 18, 2024
8a9b1ab
Fix type import
ErlingHauan Nov 18, 2024
8786bf9
Merge branch '13364-validation-issues-when-creating-a-new-model' of h…
ErlingHauan Nov 18, 2024
3f8917b
Add test case for " " and "."
ErlingHauan Nov 18, 2024
d3cda35
Remove Norwegian characters from test for '-', '_'
ErlingHauan Nov 18, 2024
e6c7bc9
Update reserved keyword text
ErlingHauan Nov 19, 2024
59613fc
Update text for schema_editor.enum_empty
ErlingHauan Nov 19, 2024
60d56d1
Fix most PR comments
ErlingHauan Nov 19, 2024
adfad0d
Fix datamodel landing page spacing
ErlingHauan Nov 19, 2024
2317835
Remove dataModels parameter from useValidateSchemaName
ErlingHauan Nov 20, 2024
454c681
Memoize result of mergeJsonAndXsdData
ErlingHauan Nov 20, 2024
2c0e044
Merge branch '13364-validation-issues-when-creating-a-new-model' of h…
ErlingHauan Nov 20, 2024
8b7b717
Fix test
ErlingHauan Nov 20, 2024
cf8db9d
Fix TopToolbar test by adding query data for JSON and XSD models
ErlingHauan Nov 20, 2024
a89ae52
Remove fetching of data model names and data type names from useValid…
ErlingHauan Nov 21, 2024
66b9b89
Add tests for extractDataTypeNamesFromAppMetadata
ErlingHauan Nov 21, 2024
392939b
Remove data model query mocks from TopToolbar tests
ErlingHauan Nov 21, 2024
9294019
Remove unused import
ErlingHauan Nov 21, 2024
cc349d6
Fix linting error
ErlingHauan Nov 21, 2024
a38fdf0
Refactoring
ErlingHauan Nov 22, 2024
b5363a5
Fix import paths in XSDUpload test
ErlingHauan Nov 22, 2024
fcc0e6a
Change folder structure
ErlingHauan Nov 22, 2024
a1014bc
Merge main to branch
ErlingHauan Nov 22, 2024
559753c
Move DATA_MODEL_NAME_MAX_LENGTH into the hook where it is used
ErlingHauan Nov 22, 2024
e3e6531
Make extractDataTypeNamesFromAppMetadata more concise
ErlingHauan Nov 26, 2024
59067e8
Merge branch 'main' into 13364-validation-issues-when-creating-a-new-…
ErlingHauan Nov 26, 2024
32cb739
Disallow Norwegian characters in name
ErlingHauan Nov 29, 2024
4a34646
Merge branch 'main' into 13364-validation-issues-when-creating-a-new-…
ErlingHauan Nov 29, 2024
a48ebcf
Fix PR comments
ErlingHauan Nov 29, 2024
2ab7e81
Fix type error
ErlingHauan Nov 29, 2024
0eff4c7
Move expect inside for loop
ErlingHauan Nov 29, 2024
a8cdd9a
Merge branch 'main' into 13364-validation-issues-when-creating-a-new-…
JamalAlabdullah Dec 5, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ describe('useValidateSchemaName', () => {
const { result } = renderUseValidateSchemaName();
const invalidNames = ['æ', 'ø', 'å', 'Æ', 'Ø', 'Å', 'aæ', 'aø', 'aå', 'aÆ', 'aØ', 'aÅ'];
Fixed Show fixed Hide fixed

act(() => {
result.current.validateName('aÆØÅæøå');
invalidNames.forEach((name) => {
act(() => {
result.current.validateName(name);
standeren marked this conversation as resolved.
Show resolved Hide resolved
});
});

expect(result.current.nameError).toBe(textMock('schema_editor.error_invalid_datamodel_name'));
Expand Down