-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add support for displaying Open Source Friends
- Loading branch information
Showing
12 changed files
with
478 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import PageMap from "../../../Utils/PageMap"; | ||
import RouteMap, { RouteUtil } from "../../../Utils/RouteMap"; | ||
import Route from "Common/Types/API/Route"; | ||
import ObjectID from "Common/Types/ObjectID"; | ||
import ModelDelete from "CommonUI/src/Components/ModelDelete/ModelDelete"; | ||
import Navigation from "CommonUI/src/Utils/Navigation"; | ||
import React, { FunctionComponent, ReactElement } from "react"; | ||
import SideMenuComponent from "./SideMenu"; | ||
import Project from "Model/Models/Project"; | ||
import ModelPage from "CommonUI/src/Components/Page/ModelPage"; | ||
|
||
const DeletePage: FunctionComponent = (): ReactElement => { | ||
const modelId: ObjectID = Navigation.getLastParamAsObjectID(1); | ||
|
||
return ( | ||
<ModelPage<Project> | ||
modelId={modelId} | ||
modelNameField="name" | ||
modelType={Project} | ||
title={"Project"} | ||
breadcrumbLinks={[ | ||
{ | ||
title: "Admin Dashboard", | ||
to: RouteUtil.populateRouteParams(RouteMap[PageMap.HOME] as Route), | ||
}, | ||
{ | ||
title: "Projects", | ||
to: RouteUtil.populateRouteParams( | ||
RouteMap[PageMap.PROJECTS] as Route, | ||
), | ||
}, | ||
{ | ||
title: "Project", | ||
to: RouteUtil.populateRouteParams( | ||
RouteMap[PageMap.PROJECT_VIEW] as Route, | ||
), | ||
}, | ||
]} | ||
sideMenu={<SideMenuComponent modelId={modelId} />} | ||
> | ||
<ModelDelete | ||
modelType={Project} | ||
modelId={modelId} | ||
onDeleteSuccess={() => { | ||
Navigation.navigate(RouteMap[PageMap.PROJECTS] as Route); | ||
}} | ||
/> | ||
</ModelPage> | ||
); | ||
}; | ||
|
||
export default DeletePage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import ObjectID from "Common/Types/ObjectID"; | ||
import PageMap from "../../../Utils/PageMap"; | ||
import RouteMap, { RouteUtil } from "../../../Utils/RouteMap"; | ||
import Route from "Common/Types/API/Route"; | ||
import Navigation from "CommonUI/src/Utils/Navigation"; | ||
import Project from "Model/Models/Project"; | ||
import React, { FunctionComponent, ReactElement } from "react"; | ||
import CardModelDetail from "CommonUI/src/Components/ModelDetail/CardModelDetail"; | ||
import FormFieldSchemaType from "CommonUI/src/Components/Forms/Types/FormFieldSchemaType"; | ||
import FieldType from "CommonUI/src/Components/Types/FieldType"; | ||
import ModelPage from "CommonUI/src/Components/Page/ModelPage"; | ||
import SideMenuComponent from "./SideMenu"; | ||
|
||
const Projects: FunctionComponent = (): ReactElement => { | ||
const modelId: ObjectID = Navigation.getLastParamAsObjectID(); | ||
|
||
return ( | ||
<ModelPage | ||
modelId={modelId} | ||
modelNameField="name" | ||
modelType={Project} | ||
title={"Project"} | ||
breadcrumbLinks={[ | ||
{ | ||
title: "Admin Dashboard", | ||
to: RouteUtil.populateRouteParams(RouteMap[PageMap.HOME] as Route), | ||
}, | ||
{ | ||
title: "Projects", | ||
to: RouteUtil.populateRouteParams( | ||
RouteMap[PageMap.PROJECTS] as Route, | ||
), | ||
}, | ||
{ | ||
title: "Project", | ||
to: RouteUtil.populateRouteParams( | ||
RouteMap[PageMap.PROJECT_VIEW] as Route, | ||
), | ||
}, | ||
]} | ||
sideMenu={<SideMenuComponent modelId={modelId} />} | ||
> | ||
<div> | ||
<CardModelDetail<Project> | ||
name="Project" | ||
cardProps={{ | ||
title: "Project", | ||
description: "Project details", | ||
}} | ||
isEditable={true} | ||
editButtonText="Edit Project" | ||
formFields={[ | ||
{ | ||
field: { | ||
name: true, | ||
}, | ||
title: "Name", | ||
fieldType: FormFieldSchemaType.Text, | ||
required: true, | ||
}, | ||
]} | ||
modelDetailProps={{ | ||
modelType: Project, | ||
id: "model-detail-user", | ||
fields: [ | ||
{ | ||
field: { | ||
_id: true, | ||
}, | ||
title: "Project ID", | ||
fieldType: FieldType.Text, | ||
placeholder: "-", | ||
}, | ||
{ | ||
field: { | ||
name: true, | ||
}, | ||
title: "Name", | ||
fieldType: FieldType.Text, | ||
}, | ||
], | ||
modelId: modelId, | ||
}} | ||
/> | ||
</div> | ||
</ModelPage> | ||
); | ||
}; | ||
|
||
export default Projects; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import PageMap from "../../../Utils/PageMap"; | ||
import RouteMap, { RouteUtil } from "../../../Utils/RouteMap"; | ||
import Route from "Common/Types/API/Route"; | ||
import IconProp from "Common/Types/Icon/IconProp"; | ||
import ObjectID from "Common/Types/ObjectID"; | ||
import SideMenu from "CommonUI/src/Components/SideMenu/SideMenu"; | ||
import SideMenuItem from "CommonUI/src/Components/SideMenu/SideMenuItem"; | ||
import SideMenuSection from "CommonUI/src/Components/SideMenu/SideMenuSection"; | ||
import React, { FunctionComponent, ReactElement } from "react"; | ||
|
||
export interface SideMenuProps { | ||
modelId: ObjectID; | ||
} | ||
|
||
const SideMenuComponent: FunctionComponent<SideMenuProps> = ( | ||
props: SideMenuProps, | ||
): ReactElement => { | ||
return ( | ||
<SideMenu> | ||
<SideMenuSection title="Basic"> | ||
<SideMenuItem | ||
link={{ | ||
title: "Overview", | ||
to: RouteUtil.populateRouteParams( | ||
RouteMap[PageMap.PROJECT_VIEW] as Route, | ||
{ | ||
modelId: props.modelId, | ||
}, | ||
), | ||
}} | ||
icon={IconProp.Info} | ||
/> | ||
</SideMenuSection> | ||
|
||
<SideMenuSection title="Advanced"> | ||
<SideMenuItem | ||
link={{ | ||
title: "Delete", | ||
to: RouteUtil.populateRouteParams( | ||
RouteMap[PageMap.PROJECT_DELETE] as Route, | ||
{ | ||
modelId: props.modelId, | ||
}, | ||
), | ||
}} | ||
icon={IconProp.Trash} | ||
/> | ||
</SideMenuSection> | ||
</SideMenu> | ||
); | ||
}; | ||
|
||
export default SideMenuComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.