[WEB-440] feat: create project feature selection modal. (#3909)

* [WEB-440] feat: create project feature selection modal.
* [WEB-399] chore: explain project identifier.

* chore: use `Link` component for redirection to project page.
This commit is contained in:
Prateek Shourya 2024-03-08 17:38:42 +05:30 committed by GitHub
parent f5151ae717
commit 2074bb97db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 535 additions and 396 deletions

View file

@ -13,6 +13,8 @@ import { ProjectSettingLayout } from "layouts/settings-layout";
// components
// types
import { NextPageWithLayout } from "lib/types";
// constants
import { EUserProjectRoles } from "constants/project";
const FeaturesSettingsPage: NextPageWithLayout = observer(() => {
const router = useRouter();
@ -28,9 +30,11 @@ const FeaturesSettingsPage: NextPageWithLayout = observer(() => {
workspaceSlug && projectId ? () => fetchUserProjectInfo(workspaceSlug.toString(), projectId.toString()) : null
);
// derived values
const isAdmin = memberDetails?.role === 20;
const isAdmin = memberDetails?.role === EUserProjectRoles.ADMIN;
const pageTitle = currentProjectDetails?.name ? `${currentProjectDetails?.name} - Features` : undefined;
if (!workspaceSlug || !projectId) return null;
return (
<>
<PageHead title={pageTitle} />
@ -38,7 +42,11 @@ const FeaturesSettingsPage: NextPageWithLayout = observer(() => {
<div className="flex items-center border-b border-custom-border-100 py-3.5">
<h3 className="text-xl font-medium">Features</h3>
</div>
<ProjectFeaturesList />
<ProjectFeaturesList
workspaceSlug={workspaceSlug.toString()}
projectId={projectId.toString()}
isAdmin={isAdmin}
/>
</section>
</>
);