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

Feature/786 onboarding wizard #957

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
90967d4
feat: add beta flag for Onboarding Wizard and EmptyState to begin onb…
Kolawole99 May 29, 2023
da2333e
feat: add onboarding wizard page and layout
Kolawole99 May 29, 2023
3b77c89
style: linter auto fixes
Kolawole99 May 29, 2023
ee7af22
feat: slack webhooks in frontend now as per new backend
ShubhamPalriwala May 25, 2023
9997841
feat(onboarding-wizard): adding choose a cloud page
Kolawole99 Jun 13, 2023
03d87f6
feat(onboarding-wizard): making onboarding wizard a nested route comp…
Kolawole99 Jun 13, 2023
0b65b3c
feat(onboarding-wizard): azure stub ui implemented
Kolawole99 Jun 14, 2023
c06b861
feat(component): choose database assets and page
Kolawole99 Jun 28, 2023
626d720
feat(component): custom inputs for onboarding-wizard
Kolawole99 Jun 28, 2023
94662ab
feat(component): cloud providers setup
Kolawole99 Jun 28, 2023
8bad340
feat(component): choose database completed
Kolawole99 Jun 28, 2023
d7a1927
feat(component): complete onboarding page
Kolawole99 Jun 28, 2023
a171530
feat(component): adding postgres database
Kolawole99 Jun 28, 2023
21c8e37
feat(component): adding onboarding wizard icons
Kolawole99 Jul 5, 2023
a867c0a
feat(component): fixes to layout routing and linting files
Kolawole99 Jul 5, 2023
3e7eff5
feat(component): file and select inputs completed
Kolawole99 Jul 5, 2023
2c42dc6
feat(component): adding file input to kubernetes
Kolawole99 Jul 5, 2023
c051a45
feat(component): adding file and select inputs to aws
Kolawole99 Jul 5, 2023
8d335c3
feat(component): adding support for sqlite
Kolawole99 Jul 5, 2023
493754b
feat(component): fixes for choose cloud page
Kolawole99 Jul 5, 2023
9c53be8
feat(component): adding video replacement icon, and circle icon
Kolawole99 Jul 5, 2023
faee8c5
feat(component): adding accurate icons and images to the design
Kolawole99 Jul 5, 2023
902bcc7
feat(component): implementing source in kubernetes
Kolawole99 Jul 5, 2023
d5da8da
feat(fix): handling merge conflict removal
Kolawole99 Jul 13, 2023
7ee7b72
feat(onboarding-wizard): fixing types, naming conventions, casing and…
Kolawole99 Jul 23, 2023
e8a0a9b
feat(onboarding-wizard): streamlining beta flag for app using context
Kolawole99 Jul 23, 2023
abb279f
Merge branch 'develop' into feature/786-onboarding-wizard
ShubhamPalriwala Jul 26, 2023
409e5a4
feat(onboarding-wizard): initial support for managing cloud accounts
Kolawole99 Sep 2, 2023
4e2ac56
feat(onboarding-wizard): adding support for status tooltip
Kolawole99 Sep 4, 2023
fc6e57d
feat(onboarding-wizard): disable wizard beta flag
Kolawole99 Sep 4, 2023
50d1065
feat(onboarding-wizard): handling merge conflict
Kolawole99 Sep 4, 2023
5e8bc89
feat(onboarding-wizard): fixing build issues
Kolawole99 Sep 4, 2023
e0cb794
Merge remote-tracking branch 'upstream/develop' into feature/786-onbo…
Kolawole99 Sep 12, 2023
cdf8b1b
fix(linting): fix linting warnings
Kolawole99 Sep 12, 2023
6c8c2a5
Merge branch 'develop' into feature/786-onboarding-wizard
Kolawole99 Sep 13, 2023
757d72c
Merge branch 'develop' into feature/786-onboarding-wizard
Kolawole99 Sep 14, 2023
1aec85b
Merge branch 'develop' into feature/786-onboarding-wizard
Kolawole99 Sep 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import Button from '../../button/Button';
import PlusIcon from '../../icons/PlusIcon';

type CloudAccountsHeaderProps = {
isNotCustomView: boolean;
};

function CloudAccountsHeader({ isNotCustomView }: CloudAccountsHeaderProps) {
return (
<div className="flex min-h-[40px] items-center justify-between gap-8">
{isNotCustomView && (
<>
<p className="flex items-center gap-2 text-lg font-medium text-black-900">
Your Cloud Accounts
</p>
<Button type="button" style="secondary" onClick={() => {}}>
<PlusIcon className="-ml-2 mr-1 h-6 w-6" />
Add Cloud Accounts
</Button>
</>
)}
</div>
);
}

