mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 05:26:25 +00:00
improving UX for the onboarding experience
This commit is contained in:
@@ -19,7 +19,8 @@ export const getOrganizations = async (req: Request, res: Response) => {
|
|||||||
try {
|
try {
|
||||||
organizations = (
|
organizations = (
|
||||||
await MembershipOrg.find({
|
await MembershipOrg.find({
|
||||||
user: req.user._id
|
user: req.user._id,
|
||||||
|
status: ACCEPTED
|
||||||
}).populate('organization')
|
}).populate('organization')
|
||||||
).map((m) => m.organization);
|
).map((m) => m.organization);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ const ProjectUsersTable = ({ userData, changeData, myUser, filter }: Props) => {
|
|||||||
>
|
>
|
||||||
<Select
|
<Select
|
||||||
className="w-16 bg-mineshaft-700"
|
className="w-16 bg-mineshaft-700"
|
||||||
dropdownContainerClassName="bg-mineshaft-700"
|
dropdownContainerClassName="bg-mineshaft-800 border border-mineshaft-600 text-bunker-200"
|
||||||
position="item-aligned"
|
position="item-aligned"
|
||||||
// open={isOpen}
|
// open={isOpen}
|
||||||
onValueChange={(val) =>
|
onValueChange={(val) =>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const buttonVariants = cva(
|
|||||||
'button',
|
'button',
|
||||||
'transition-all',
|
'transition-all',
|
||||||
'font-inter font-medium',
|
'font-inter font-medium',
|
||||||
'cursor-default',
|
'cursor-pointer',
|
||||||
'inline-flex items-center justify-center',
|
'inline-flex items-center justify-center',
|
||||||
'relative',
|
'relative',
|
||||||
'whitespace-nowrap'
|
'whitespace-nowrap'
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { apiRequest } from '@app/config/request';
|
|||||||
import { UploadWsKeyDTO, UserWsKeyPair } from './types';
|
import { UploadWsKeyDTO, UserWsKeyPair } from './types';
|
||||||
|
|
||||||
const encKeyKeys = {
|
const encKeyKeys = {
|
||||||
getUserWorkspaceKey: (workspaceID: string) => ['worksapce-key-pair', { workspaceID }] as const
|
getUserWorkspaceKey: (workspaceID: string) => ['workspace-key-pair', { workspaceID }] as const
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchUserWsKey = async (workspaceID: string) => {
|
const fetchUserWsKey = async (workspaceID: string) => {
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
|||||||
const orgUserProjects = await getOrganizationUserProjects({
|
const orgUserProjects = await getOrganizationUserProjects({
|
||||||
orgId: tempLocalStorage('orgData.id')
|
orgId: tempLocalStorage('orgData.id')
|
||||||
});
|
});
|
||||||
|
console.log(555, tempLocalStorage('orgData.id'), orgUserProjects)
|
||||||
const userWorkspaces = orgUserProjects;
|
const userWorkspaces = orgUserProjects;
|
||||||
if (
|
if (
|
||||||
(userWorkspaces.length === 0 &&
|
(userWorkspaces.length === 0 &&
|
||||||
@@ -248,7 +249,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
|||||||
<aside className="w-full border-r border-mineshaft-600 bg-gradient-to-tr from-mineshaft-700 via-mineshaft-800 to-mineshaft-900 md:w-60">
|
<aside className="w-full border-r border-mineshaft-600 bg-gradient-to-tr from-mineshaft-700 via-mineshaft-800 to-mineshaft-900 md:w-60">
|
||||||
<nav className="items-between flex h-full flex-col justify-between">
|
<nav className="items-between flex h-full flex-col justify-between">
|
||||||
<div>
|
<div>
|
||||||
{currentWorkspace ? (
|
{currentWorkspace && router.asPath !== "/noprojects" ? (
|
||||||
<div className="mt-3 mb-4 w-full p-4">
|
<div className="mt-3 mb-4 w-full p-4">
|
||||||
<p className="ml-1.5 mb-1 text-xs font-semibold uppercase text-gray-400">
|
<p className="ml-1.5 mb-1 text-xs font-semibold uppercase text-gray-400">
|
||||||
Project
|
Project
|
||||||
@@ -298,9 +299,11 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
|||||||
) : (
|
) : (
|
||||||
<div className="mt-3 mb-4 w-full p-4">
|
<div className="mt-3 mb-4 w-full p-4">
|
||||||
<Button
|
<Button
|
||||||
className="w-full bg-mineshaft-500 py-2 text-bunker-200 hover:bg-primary/90 hover:text-black"
|
className="border-mineshaft-500"
|
||||||
color="mineshaft"
|
colorSchema="primary"
|
||||||
|
variant="outline_bg"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
isFullWidth
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (isAddingProjectsAllowed) {
|
if (isAddingProjectsAllowed) {
|
||||||
handlePopUpOpen('addNewWs')
|
handlePopUpOpen('addNewWs')
|
||||||
@@ -314,7 +317,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className={`${currentWorkspace ? 'block' : 'hidden'}`}>
|
<div className={`${currentWorkspace && router.asPath !== "/noprojects" ? 'block' : 'hidden'}`}>
|
||||||
<Menu>
|
<Menu>
|
||||||
<Link href={`/dashboard/${currentWorkspace?._id}`} passHref>
|
<Link href={`/dashboard/${currentWorkspace?._id}`} passHref>
|
||||||
<a>
|
<a>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
import Head from 'next/head';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
|
|
||||||
@@ -27,10 +28,15 @@ export default function NoProjects() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mr-auto flex h-full w-11/12 flex-col items-center justify-center text-center text-lg text-gray-300">
|
<div className="mr-auto flex h-full w-11/12 flex-col items-center justify-center text-center text-lg text-gray-300">
|
||||||
|
<Head>
|
||||||
|
<title>No Projects | Infisical</title>
|
||||||
|
<link rel="icon" href="/infisical.ico" />
|
||||||
|
<meta property="og:image" content="/images/message.png" />
|
||||||
|
</Head>
|
||||||
<div className="mb-6 mt-16 mr-16">
|
<div className="mb-6 mt-16 mr-16">
|
||||||
<Image src="/images/dragon-cant-find.svg" height={270} width={436} alt="google logo" />
|
<Image src="/images/dragon-cant-find.svg" height={270} width={436} alt="google logo" />
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-8 rounded-md bg-bunker-500 px-4 py-6 text-bunker-300 shadow-xl">
|
<div className="mb-8 rounded-md bg-mineshaft-900 border border-mineshaft-700 px-4 py-6 text-bunker-300 shadow-xl">
|
||||||
<div className="max-w-md">
|
<div className="max-w-md">
|
||||||
You are not part of any projects in this organization yet. When you are, they will appear
|
You are not part of any projects in this organization yet. When you are, they will appear
|
||||||
here.
|
here.
|
||||||
|
|||||||
+6
-3
@@ -184,6 +184,7 @@ export const OrgMembersTable = ({
|
|||||||
defaultValue={role}
|
defaultValue={role}
|
||||||
isDisabled={userId === user?._id}
|
isDisabled={userId === user?._id}
|
||||||
className="w-40 bg-mineshaft-600"
|
className="w-40 bg-mineshaft-600"
|
||||||
|
dropdownContainerClassName="border border-mineshaft-600 bg-mineshaft-800"
|
||||||
onValueChange={(selectedRole) =>
|
onValueChange={(selectedRole) =>
|
||||||
onRoleChange(orgMembershipId, selectedRole)
|
onRoleChange(orgMembershipId, selectedRole)
|
||||||
}
|
}
|
||||||
@@ -196,7 +197,7 @@ export const OrgMembersTable = ({
|
|||||||
</Select>
|
</Select>
|
||||||
)}
|
)}
|
||||||
{((status === 'invited' || status === 'verified') && serverDetails?.emailConfigured) && (
|
{((status === 'invited' || status === 'verified') && serverDetails?.emailConfigured) && (
|
||||||
<Button className='w-40' colorSchema="secondary" onClick={() => onInviteMember(email)}>
|
<Button className='w-40' colorSchema="primary" variant="outline_bg" onClick={() => onInviteMember(email)}>
|
||||||
Resend Invite
|
Resend Invite
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
@@ -218,8 +219,10 @@ export const OrgMembersTable = ({
|
|||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<div className='flex flex-row'>
|
<div className='flex flex-row'>
|
||||||
<Tag colorSchema="red">This user isn't part of any projects yet</Tag>
|
{((status === 'invited' || status === 'verified') && serverDetails?.emailConfigured)
|
||||||
{router.query.id !== 'undefined' && <button
|
? <Tag colorSchema="red">This user hasn't accepted the invite yet</Tag>
|
||||||
|
: <Tag colorSchema="red">This user isn't part of any projects yet</Tag>}
|
||||||
|
{router.query.id !== 'undefined' && !((status === 'invited' || status === 'verified') && serverDetails?.emailConfigured) && <button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => router.push(`/users/${router.query.id}`)}
|
onClick={() => router.push(`/users/${router.query.id}`)}
|
||||||
className='text-sm bg-mineshaft w-max px-1.5 py-0.5 hover:bg-primary duration-200 hover:text-black cursor-pointer rounded-sm'
|
className='text-sm bg-mineshaft w-max px-1.5 py-0.5 hover:bg-primary duration-200 hover:text-black cursor-pointer rounded-sm'
|
||||||
|
|||||||
+3
-7
@@ -335,15 +335,11 @@ export const OrgServiceAccountsTable = () => {
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
)}
|
)}
|
||||||
{!isServiceAccountsLoading && filteredServiceAccounts?.length === 0 && (
|
|
||||||
<Tr>
|
|
||||||
<Td colSpan={4} className="text-center">
|
|
||||||
<EmptyState title="No service accounts found" icon={faServer} />
|
|
||||||
</Td>
|
|
||||||
</Tr>
|
|
||||||
)}
|
|
||||||
</TBody>
|
</TBody>
|
||||||
</Table>
|
</Table>
|
||||||
|
{!isServiceAccountsLoading && filteredServiceAccounts?.length === 0 && (
|
||||||
|
<EmptyState title="No service accounts found" icon={faServer} />
|
||||||
|
)}
|
||||||
</TableContainer>
|
</TableContainer>
|
||||||
<Modal
|
<Modal
|
||||||
isOpen={popUp?.addServiceAccount?.isOpen}
|
isOpen={popUp?.addServiceAccount?.isOpen}
|
||||||
|
|||||||
Reference in New Issue
Block a user