mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-10 17:53:36 +02:00
fix: bug with feature type matching
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
parent
d5b4933df1
commit
da0956b4d0
@ -13,12 +13,11 @@ export const formatStatus = (
|
||||
const { type, createdAt } = feature;
|
||||
|
||||
const featureType = featureTypes.find(
|
||||
featureType => featureType.name === type
|
||||
featureType => featureType.id === type
|
||||
);
|
||||
const date = parseISO(createdAt);
|
||||
const now = new Date();
|
||||
const diff = getDiffInDays(date, now);
|
||||
|
||||
if (
|
||||
featureType &&
|
||||
expired(diff, featureType) &&
|
||||
|
@ -59,21 +59,20 @@ export const ReportTable = ({ projectId, features }: IReportTableProps) => {
|
||||
);
|
||||
const { featureTypes } = useFeatureTypes();
|
||||
|
||||
const data: IReportTableRow[] = useMemo<IReportTableRow[]>(
|
||||
() =>
|
||||
features.map(report => ({
|
||||
project: projectId,
|
||||
name: report.name,
|
||||
type: report.type,
|
||||
stale: report.stale,
|
||||
environments: report.environments,
|
||||
status: formatStatus(report, featureTypes),
|
||||
lastSeenAt: report.lastSeenAt,
|
||||
createdAt: report.createdAt,
|
||||
expiredAt: formatExpiredAt(report, featureTypes),
|
||||
})),
|
||||
[projectId, features]
|
||||
);
|
||||
const data: IReportTableRow[] = useMemo<IReportTableRow[]>(() => {
|
||||
console.log(featureTypes);
|
||||
return features.map(report => ({
|
||||
project: projectId,
|
||||
name: report.name,
|
||||
type: report.type,
|
||||
stale: report.stale,
|
||||
environments: report.environments,
|
||||
status: formatStatus(report, featureTypes),
|
||||
lastSeenAt: report.lastSeenAt,
|
||||
createdAt: report.createdAt,
|
||||
expiredAt: formatExpiredAt(report, featureTypes),
|
||||
}));
|
||||
}, [projectId, features, featureTypes]);
|
||||
|
||||
const initialState = useMemo(
|
||||
() => ({
|
||||
@ -145,7 +144,7 @@ export const ReportTable = ({ projectId, features }: IReportTableProps) => {
|
||||
maxWidth: 120,
|
||||
},
|
||||
],
|
||||
[showEnvironmentLastSeen]
|
||||
[showEnvironmentLastSeen, JSON.stringify(data)]
|
||||
);
|
||||
|
||||
const {
|
||||
|
Loading…
Reference in New Issue
Block a user