export default CloudAccountsHeader;
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { NextRouter } from 'next/router';
import { ReactNode, useContext } from 'react';

import GlobalAppContext from '../../layout/context/GlobalAppContext';
import Providers, { allProviders } from '../../../utils/providerHelper';

type CloudAccountsLayoutProps = {
children: ReactNode;
router: NextRouter;
};

function CloudAccountsLayout({ children, router }: CloudAccountsLayoutProps) {
const { displayBanner } = useContext(GlobalAppContext);

const cloudProviders = Object.values(allProviders);

return (
<>
<nav
className={`fixed ${
displayBanner ? 'mt-[145px]' : 'mt-[73px]'
} bottom-0 left-0 top-0 z-20 flex w-[17rem] flex-col gap-4 bg-white p-6`}
>
<button
onClick={() => {
router.push(router.pathname);
}}
className={`flex items-center gap-3 rounded-lg px-4 py-3 text-left text-sm font-medium
${
!router.query.view
? 'border-l-2 border-primary bg-komiser-150 text-primary'
: 'text-black-400 transition-colors hover:bg-komiser-100'
}
`}
>
<div className={!router.query.view ? 'ml-[-2px]' : ''}>
<p className="w-[192px] truncate">All Cloud Providers</p>
</div>
</button>

{cloudProviders && cloudProviders.length > 0 && (
<div className="-mx-4 -mr-6 flex flex-col gap-4 overflow-auto px-4 pr-6">
{cloudProviders.map(view => {
const isActive = router.query.view === view;
return (
<button
key={view}
onClick={() => {
if (isActive) return;
router.push(`?view=${view}`);
}}
className={`flex items-center gap-3 rounded-lg px-4 py-3 text-left text-sm font-medium
${
isActive
? 'border-l-2 border-primary bg-komiser-150 text-primary'
: 'text-black-400 transition-colors hover:bg-komiser-100'
}
`}
>
<div className={isActive ? 'ml-[-2px]' : ''}>
<p className="w-[188px] truncate">
{Providers.providerLabel(view)}
</p>
</div>
</button>
);
})}
</div>
)}
</nav>
<main className="ml-[17rem]">{children}</main>
</>
);
}

export default CloudAccountsLayout;
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { useState } from 'react';
import { useRouter } from 'next/router';

import useToast from '../../../toast/hooks/useToast';
import { Provider } from '../../../../utils/providerHelper';

interface CloudAccounts {
provider: Provider;
name: string;
status: {
state: 'Connected' | 'Permission Issue' | 'Syncing';
message: string;
};
}

function useCloudAccount() {
const router = useRouter();
const { toast, dismissToast } = useToast();

const [cloudAccounts, setCloudAccounts] = useState<Array<CloudAccounts>>([
{
provider: 'aws',
name: 'Loudy AWS',
status: {
state: 'Connected',
message: 'Your cloud account is connected.'
}
},
{
provider: 'azure',
name: 'Loudy Azure',
status: {
state: 'Permission Issue',
message:
"We couldn't fetch EC2, S3 and VPC resources.See more details through the cloud account sidepanel."
}
},
{
provider: 'gcp',
name: 'Loudy GCP',
status: {
state: 'Syncing',
message: 'Your cloud account data is being fetched by Komiser.'
}
}
]);
const isNotCustomView = !router.query.view;

return {
router,
toast,
dismissToast,
cloudAccounts,
isNotCustomView
};
}

export default useCloudAccount;
27 changes: 27 additions & 0 deletions dashboard/components/icons/More2Icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { SVGProps } from 'react';

