Stop showing insight indicator for non-forks
This commit is contained in:
parent
5b391813b4
commit
d524348719
@ -44,7 +44,6 @@ export default async function AdminAppInsights() {
|
||||
const { isAiTextGenerationEnabled } = APP_CONFIGURATION;
|
||||
|
||||
const {
|
||||
noFork,
|
||||
forkBehind,
|
||||
noAiRateLimiting,
|
||||
outdatedPhotos,
|
||||
@ -57,7 +56,7 @@ export default async function AdminAppInsights() {
|
||||
<AdminAppInsightsClient
|
||||
codeMeta={codeMeta}
|
||||
insights={{
|
||||
noFork,
|
||||
noFork: !codeMeta?.isForkedFromBase && !codeMeta?.isBaseRepo,
|
||||
forkBehind,
|
||||
noAi: !isAiTextGenerationEnabled,
|
||||
noAiRateLimiting,
|
||||
|
||||
@ -9,30 +9,29 @@ import {
|
||||
import { getPhotosMeta } from '@/photo/db/query';
|
||||
import { OUTDATED_THRESHOLD } from '@/photo';
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
export const getShouldShowInsightsIndicatorAction = async (): Promise<InsightIndicatorStatus> =>
|
||||
runAuthenticatedAdminServerAction(async () => {
|
||||
const [
|
||||
codeMeta,
|
||||
{ count: photosCountOutdated },
|
||||
] = await Promise.all([
|
||||
getGitHubMetaForCurrentApp(),
|
||||
getPhotosMeta({ hidden: 'include', updatedBefore: OUTDATED_THRESHOLD }),
|
||||
]);
|
||||
|
||||
const {
|
||||
noFork,
|
||||
forkBehind,
|
||||
noAiRateLimiting,
|
||||
outdatedPhotos,
|
||||
} = getSignificantInsights({
|
||||
codeMeta,
|
||||
photosCountOutdated,
|
||||
});
|
||||
export const getShouldShowInsightsIndicatorAction =
|
||||
async (): Promise<InsightIndicatorStatus> =>
|
||||
runAuthenticatedAdminServerAction(async () => {
|
||||
const [
|
||||
codeMeta,
|
||||
{ count: photosCountOutdated },
|
||||
] = await Promise.all([
|
||||
getGitHubMetaForCurrentApp(),
|
||||
getPhotosMeta({ hidden: 'include', updatedBefore: OUTDATED_THRESHOLD }),
|
||||
]);
|
||||
|
||||
const {
|
||||
forkBehind,
|
||||
noAiRateLimiting,
|
||||
outdatedPhotos,
|
||||
} = getSignificantInsights({
|
||||
codeMeta,
|
||||
photosCountOutdated,
|
||||
});
|
||||
|
||||
if (noAiRateLimiting || outdatedPhotos) {
|
||||
return 'yellow';
|
||||
} else if (noFork || forkBehind) {
|
||||
return 'blue';
|
||||
}
|
||||
});
|
||||
if (noAiRateLimiting || outdatedPhotos) {
|
||||
return 'yellow';
|
||||
} else if (forkBehind) {
|
||||
return 'blue';
|
||||
}
|
||||
});
|
||||
|
||||
@ -69,7 +69,6 @@ export const getSignificantInsights = ({
|
||||
} = APP_CONFIGURATION;
|
||||
|
||||
return {
|
||||
noFork: !codeMeta?.isForkedFromBase && !codeMeta?.isBaseRepo,
|
||||
forkBehind: Boolean(codeMeta?.isBehind),
|
||||
noAiRateLimiting: isAiTextGenerationEnabled && !hasRedisStorage,
|
||||
outdatedPhotos: Boolean(photosCountOutdated),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user