mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
![image](https://user-images.githubusercontent.com/14320932/202286759-b9c30228-59cc-4c58-a7b0-3c6c3d0ecba6.png) ## About the changes https://linear.app/unleash/issue/2-425/variants-crud-new-environment-cards-with-tables-inside-add-edit-and Basically created parallel components for the **variants per environments** feature, so both flows should work correctly depending on the feature flag state. Some of the duplication means that cleanup should be straightforward - Once we're happy with this feature it should be enough to delete `frontend/src/component/feature/FeatureView/FeatureVariants/FeatureVariantsList` and do some little extra cleanup. I noticed we had some legacy-looking code in variants, so this involved *some* rewriting of the current variants logic. Hopefully this new code looks nicer, more maintainable, and more importantly **doesn't break anything**. Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item: #2254 ### Important files Everything inside the `frontend/src/component/feature/FeatureView/FeatureVariants/FeatureEnvironmentVariants` folder.
72 lines
2.6 KiB
TypeScript
72 lines
2.6 KiB
TypeScript
import { start } from './lib/server-impl';
|
|
import { createConfig } from './lib/create-config';
|
|
import { LogLevel } from './lib/logger';
|
|
import { ApiTokenType } from './lib/types/models/api-token';
|
|
|
|
process.nextTick(async () => {
|
|
try {
|
|
await start(
|
|
createConfig({
|
|
db: {
|
|
user: 'unleash_user',
|
|
password: 'passord',
|
|
host: 'localhost',
|
|
port: 5432,
|
|
database: process.env.UNLEASH_DATABASE_NAME || 'unleash',
|
|
schema: process.env.UNLEASH_DATABASE_SCHEMA,
|
|
ssl: false,
|
|
applicationName: 'unleash',
|
|
},
|
|
server: {
|
|
enableRequestLogger: true,
|
|
baseUriPath: '',
|
|
// keepAliveTimeout: 1,
|
|
gracefulShutdownEnable: true,
|
|
// cdnPrefix: 'https://cdn.getunleash.io/unleash/v4.4.1',
|
|
},
|
|
logLevel: LogLevel.debug,
|
|
enableOAS: true,
|
|
// secureHeaders: true,
|
|
versionCheck: {
|
|
enable: false,
|
|
},
|
|
experimental: {
|
|
// externalResolver: unleash,
|
|
flags: {
|
|
embedProxy: true,
|
|
embedProxyFrontend: true,
|
|
batchMetrics: true,
|
|
anonymiseEventLog: false,
|
|
responseTimeWithAppName: true,
|
|
syncSSOGroups: true,
|
|
changeRequests: true,
|
|
cloneEnvironment: true,
|
|
toggleTagFiltering: true,
|
|
variantsPerEnvironment: true,
|
|
},
|
|
},
|
|
authentication: {
|
|
initApiTokens: [
|
|
{
|
|
environment: '*',
|
|
project: '*',
|
|
secret: '*:*.964a287e1b728cb5f4f3e0120df92cb5',
|
|
type: ApiTokenType.ADMIN,
|
|
username: 'some-user',
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
);
|
|
} catch (error) {
|
|
if (error.code === 'EADDRINUSE') {
|
|
// eslint-disable-next-line no-console
|
|
console.warn('Port in use. You might want to reload once more.');
|
|
} else {
|
|
// eslint-disable-next-line no-console
|
|
console.error(error);
|
|
process.exit();
|
|
}
|
|
}
|
|
}, 0);
|