const More2Icon = (props: SVGProps<SVGSVGElement>) => (
<svg
width="16"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<path
d="M9.33398 3.33333C9.33398 2.6 8.73398 2 8.00065 2C7.26732 2 6.66732 2.6 6.66732 3.33333C6.66732 4.06667 7.26732 4.66667 8.00065 4.66667C8.73398 4.66667 9.33398 4.06667 9.33398 3.33333Z"
fill="#0C1717"
/>
<path
d="M9.33398 12.6663C9.33398 11.933 8.73398 11.333 8.00065 11.333C7.26732 11.333 6.66732 11.933 6.66732 12.6663C6.66732 13.3997 7.26732 13.9997 8.00065 13.9997C8.73398 13.9997 9.33398 13.3997 9.33398 12.6663Z"
fill="#0C1717"
/>
<path
d="M9.33398 8.00033C9.33398 7.26699 8.73398 6.66699 8.00065 6.66699C7.26732 6.66699 6.66732 7.26699 6.66732 8.00033C6.66732 8.73366 7.26732 9.33366 8.00065 9.33366C8.73398 9.33366 9.33398 8.73366 9.33398 8.00033Z"
fill="#0C1717"
/>
</svg>
);

export default More2Icon;
19 changes: 15 additions & 4 deletions dashboard/components/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ import { useRouter } from 'next/router';
import { useContext } from 'react';
import GlobalAppContext from '../layout/context/GlobalAppContext';

interface NavItem {
label: string;
href: string;
}

function Navbar() {
const { displayBanner } = useContext(GlobalAppContext);
const { displayBanner, betaFlagOnboardingWizard } =
useContext(GlobalAppContext);
const router = useRouter();
const nav = [
// TODO: (onboarding-wizard) Remove the betaFlagOnboardingWizard conditional when feature is stable
const nav: NavItem[] = [
{ label: 'Dashboard', href: '/dashboard' },
{ label: 'Inventory', href: '/inventory' }
];
{ label: 'Inventory', href: '/inventory' },
betaFlagOnboardingWizard
? { label: 'Cloud Accounts', href: '/cloud-accounts' }
: null
].filter(item => item !== null) as NavItem[];

return (
<nav
className={`fixed ${
Expand Down
2 changes: 1 addition & 1 deletion dashboard/components/onboarding-wizard/PurplinCloud.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function PurplinCloud({ provider }: { provider: Provider }) {
width={500}
height={120}
/>
<div className="absolute left-[48%] top-[53%] -translate-x-1/2 -translate-y-1/2 transform rounded-full">
<div className="absolute top-[53%] left-[48%] -translate-x-1/2 -translate-y-1/2 transform rounded-full">
<Image
src={ProviderCls.providerImg(provider) as string}
alt={`${provider} Logo`}
Expand Down
8 changes: 4 additions & 4 deletions dashboard/components/onboarding-wizard/SelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ function SelectInput({
return (
<div className="relative">
<div
className="pointer-events-none absolute bottom-[1.15rem]
right-4 text-komiser-600 transition-all"
className="pointer-events-none absolute right-4
bottom-[1.15rem] text-komiser-600 transition-all"
>
{icon}
</div>
Expand All @@ -61,15 +61,15 @@ function SelectInput({
onClick={toggle}
className="fixed inset-0 z-20 hidden animate-fade-in bg-transparent opacity-0 sm:block"
></div>
<div className="absolute top-[96px] z-[21] max-h-52 w-full overflow-hidden overflow-y-auto rounded-lg border border-black-130 bg-white px-3 py-2 shadow-lg">
<div className="absolute top-[96px] z-[21] max-h-52 w-full overflow-hidden overflow-y-auto rounded-lg border border-black-130 bg-white py-2 px-3 shadow-lg">
<div className="flex w-full flex-col gap-1">
{values.map((item, idx) => {
const isActive = value === item;
return (
<button
key={idx}
className={classNames(
'flex items-center rounded px-3 py-2 text-left text-sm text-black-400 hover:bg-black-150',
'flex items-center rounded py-2 px-3 text-left text-sm text-black-400 hover:bg-black-150',
{ 'bg-komiser-150': isActive }
)}
onClick={() => handleClick(item)}
Expand Down
2 changes: 1 addition & 1 deletion dashboard/components/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Select({
onClick={toggle}
className="fixed inset-0 z-20 hidden animate-fade-in bg-transparent opacity-0 sm:block"
></div>
<div className="absolute top-[66px] z-[21] max-h-52 w-full overflow-hidden overflow-y-auto rounded-lg border border-black-130 bg-white px-3 py-2 shadow-lg">
<div className="absolute top-[66px] z-[21] max-h-52 w-full overflow-hidden overflow-y-auto rounded-lg border border-black-130 bg-white py-2 px-3 shadow-lg">
<div className="flex w-full flex-col gap-1">
{values.map((item, idx) => {
const isActive = value === item;
Expand Down
60 changes: 60 additions & 0 deletions dashboard/package-lock.json

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

Loading