1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-03 01:18:43 +02:00
unleash.unleash/src/lib/__snapshots__/create-config.test.ts.snap
Christopher Kolstad 21b4ada577
feat: multiple project roles (#4512)
https://linear.app/unleash/issue/2-1128/change-the-api-to-support-adding-multiple-roles-to-a-usergroup-on-a

https://linear.app/unleash/issue/2-1125/be-able-to-fetch-all-roles-for-a-user-in-a-project

https://linear.app/unleash/issue/2-1127/adapt-the-ui-to-be-able-to-do-a-multi-select-on-role-permissions-for

- Allows assigning project roles to groups with root roles
- Implements new methods that support assigning, editing, removing and
retrieving multiple project roles in project access, along with other
auxiliary methods
- Adds new events for updating and removing assigned roles
- Adapts `useProjectApi` to new methods that use new endpoints that
support multiple roles
- Adds the `multipleRoles` feature flag that controls the possibility of
selecting multiple roles on the UI
- Adapts `ProjectAccessAssign` to support multiple role, using the new
methods
- Adds a new `MultipleRoleSelect` component that allows you to select
multiple roles based on the `RoleSelect` component
- Adapts the `RoleCell` component to support either a single role or
multiple roles
- Updates the `access.spec.ts` Cypress e2e test to reflect our new logic
- Updates `access-service.e2e.test.ts` with tests covering the multiple
roles logic and covering some corner cases
- Updates `project-service.e2e.test.ts` to adapt to the new logic,
adding a test that covers adding access with `[roles], [groups],
[users]`
- Misc refactors and boy scouting


![image](https://github.com/Unleash/unleash/assets/14320932/d1cc7626-9387-4ab8-9860-cd293a0d4f62)

---------

Co-authored-by: David Leek <david@getunleash.io>
Co-authored-by: Mateusz Kwasniewski <kwasniewski.mateusz@gmail.com>
Co-authored-by: Nuno Góis <github@nunogois.com>
2023-08-25 09:31:37 +01:00

201 lines
5.0 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should create default config 1`] = `
{
"accessControlMaxAge": 86400,
"additionalCspAllowedDomains": {
"connectSrc": [],
"defaultSrc": [],
"fontSrc": [],
"imgSrc": [],
"scriptSrc": [],
"styleSrc": [],
},
"authentication": {
"createAdminUser": true,
"customAuthHandler": [Function],
"enableApiToken": true,
"initApiTokens": [],
"type": "open-source",
},
"clientFeatureCaching": {
"enabled": true,
"maxAge": 3600000,
},
"db": {
"acquireConnectionTimeout": 30000,
"applicationName": "unleash",
"database": "unleash_db",
"disableMigration": false,
"driver": "postgres",
"host": "localhost",
"password": "password",
"pool": {
"idleTimeoutMillis": 30000,
"max": 4,
"min": 0,
"propagateCreateError": false,
},
"port": 4242,
"schema": "public",
"ssl": {
"rejectUnauthorized": false,
},
"user": "unleash",
"version": undefined,
},
"disableScheduler": undefined,
"email": {
"host": undefined,
"port": 587,
"secure": false,
"sender": "noreply@getunleash.io",
"smtppass": undefined,
"smtpuser": undefined,
},
"enableOAS": true,
"enterpriseVersion": undefined,
"environmentEnableOverrides": [],
"eventBus": EventEmitter {
"_events": {},
"_eventsCount": 0,
"_maxListeners": undefined,
Symbol(kCapture): false,
},
"experimental": {
"externalResolver": {
"getVariant": [Function],
"isEnabled": [Function],
},
"flags": {
"anonymiseEventLog": false,
"caseInsensitiveInOperators": false,
"changeRequestReject": false,
"customRootRolesKillSwitch": false,
"demo": false,
"disableBulkToggle": false,
"disableNotifications": false,
"embedProxy": true,
"embedProxyFrontend": true,
"featuresExportImport": true,
"filterInvalidClientMetrics": false,
"googleAuthEnabled": false,
"integrationsRework": false,
"lastSeenByEnvironment": false,
"maintenanceMode": false,
"messageBanner": {
"enabled": false,
"name": "message-banner",
"payload": {
"type": "json",
"value": "",
},
},
"migrationLock": true,
"multipleRoles": false,
"personalAccessTokensKillSwitch": false,
"proPlanAutoCharge": false,
"responseTimeWithAppNameKillSwitch": false,
"segmentChangeRequests": false,
"slackAppAddon": false,
"strategyVariant": false,
"strictSchemaValidation": false,
},
},
"flagResolver": FlagResolver {
"experiments": {
"anonymiseEventLog": false,
"caseInsensitiveInOperators": false,
"changeRequestReject": false,
"customRootRolesKillSwitch": false,
"demo": false,
"disableBulkToggle": false,
"disableNotifications": false,
"embedProxy": true,
"embedProxyFrontend": true,
"featuresExportImport": true,
"filterInvalidClientMetrics": false,
"googleAuthEnabled": false,
"integrationsRework": false,
"lastSeenByEnvironment": false,
"maintenanceMode": false,
"messageBanner": {
"enabled": false,
"name": "message-banner",
"payload": {
"type": "json",
"value": "",
},
},
"migrationLock": true,
"multipleRoles": false,
"personalAccessTokensKillSwitch": false,
"proPlanAutoCharge": false,
"responseTimeWithAppNameKillSwitch": false,
"segmentChangeRequests": false,
"slackAppAddon": false,
"strategyVariant": false,
"strictSchemaValidation": false,
},
"externalResolver": {
"getVariant": [Function],
"isEnabled": [Function],
},
},
"frontendApi": {
"refreshIntervalInMs": 20000,
},
"frontendApiOrigins": [
"*",
],
"getLogger": [Function],
"import": {
"dropBeforeImport": false,
"file": undefined,
"keepExisting": false,
},
"inlineSegmentConstraints": true,
"listen": {
"host": undefined,
"port": 4242,
},
"preHook": undefined,
"preRouterHook": undefined,
"prometheusApi": undefined,
"publicFolder": undefined,
"secureHeaders": false,
"segmentValuesLimit": 1000,
"server": {
"baseUriPath": "",
"cdnPrefix": undefined,
"enableHeapSnapshotEnpoint": false,
"enableRequestLogger": false,
"gracefulShutdownEnable": true,
"gracefulShutdownTimeout": 1000,
"headersTimeout": 61000,
"host": undefined,
"keepAliveTimeout": 15000,
"pipe": undefined,
"port": 4242,
"secret": "super-secret",
"serverMetrics": true,
"unleashUrl": "http://localhost:4242",
},
"session": {
"clearSiteDataOnLogout": true,
"cookieName": "unleash-session",
"db": true,
"ttlHours": 48,
},
"strategySegmentsLimit": 5,
"telemetry": true,
"ui": {
"environment": "Open Source",
},
"versionCheck": {
"enable": true,
"url": "https://version.unleash.run",
},
}
`;