From 05633ed999525ea3342fc251c46261eea9806190 Mon Sep 17 00:00:00 2001 From: Elsa Mary Date: Fri, 8 Nov 2024 13:06:21 +0530 Subject: [PATCH] Fixes ESLint problems --- app/javascript/components/miq-ae-class/class-form.schema.js | 3 +-- app/javascript/components/miq-ae-class/index.jsx | 5 +++-- .../e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/javascript/components/miq-ae-class/class-form.schema.js b/app/javascript/components/miq-ae-class/class-form.schema.js index b507efe36c7..73d4bf579f9 100644 --- a/app/javascript/components/miq-ae-class/class-form.schema.js +++ b/app/javascript/components/miq-ae-class/class-form.schema.js @@ -1,5 +1,4 @@ import { componentTypes, validatorTypes } from '@@ddf'; -import { IsRequired } from '@data-driven-forms/carbon-component-mapper'; const createSchema = (fqname) => ({ fields: [ @@ -11,7 +10,7 @@ const createSchema = (fqname) => ({ initialValue: fqname, maxLength: 128, validate: [{ type: validatorTypes.REQUIRED }], - isReadOnly: true, + isReadOnly: true, }, { component: componentTypes.TEXT_FIELD, diff --git a/app/javascript/components/miq-ae-class/index.jsx b/app/javascript/components/miq-ae-class/index.jsx index d0cd9ea9052..c5138cdbcbd 100644 --- a/app/javascript/components/miq-ae-class/index.jsx +++ b/app/javascript/components/miq-ae-class/index.jsx @@ -23,10 +23,10 @@ const MiqAeClass = ({ classRecord, fqname }) => { }); } else { const initialValues = { - fqname: fqname, + fqname, name: classRecord && classRecord.name, display_name: classRecord && classRecord.display_name, - description: classRecord && classRecord.description + description: classRecord && classRecord.description, }; setData({ ...data, isLoading: false, initialValues }); } @@ -149,6 +149,7 @@ MiqAeClass.propTypes = { display_name: PropTypes.string, description: PropTypes.string, }), + fqname: PropTypes.string.isRequired, }; MiqAeClass.defaultProps = { diff --git a/cypress/e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js b/cypress/e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js index b0efc0e63eb..d728adf6824 100644 --- a/cypress/e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js +++ b/cypress/e2e/ui/Automation/Embedded-Automate/Explorer/class.cy.js @@ -19,7 +19,6 @@ describe('Automation > Embedded Automate > Explorer', () => { }); describe('Class Form', () => { - it('Creates and edits an automate class', () => { // Creates a Domain cy.get('[title="Datastore"]').click({force: true}); @@ -43,7 +42,7 @@ describe('Automation > Embedded Automate > Explorer', () => { cy.get('[name="name"]').type('TestNS'); cy.get('[name="description"]').type('This is a test NS'); cy.get('.bx--btn--primary').contains('Add').click(); // submits Namespace - + // Creates a Class cy.get('[title="Datastore"]').click({force: true}); cy.get('[title="Automate Domain: TestDomain"]').click({force: true}); // clicks on Domain @@ -57,7 +56,7 @@ describe('Automation > Embedded Automate > Explorer', () => { // checks for the success message cy.get('#flash_msg_div .alert.alert-success').should('exist') .and('be.visible').and('contain', 'Class "TestClass" was added'); - + // Edits a class cy.get('[title="Automate Class: TC (TestClass)"]').click({force: true}); // clicks on the class cy.get('[title="Configuration"]').click({force: true});