Skip to content

Commit

Permalink
Merge pull request #1705 from jdi-testing/issue_1617-not-applicable-f…
Browse files Browse the repository at this point in the history
…or-annot-with-vividus

Issue 1617: add "not applicable" for annotation with vividus
  • Loading branch information
KateDronova authored Apr 11, 2024
2 parents 1d231f7 + 25922b8 commit d0416d0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "JDN — Page Object Generator",
"description": "JDN – helps Test Automation Engineer to create Page Objects in the test automation framework and speed up test development",
"devtools_page": "index.html",
"version": "3.15.21",
"version": "3.15.22",
"icons": {
"128": "icon128.png"
},
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jdn-ai-chrome-extension",
"version": "3.15.21",
"version": "3.15.22",
"description": "jdn-ai chrome extension",
"scripts": {
"start": "webpack --watch --env devenv",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const PageObjGenerationSettings: React.FC<Props> = ({ pageObj, url, handl
label="Annotation:"
id="annotationType"
disabled={isCurrentFrameworkVividus || !isPageObjectsListUIEnabled}
value={currentAnnotation}
value={isCurrentFrameworkVividus ? 'Not applicable' : currentAnnotation}
defaultValue={currentPageObject?.annotationType || AnnotationType.UI}
onChange={onAnnotationTypeChange}
options={annotationTypeOptions}
Expand Down
35 changes: 25 additions & 10 deletions src/features/pageObjects/components/PageObjSettingsItem.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,42 @@
import { Row, Col, Typography, Select } from 'antd';
import { Row, Col, Typography, Select, Tooltip } from 'antd';
import { InternalSelectProps } from 'antd/es/select';
import { useSelector } from 'react-redux';
import { FrameworkType } from '../../../common/types/common';
import { selectCurrentPageObject } from '../selectors/pageObjects.selectors';
import React from 'react';

type Props = InternalSelectProps & {
label: string;
};

const PageObjSettingsItem = ({ label, disabled, id, value, defaultValue, onChange, options }: Props) => {
const currentPageObject = useSelector(selectCurrentPageObject);
const isCurrentFrameworkVividus = currentPageObject?.framework === FrameworkType.Vividus;
const selectContent = (
<Select
className="jdn__select"
disabled={disabled}
id={id}
value={value}
defaultValue={defaultValue}
onChange={onChange}
options={options}
/>
);

return (
<Row>
<Col flex="104px">
<Typography.Text style={disabled ? { color: 'rgba(0, 0, 0, 0.25)' } : {}}>{label}</Typography.Text>
</Col>
<Col flex="auto">
<Select
className="jdn__select"
disabled={disabled}
id={id}
value={value}
defaultValue={defaultValue}
onChange={onChange}
options={options}
/>
{isCurrentFrameworkVividus && id === 'annotationType' ? (
<Tooltip placement="bottom" title="Not available for Vividus framework">
{selectContent}
</Tooltip>
) : (
selectContent
)}
</Col>
</Row>
);
Expand Down

0 comments on commit d0416d0

Please sign in to comment.