Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

fix: Add Beans support #1827

Merged
merged 1 commit into from
May 23, 2023
Merged

fix: Add Beans support #1827

merged 1 commit into from
May 23, 2023

Conversation

igarashitm
Copy link
Contributor

With kaoto-archive/kaoto-backend#659, now the beans definition pasted in YAML code editor will be preserved.

Fixes: #1721

@igarashitm igarashitm requested a review from a team May 22, 2023 14:42
(integrationId: string, newStep: IStepProps, options: { mode: 'replace', index: number }): void;
(integrationId: string, newStep: IStepProps, options: { mode: 'replace', path: string[] | undefined }): void;
(integrationId: string, newStep: IStepProps, options: { mode: 'append' | 'insert' | 'replace'; index: number, path: string[] | undefined }): void;
(integrationId: string, newStep: IStepProps, options: { mode: 'insert'; index: number }): void;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

WebStorm did this behind me, replaced a comma with a semicolon... is this valid?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, it is 😄

WebStorm please stop messing around with my formatting 👀

Copy link
Collaborator

@lordrip lordrip left a comment

Choose a reason for hiding this comment

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

LGTM I just think that we need to add the missing metadata property and we're good to go.

PS: WebStorm 💔

@@ -43,7 +39,15 @@ export const SettingsModal = ({ handleCloseModal, isModalOpen }: ISettingsModal)
const [availableDSLs, setAvailableDSLs] = useState<string[]>([]);
const { settings, setSettings } = useSettingsStore((state) => state);
const [localSettings, setLocalSettings] = useState<ISettings>(settings);
const { flows, properties, setFlows } = useFlowsStore(({ flows, properties, setFlowsWrapper: setFlows }) => ({ flows, properties, setFlows }), shallow);
const { flows, properties, metadata, setFlows } = useFlowsStore(
({ flows, properties, metadata, setFlowsWrapper: setFlows }) => ({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Argh, this is a leftover from my last pull request, that line should read as:

({ flows, properties, metadata, setFlowsWrapper }) => ({

I'll update it in another pull request. Unless you wanna do it in this one in which case I would be more than happy 👀 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

setFlowsWrapper,
}),
shallow
);
const previousFlows = usePrevious(flows);

const schemaUri = settings.dsl.validationSchema
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nothing-to-action-here]: This logic is somewhat similar to the logic from the source code editor and we talked about moving it to a service, now I think that the right place for this should be a custom hook.

Copy link
Contributor

Choose a reason for hiding this comment

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

@lordrip No real opinion here, just curious why a custom hook over a service?


// The history is used to keep a log of every change to the content. Then, this log is used to undo and redo content.
const { undo, redo, pastStates } = useIntegrationJsonStore.temporal.getState();

const previousFlowWrapper = useRef<IFlowsWrapper>(JSON.parse(JSON.stringify({ flows, properties })));
const previousFlowWrapper = useRef<IFlowsWrapper>(
JSON.parse(JSON.stringify({ flows, properties }))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that we should add here the new metadata property as well.

Suggested change
JSON.parse(JSON.stringify({ flows, properties }))
JSON.parse(JSON.stringify({ flows, metadata, properties }))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

(integrationId: string, newStep: IStepProps, options: { mode: 'replace', index: number }): void;
(integrationId: string, newStep: IStepProps, options: { mode: 'replace', path: string[] | undefined }): void;
(integrationId: string, newStep: IStepProps, options: { mode: 'append' | 'insert' | 'replace'; index: number, path: string[] | undefined }): void;
(integrationId: string, newStep: IStepProps, options: { mode: 'insert'; index: number }): void;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, it is 😄

WebStorm please stop messing around with my formatting 👀

With kaoto-archive/kaoto-backend#659, now the `beans` definition pasted in YAML code editor will be preserved.

Fixes: kaoto-archive#1721
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.9% 1.9% Duplication

@igarashitm igarashitm enabled auto-merge (rebase) May 22, 2023 15:56
};

setFlows(updatedFlowWrapper);
setFlowsWrapper(updatedFlowWrapper);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for taking care of this 💪

@igarashitm igarashitm merged commit 73399d7 into kaoto-archive:main May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Beans support
3 participants