Skip to content

Commit

Permalink
[Gitar] Updating TypeScript files
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitar committed Aug 19, 2024
1 parent 9fcfa0b commit 26df2d6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 29 deletions.
1 change: 0 additions & 1 deletion frontend/src/interfaces/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export type UiFlags = {
maintenanceMode?: boolean;
messageBanner?: Variant;
banner?: Variant;
featuresExportImport?: boolean;
caseInsensitiveInOperators?: boolean;
notifications?: boolean;
personalAccessTokensKillSwitch?: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/lib/__snapshots__/create-config.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ exports[`should create default config 1`] = `
},
},
"featureSearchFeedbackPosting": false,
"featuresExportImport": true,
"feedbackComments": {
"enabled": false,
"name": "feedbackComments",
Expand Down
12 changes: 2 additions & 10 deletions src/lib/features/export-import-toggles/export-import-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import {
importTogglesValidateSchema,
} from '../../openapi';
import type { IAuthRequest } from '../../routes/unleash-types';
import { extractUsername } from '../../util';
import { BadDataError, InvalidOperationError } from '../../error';
import { BadDataError } from '../../error';
import ApiUser from '../../types/api-user';

class ExportImportController extends Controller {
Expand Down Expand Up @@ -118,7 +117,6 @@ class ExportImportController extends Controller {
): Promise<void> {
this.verifyExportImportEnabled();
const query = req.body;
const userName = extractUsername(req);

const data = await this.exportService.export(query, req.audit);

Expand Down Expand Up @@ -172,12 +170,6 @@ class ExportImportController extends Controller {
res.status(200).end();
}

private verifyExportImportEnabled() {
if (!this.config.flagResolver.isEnabled('featuresExportImport')) {
throw new InvalidOperationError(
'Feature export/import is not enabled',
);
}
}
private verifyExportImportEnabled() {}
}
export default ExportImportController;
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,7 @@ beforeAll(async () => {
db.stores,
{
experimental: {
flags: {
featuresExportImport: true,
},
flags: {},
},
},
db.rawDatabase,
Expand Down
14 changes: 6 additions & 8 deletions src/lib/features/export-import-toggles/export-import.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ beforeAll(async () => {
db.stores,
{
experimental: {
flags: {
featuresExportImport: true,
},
flags: {},
},
},
db.rawDatabase,
Expand Down Expand Up @@ -229,7 +227,7 @@ describe('import-export for project-specific segments', () => {
.set('Content-Type', 'application/json')
.expect(200);

const { name, ...resultStrategy } = strategy;
const { ...resultStrategy } = strategy;
expect(body).toMatchObject({
features: [
{
Expand Down Expand Up @@ -301,7 +299,7 @@ test('exports features', async () => {
.set('Content-Type', 'application/json')
.expect(200);

const { name, ...resultStrategy } = strategy;
const { ...resultStrategy } = strategy;
expect(body).toMatchObject({
features: [
{
Expand Down Expand Up @@ -377,7 +375,7 @@ test('exports features by tag', async () => {
.set('Content-Type', 'application/json')
.expect(200);

const { name, ...resultStrategy } = strategy;
const { ...resultStrategy } = strategy;
expect(body).toMatchObject({
features: [
{
Expand Down Expand Up @@ -475,7 +473,7 @@ test('should export custom context fields from strategies and variants', async (
.set('Content-Type', 'application/json')
.expect(200);

const { name, ...resultStrategy } = strategy;
const { ...resultStrategy } = strategy;
expect(body).toMatchObject({
features: [
{
Expand Down Expand Up @@ -520,7 +518,7 @@ test('should export tags', async () => {
.set('Content-Type', 'application/json')
.expect(200);

const { name, ...resultStrategy } = defaultStrategy;
const { ...resultStrategy } = defaultStrategy;
expect(body).toMatchObject({
features: [
{
Expand Down
1 change: 0 additions & 1 deletion src/lib/openapi/spec/ui-config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export const uiConfigSchema = {
name: 'disabled',
enabled: false,
},
featuresExportImport: true,
},
additionalProperties: {
anyOf: [
Expand Down
5 changes: 0 additions & 5 deletions src/lib/types/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export type IFlagKey =
| 'responseTimeWithAppNameKillSwitch'
| 'maintenanceMode'
| 'messageBanner'
| 'featuresExportImport'
| 'caseInsensitiveInOperators'
| 'strictSchemaValidation'
| 'personalAccessTokensKillSwitch'
Expand Down Expand Up @@ -103,10 +102,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_MESSAGE_BANNER_PAYLOAD ?? '',
},
},
featuresExportImport: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_FEATURES_EXPORT_IMPORT,
true,
),
caseInsensitiveInOperators: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_CASE_INSENSITIVE_IN_OPERATORS,
false,
Expand Down

0 comments on commit 26df2d6

Please sign in to comment.