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

Feature/#2384 added test script in meta data source on new UI #2687

Conversation

Limraj
Copy link
Collaborator

@Limraj Limraj commented Sep 5, 2023

No description provided.

Patrykb0802 and others added 11 commits July 20, 2023 15:59
In point.vue:
- Added validateScript() method
- Added 'Run script' button to  Meta Data Point editing
- Added alert that shows result of working script
- Modified script textarea to run validateScript method
- Added new rule that is checking if script is correct

- Added script.runScript translation key to en.json
- Added correct error message when creating new data point and script field is empty

- Added delayed validation, so requests for validation are not send every letter typed

- Added handling of error when field for script is empty and you press "run script", now when field is empty and you press "run script" nothing happens

- Deleted duplicated property key dox.newUISettings
- Added validation in validateScript() method for empty text area of script

- Added script validation when focusing out of the script text area

- Added script validation when changing data point type so there is no possibility of saving with incorrect script
corrected en.json
- Added validation after adding context datapoint for script

- Added validation after editing text fields like data point name, datapoint export ID and description
- Moved error messages to alert component

- Added valdiation on removing context datapoint
- Removed validation on focus out for textareas: Data point name, export ID, description
@Limraj Limraj added this to the 2.7.7 milestone Sep 5, 2023
Copy link
Collaborator Author

@Limraj Limraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem 1

  1. Click on 'Create new data point' for Meta Data Source;
  2. Created Data Point with script "return 1;" as dp_1;
  3. Refresh page and edit dp_1;
  4. Added disabled Data Point to Script Context -> This does not trigger validation;
    Expected behavior:
    Also, a change in the context of the script should validate the script.

Problem 2

  1. Click on 'Create new data point' for Meta Data Source;
  2. Created Data Point with script "return 1;" as dp_1;
  3. Refresh page, and edit Data Point dp_1;
  4. Click on 'Run script' and add disabled Data Point to context, and click update -> Successfully updated script failing validation, as you can see by clicking in the Script field and then outside this field;

Problem 3

  1. Click on 'Create new data point' for Meta Data Source;
  2. Created Data Point with script "return 1;" as dp_1;
  3. Refresh page, and edit Data Point dp_1;
  4. Click on 'Run script' and add disabled Data Point to context, and click update;
  5. Refresh page and edit dp_1;
  6. Click on 'Run script' -> no message with the result of the script

Problem 4

  1. Click on 'Create new data point' for Meta Data Source;
  2. Created Data Point with script "return 1;" as dp_1;
  3. Refresh page, and edit Data Point dp_1 -> The update button is not active, we change the description and it is still greyed out;

Expected behavior:
After changing fields such as description, or other field, the update button should be active;

Problem 5

  1. Click on 'Create new data point' for Meta Data Source;
  2. Created Data Point with script "return 1;" as dp_1;
  3. Refresh page, and edit Data Point dp_1 -> The update button is not active, is greyed -> error

Expected behavior:
As in other forms, the update button should be available after opening the point edit form

Problem 6

  1. Click on 'Create new data point' for Meta Data Source;
  2. Created Data Point with script "return 1;" as dp_1;
  3. Click on 'Cancel' -> The form window does not close and validates the script;

Expected behavior:
Clicking the cancel button should reset the form values ​​and close the form window.

Actual result:

Problem 2-4 -> ok;
Problem 1 -> Changing script context, triggers validation -> ok;
Problem 5 -> Right after opening the form create and edit, it unnecessarily performs validation -> to correct;
Problem 6 -> Clicking cancel does not trigger the validation again and closes the form window -> ok;

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Java Script Mocha Unit Test Results

268 tests  ±0   268 ✔️ ±0   5s ⏱️ -1s
  70 suites ±0       0 💤 ±0 
    1 files   ±0       0 ±0 

Results for commit ee7c8c3. ± Comparison against base commit f16b925.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

Java JUnit Test Results

2 097 tests  +14   2 097 ✔️ +14   36s ⏱️ +11s
     90 suites ±  0          0 💤 ±  0 
     90 files   ±  0          0 ±  0 

Results for commit ee7c8c3. ± Comparison against base commit f16b925.

♻️ This comment has been updated with latest results.

@@ -373,6 +389,7 @@ export default {
DataPointCreation,
},
async mounted() {
this.validateScript();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be leveled

<v-alert title = "Script error" type="error">
Script error: {{this.resultMessage}}
</v-alert>
</v-div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve the structure so that it is clear where a given tag begins and ends.

- Added rules validation on load for data point creation form
Copy link
Collaborator Author

@Limraj Limraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem 7

  1. Click on 'Create new data point' for Meta Data Source;
  2. Created Data Points with script "return 1;" as dp_1, and script "return 2;" as dp_2, disabled;
  3. Refresh page, and edit Data Point dp_1;
  4. Added disabled dp_2 to context -> validation stop, inactive update button -> ok
  5. Click on 'Cancel' and edit -> You can update a Meta Data Point even though the context is disabled -> error

Problem 8

  1. Click on 'Create new data point' for Meta Data Source;
  2. Created Data Points with script "return 1;" as dp_1, and script "return 2;" as dp_2, disabled;
  3. Refresh page, and edit Data Point dp_1;
  4. Change script on "return p1.value;" and click active update button -> error

Expected behavior:
After clicking update/create before the request, it has to perform additional validation.

@Limraj
Copy link
Collaborator Author

Limraj commented Sep 7, 2023

All listed problems have been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants