mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
chore: remove featureSearchAPI flag (#6081)
This commit is contained in:
parent
aae1d0576f
commit
d7eb950f3a
@ -64,7 +64,6 @@ export type UiFlags = {
|
||||
doraMetrics?: boolean;
|
||||
dependentFeatures?: boolean;
|
||||
scheduledConfigurationChanges?: boolean;
|
||||
featureSearchAPI?: boolean;
|
||||
newStrategyConfiguration?: boolean;
|
||||
incomingWebhooks?: boolean;
|
||||
automatedActions?: boolean;
|
||||
|
@ -95,7 +95,6 @@ exports[`should create default config 1`] = `
|
||||
"executiveDashboard": false,
|
||||
"extendedUsageMetrics": false,
|
||||
"extendedUsageMetricsUI": false,
|
||||
"featureSearchAPI": true,
|
||||
"featureSearchFeedback": false,
|
||||
"featureSearchFeedbackPosting": false,
|
||||
"featuresExportImport": true,
|
||||
|
@ -15,7 +15,6 @@ import {
|
||||
searchFeaturesSchema,
|
||||
} from '../../openapi';
|
||||
import { IAuthRequest } from '../../routes/unleash-types';
|
||||
import { InvalidOperationError } from '../../error';
|
||||
import {
|
||||
FeatureSearchQueryParameters,
|
||||
featureSearchQueryParameters,
|
||||
@ -75,68 +74,65 @@ export default class FeatureSearchController extends Controller {
|
||||
req: IAuthRequest<any, any, any, FeatureSearchQueryParameters>,
|
||||
res: Response,
|
||||
): Promise<void> {
|
||||
if (this.config.flagResolver.isEnabled('featureSearchAPI')) {
|
||||
const {
|
||||
query,
|
||||
project,
|
||||
type,
|
||||
tag,
|
||||
segment,
|
||||
createdAt,
|
||||
state,
|
||||
status,
|
||||
offset,
|
||||
limit = '50',
|
||||
sortOrder,
|
||||
sortBy,
|
||||
favoritesFirst,
|
||||
} = req.query;
|
||||
const userId = req.user.id;
|
||||
const normalizedQuery = query
|
||||
?.split(',')
|
||||
.map((query) => query.trim())
|
||||
.filter((query) => query);
|
||||
const normalizedStatus = status
|
||||
?.map((tag) => tag.split(':'))
|
||||
.filter(
|
||||
(tag) =>
|
||||
tag.length === 2 &&
|
||||
['enabled', 'disabled'].includes(tag[1]),
|
||||
);
|
||||
const normalizedLimit =
|
||||
Number(limit) > 0 && Number(limit) <= 100 ? Number(limit) : 25;
|
||||
const normalizedOffset = Number(offset) > 0 ? Number(offset) : 0;
|
||||
const normalizedSortBy: string = sortBy ? sortBy : 'createdAt';
|
||||
const normalizedSortOrder =
|
||||
sortOrder === 'asc' || sortOrder === 'desc' ? sortOrder : 'asc';
|
||||
const normalizedFavoritesFirst = favoritesFirst === 'true';
|
||||
const { features, total } = await this.featureSearchService.search({
|
||||
searchParams: normalizedQuery,
|
||||
project,
|
||||
type,
|
||||
userId,
|
||||
tag,
|
||||
segment,
|
||||
state,
|
||||
createdAt,
|
||||
status: normalizedStatus,
|
||||
offset: normalizedOffset,
|
||||
limit: normalizedLimit,
|
||||
sortBy: normalizedSortBy,
|
||||
sortOrder: normalizedSortOrder,
|
||||
favoritesFirst: normalizedFavoritesFirst,
|
||||
});
|
||||
const {
|
||||
query,
|
||||
project,
|
||||
type,
|
||||
tag,
|
||||
segment,
|
||||
createdAt,
|
||||
state,
|
||||
status,
|
||||
offset,
|
||||
limit = '50',
|
||||
sortOrder,
|
||||
sortBy,
|
||||
favoritesFirst,
|
||||
} = req.query;
|
||||
const userId = req.user.id;
|
||||
const normalizedQuery = query
|
||||
?.split(',')
|
||||
.map((query) => query.trim())
|
||||
.filter((query) => query);
|
||||
const normalizedStatus = status
|
||||
?.map((tag) => tag.split(':'))
|
||||
.filter(
|
||||
(tag) =>
|
||||
tag.length === 2 &&
|
||||
['enabled', 'disabled'].includes(tag[1]),
|
||||
);
|
||||
const normalizedLimit =
|
||||
Number(limit) > 0 && Number(limit) <= 100 ? Number(limit) : 25;
|
||||
const normalizedOffset = Number(offset) > 0 ? Number(offset) : 0;
|
||||
const normalizedSortBy: string = sortBy ? sortBy : 'createdAt';
|
||||
const normalizedSortOrder =
|
||||
sortOrder === 'asc' || sortOrder === 'desc' ? sortOrder : 'asc';
|
||||
const normalizedFavoritesFirst = favoritesFirst === 'true';
|
||||
const { features, total } = await this.featureSearchService.search({
|
||||
searchParams: normalizedQuery,
|
||||
project,
|
||||
type,
|
||||
userId,
|
||||
tag,
|
||||
segment,
|
||||
state,
|
||||
createdAt,
|
||||
status: normalizedStatus,
|
||||
offset: normalizedOffset,
|
||||
limit: normalizedLimit,
|
||||
sortBy: normalizedSortBy,
|
||||
sortOrder: normalizedSortOrder,
|
||||
favoritesFirst: normalizedFavoritesFirst,
|
||||
});
|
||||
|
||||
this.openApiService.respondWithValidation(
|
||||
200,
|
||||
res,
|
||||
searchFeaturesSchema.$id,
|
||||
serializeDates({ features, total }),
|
||||
);
|
||||
} else {
|
||||
throw new InvalidOperationError(
|
||||
'Feature Search API is not enabled',
|
||||
);
|
||||
}
|
||||
this.openApiService.respondWithValidation(
|
||||
200,
|
||||
res,
|
||||
searchFeaturesSchema.$id,
|
||||
serializeDates({
|
||||
features,
|
||||
total,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ beforeAll(async () => {
|
||||
experimental: {
|
||||
flags: {
|
||||
strictSchemaValidation: true,
|
||||
featureSearchAPI: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -27,7 +27,6 @@ export type IFlagKey =
|
||||
| 'filterInvalidClientMetrics'
|
||||
| 'customRootRolesKillSwitch'
|
||||
| 'disableMetrics'
|
||||
| 'featureSearchAPI'
|
||||
| 'scheduledConfigurationChanges'
|
||||
| 'detectSegmentUsageInChangeRequests'
|
||||
| 'stripClientHeadersOn304'
|
||||
@ -130,10 +129,6 @@ const flags: IFlags = {
|
||||
process.env.UNLEASH_EXPERIMENTAL_DISABLE_METRICS,
|
||||
false,
|
||||
),
|
||||
featureSearchAPI: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_FEATURE_SEARCH_API,
|
||||
true,
|
||||
),
|
||||
scheduledConfigurationChanges: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_SCHEDULED_CONFIGURATION_CHANGES,
|
||||
false,
|
||||
|
@ -40,7 +40,6 @@ process.nextTick(async () => {
|
||||
embedProxyFrontend: true,
|
||||
anonymiseEventLog: false,
|
||||
responseTimeWithAppNameKillSwitch: false,
|
||||
featureSearchAPI: true,
|
||||
stripClientHeadersOn304: true,
|
||||
newStrategyConfiguration: true,
|
||||
stripHeadersOnAPI: true,
|
||||
|
Loading…
Reference in New Issue
Block a user