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

feat: add workflow creation from blueprint #5189

Conversation

djabarovgeorge
Copy link
Contributor

What change does this PR introduce?

Create a component that will be responsible for the creation of a use case workflow from a blueprint.

Why was this change needed?

So we could reuse it across the get started onboarding.

Other information (Screenshots)

Copy link

linear bot commented Feb 13, 2024

Base automatically changed from NV-3243_onboarding-in-app to usecase-onboarding-project February 13, 2024 20:17
Copy link
Contributor

@antonjoel82 antonjoel82 left a comment

Choose a reason for hiding this comment

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

Great work! Added some comments and questions, and only one small "chore" regarding re-naming / typing

Comment on lines +40 to +47
onSuccess: (data) => {
if (data) {
const { name: blueprintName } = getWorkflowBlueprintDetails(data.name);
createTemplateFromBlueprint({
blueprint: { ...data, name: blueprintName },
params: { __source: TemplateCreationSourceEnum.ONBOARDING_GET_STARTED },
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

❔ question: Is this function async? If so, we need to await or return createTemplateFromBlueprint, right?‏

Comment on lines +3 to +12
export const getWorkflowBlueprintDetails = (templateName: string): { name: string; iconName: IconName } => {
const regexResult = /^:.{1,}:/.exec(templateName);
let name = '';
let iconName = 'fa-solid fa-question';
if (regexResult !== null) {
name = templateName.replace(regexResult[0], '').trim();
iconName = regexResult[0].replace(/:/g, '').trim();
}

return { name, iconName: iconName as IconName };
Copy link
Contributor

Choose a reason for hiding this comment

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

💭 thought: I realize this is just refactoring / moving this, but this IconName coupling is going to be a problem with de-coupling from our icon set(s)‏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean by our icon set(s)?

small note: this logic was created so we could store icons by string conversion, this way we can store them easily in the template store under workflow.name

Copy link
Contributor

@antonjoel82 antonjoel82 Feb 15, 2024

Choose a reason for hiding this comment

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

Yeah, this is a tough one because we're tightly coupled with FontAwesome as an icon set due to this implementation

@antonjoel82 antonjoel82 force-pushed the nv-3500-create-use-case-workflow-from-blueprint branch from 0f7ff54 to 6ccea0b Compare February 14, 2024 16:43
- Add all static links for each use case
- Connect In-App tab to specific Integration store side panel
- Create abstraction to make adding animations easier for the different color schemes
- Fix Timeline styling in light mode
@djabarovgeorge djabarovgeorge merged commit 0116ed9 into usecase-onboarding-project Feb 17, 2024
23 of 24 checks passed
@djabarovgeorge djabarovgeorge deleted the nv-3500-create-use-case-workflow-from-blueprint branch February 17, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants