Skip to content

Commit

Permalink
Updating react-core version to avoid problems with Popover focus
Browse files Browse the repository at this point in the history
  • Loading branch information
ammont82 committed Mar 12, 2024
1 parent 65c8267 commit 8fe122c
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 101 deletions.
18 changes: 9 additions & 9 deletions apps/assisted-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
"dependencies": {
"@openshift-assisted/ui-lib": "workspace:*",
"@openshift-console/dynamic-plugin-sdk": "0.0.3",
"@patternfly/patternfly": "5.1.0",
"@patternfly/react-code-editor": "5.1.2",
"@patternfly/react-core": "5.1.2",
"@patternfly/react-icons": "5.1.2",
"@patternfly/react-styles": "5.1.2",
"@patternfly/react-table": "5.1.2",
"@patternfly/react-tokens": "5.1.2",
"@patternfly/patternfly": "5.2.0",
"@patternfly/react-code-editor": "5.2.0",
"@patternfly/react-core": "5.2.0",
"@patternfly/react-icons": "5.2.0",
"@patternfly/react-styles": "5.2.0",
"@patternfly/react-table": "5.2.0",
"@patternfly/react-tokens": "5.2.0",
"@reduxjs/toolkit": "^1.9.1",
"@sentry/browser": "^5.9 || ^6",
"axios": ">=0.22.0 <2.0.0",
"i18next": "^20.4.0",
"i18next-browser-languagedetector": "^6.1.2",
"lodash": "^4",
"monaco-editor": "^0.34.1",
"monaco-editor": "0.45.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^11.11.4",
"react-monaco-editor": "^0.51.0",
"react-monaco-editor": "^0.55.0",
"react-redux": "^8.0.5",
"react-router-dom": "^5.3.3",
"react-tagsinput": "^3.20",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,9 @@ describe(`Assisted Installer Custom manifests step`, () => {
utils.setLastWizardSignal('CUSTOM_MANIFEST_ADDED');
commonActions.startAtWizardStep('Custom manifests');

CustomManifestsForm.addManifest().should('be.enabled');
CustomManifestsForm.addManifest().click();

CustomManifestsForm.initManifest(1);
CustomManifestsForm.expandedManifest(1).fileName().type('manifest2.yaml');
CustomManifestsForm.expandedManifest(1)
.fileUpload()
.attachFile(`custom-manifests/files/manifest1.yaml`);
CustomManifestsForm.removeManifest(1).click();
CustomManifestsForm.getRemoveConfirmationButton().click();
cy.wait('@delete-manifests').then(({ request }) => {
expect(request.url).to.contain('folder=manifests&file_name=manifest2.yaml');
});
});

it('Enforces unique file names for custom manifests', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useTranslation } from '../../hooks/use-translation-wrapper';
export type DownloadISOProps = {
isSNO?: boolean;
fileName?: string;
downloadUrl?: string;
downloadUrl: string;
onClose: () => void;
onReset?: () => void;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type DownloadISOProps = {
hasDHCP?: boolean;
isSNO?: boolean;
fileName?: string;
downloadUrl?: string;
downloadUrl: string;
onClose: () => void;
onReset?: () => void;
docVersion?: string;
Expand Down
2 changes: 1 addition & 1 deletion libs/ui-lib/lib/common/components/ui/PrismCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const PrismCode: React.FC<PrismCodeProps> = ({
onCopy={(e) => clipboardCopyFunc(e, code)}
style={{ float: 'right', background: 'inherit' }}
>
{}
{''}
</ClipboardCopy>
)}
{tokens.map((line, i) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
ref: React.Ref<HTMLInputElement>,
) => {
const [popoverOpen, setPopoverOpen] = React.useState(false);
const [field, { error, value, touched }] = useField<string>({
const [field, { error, value, touched }, { setTouched }] = useField<string>({
name: props.name,
validate,
});
Expand All @@ -120,14 +120,18 @@ const RichInputField: React.FC<RichInputFieldPropsProps> = React.forwardRef(
id={fieldId}
isRequired={isRequired}
aria-describedby={`${fieldId}-helper`}
onChange={(event) => {
onChange={(event, val) => {
!popoverOpen && setPopoverOpen(true);
!noDefaultOnChange && field.onChange(event);
onChange && onChange(event);
if (!touched && val?.length) {
setTouched(true);
}
}}
className="rich-input__text"
onBlur={() => {
setPopoverOpen(false);
setTouched(true);
}}
/>
</InputGroupItem>
Expand Down
18 changes: 9 additions & 9 deletions libs/ui-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"@openshift-assisted/locales": "workspace:*",
"@openshift-assisted/types": "workspace:*",
"@openshift-console/dynamic-plugin-sdk": "0.0.3",
"@patternfly/patternfly": "5.1.0",
"@patternfly/react-code-editor": "5.1.2",
"@patternfly/react-core": "5.1.2",
"@patternfly/react-icons": "5.1.2",
"@patternfly/react-styles": "5.1.2",
"@patternfly/react-table": "5.1.2",
"@patternfly/react-tokens": "5.1.2",
"@patternfly/patternfly": "5.2.0",
"@patternfly/react-code-editor": "5.2.0",
"@patternfly/react-core": "5.2.0",
"@patternfly/react-icons": "5.2.0",
"@patternfly/react-styles": "5.2.0",
"@patternfly/react-table": "5.2.0",
"@patternfly/react-tokens": "5.2.0",
"axios-case-converter": "^0.11.1",
"camel-case": "^4.1.2",
"cidr-tools": "^4.3.0",
Expand Down Expand Up @@ -97,11 +97,11 @@
"@sentry/browser": "^5.9 || ^6",
"axios": ">=0.22.0 <1.0.0",
"i18next": "^20.4 || ^21",
"monaco-editor": "^0.34.1",
"monaco-editor": "0.45.0",
"react": "^17 || ^18",
"react-dom": "^17 || ^18",
"react-i18next": ">11.7.3",
"react-monaco-editor": "^0.51.0",
"react-monaco-editor": "^0.55.0",
"react-redux": "^8.0.5",
"react-router-dom": "^5.3.0",
"react-tagsinput": "^3.20",
Expand Down
Loading

0 comments on commit 8fe122c

Please sign in to comment.