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

feat: archived row styling #8608

Merged
merged 5 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Expand Up @@ -22,6 +22,7 @@ interface IFeatureNameCellProps {
| 'tags'
| 'type'
| 'dependencyType'
| 'archivedAt'
>;
};
}
Expand Down Expand Up @@ -138,6 +139,22 @@ const FeatureName: FC<{
);
};

const ArchivedFeatureName: FC<{
feature: string;
searchQuery: string;
}> = ({ feature, searchQuery }) => {
return (
<Box
sx={(theme) => ({
fontWeight: theme.typography.fontWeightBold,
color: theme.palette.neutral.main,
})}
>
<Highlighter search={searchQuery}>{feature}</Highlighter>
</Box>
);
};

const RestTags: FC<{ tags: string[]; onClick: (tag: string) => void }> = ({
tags,
onClick,
Expand Down Expand Up @@ -236,6 +253,7 @@ const DependencyPreview: FC<{ feature: string; project: string }> = ({
export const PrimaryFeatureInfo: FC<{
project: string;
feature: string;
archivedAt: string | null;
searchQuery: string;
type: string;
dependencyType: string;
Expand All @@ -244,6 +262,7 @@ export const PrimaryFeatureInfo: FC<{
}> = ({
project,
feature,
archivedAt,
type,
searchQuery,
dependencyType,
Expand Down Expand Up @@ -275,11 +294,19 @@ export const PrimaryFeatureInfo: FC<{
return (
<FeatureNameAndType data-loading>
<TypeIcon />
<FeatureName
project={project}
feature={feature}
searchQuery={searchQuery}
/>
{archivedAt ? (
<ArchivedFeatureName
feature={feature}
searchQuery={searchQuery}
/>
) : (
<FeatureName
project={project}
feature={feature}
searchQuery={searchQuery}
/>
)}

<ConditionallyRender
condition={Boolean(dependencyType)}
show={
Expand All @@ -305,6 +332,11 @@ export const PrimaryFeatureInfo: FC<{
</HtmlTooltip>
}
/>
{archivedAt && (
<HtmlTooltip arrow title={archivedAt} describeChild>
<Badge color='neutral'>Archived</Badge>
</HtmlTooltip>
)}
</FeatureNameAndType>
);
};
Expand Down Expand Up @@ -343,6 +375,7 @@ export const FeatureOverviewCell =
<PrimaryFeatureInfo
project={row.original.project || ''}
feature={row.original.name}
archivedAt={row.original.archivedAt}
searchQuery={searchQuery}
type={row.original.type || ''}
dependencyType={row.original.dependencyType || ''}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/openapi/models/featureSearchResponseSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface FeatureSearchResponseSchema {
* The date the feature was archived
* @nullable
*/
archivedAt?: string | null;
archivedAt: string | null;
/**
* The date the feature was created
* @nullable
Expand Down
1 change: 1 addition & 0 deletions src/lib/openapi/spec/feature-search-response-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const featureSearchResponseSchema = {
'createdBy',
'environments',
'segments',
'archivedAt',
],
description: 'A feature flag definition',
properties: {
Expand Down
Loading