mirror of
https://github.com/Unleash/unleash.git
synced 2025-03-09 00:18:26 +01:00
feat: Show project archived message (#7899)
This commit is contained in:
parent
977f969b80
commit
a3decb543f
@ -85,6 +85,7 @@ export const ProjectArchiveCard: FC<ProjectArchiveCardProps> = ({
|
|||||||
</StyledParagraphInfo>
|
</StyledParagraphInfo>
|
||||||
<p data-loading>
|
<p data-loading>
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
minPeriod={60}
|
||||||
date={
|
date={
|
||||||
new Date(archivedAt as string)
|
new Date(archivedAt as string)
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import type { FC } from 'react';
|
||||||
|
|
||||||
|
export const ProjectArchived: FC<{ name: string }> = ({ name }) => {
|
||||||
|
return (
|
||||||
|
<p>
|
||||||
|
The project <strong>{name}</strong> has been archived. You can find
|
||||||
|
it on the{' '}
|
||||||
|
<Link to={`/projects-archive`}>projects archive page</Link>.
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
};
|
@ -43,6 +43,8 @@ import { ChangeRequestPlausibleProvider } from 'component/changeRequest/ChangeRe
|
|||||||
import { ProjectApplications } from '../ProjectApplications/ProjectApplications';
|
import { ProjectApplications } from '../ProjectApplications/ProjectApplications';
|
||||||
import { ProjectInsights } from './ProjectInsights/ProjectInsights';
|
import { ProjectInsights } from './ProjectInsights/ProjectInsights';
|
||||||
import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview';
|
import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview';
|
||||||
|
import { ProjectArchived } from './ArchiveProject/ProjectArchived';
|
||||||
|
import { useUiFlag } from 'hooks/useUiFlag';
|
||||||
|
|
||||||
const StyledBadge = styled(Badge)(({ theme }) => ({
|
const StyledBadge = styled(Badge)(({ theme }) => ({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
@ -75,6 +77,7 @@ export const Project = () => {
|
|||||||
const basePath = `/projects/${projectId}`;
|
const basePath = `/projects/${projectId}`;
|
||||||
const projectName = project?.name || projectId;
|
const projectName = project?.name || projectId;
|
||||||
const { favorite, unfavorite } = useFavoriteProjectsApi();
|
const { favorite, unfavorite } = useFavoriteProjectsApi();
|
||||||
|
const archiveProjectsEnabled = useUiFlag('archiveProjects');
|
||||||
|
|
||||||
const [showDelDialog, setShowDelDialog] = useState(false);
|
const [showDelDialog, setShowDelDialog] = useState(false);
|
||||||
|
|
||||||
@ -189,6 +192,10 @@ export const Project = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (archiveProjectsEnabled && Boolean(project.archivedAt)) {
|
||||||
|
return <ProjectArchived name={project.name} />;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={ref}>
|
<div ref={ref}>
|
||||||
<StyledHeader>
|
<StyledHeader>
|
||||||
|
@ -59,6 +59,7 @@ export interface IProjectOverview {
|
|||||||
defaultStickiness: string;
|
defaultStickiness: string;
|
||||||
featureLimit?: number;
|
featureLimit?: number;
|
||||||
featureNaming?: FeatureNamingType;
|
featureNaming?: FeatureNamingType;
|
||||||
|
archivedAt?: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IProjectHealthReport extends IProject {
|
export interface IProjectHealthReport extends IProject {
|
||||||
|
Loading…
Reference in New Issue
Block a user