mage-ai 0.9.33__py3-none-any.whl → 0.9.34__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/api/mixins/__init__.py +0 -0
- mage_ai/api/mixins/result_set.py +65 -0
- mage_ai/api/operations/base.py +8 -3
- mage_ai/api/policies/BasePolicy.py +127 -2
- mage_ai/api/policies/PermissionPolicy.py +5 -0
- mage_ai/api/policies/UserPolicy.py +25 -2
- mage_ai/api/policies/mixins/user_permissions.py +0 -9
- mage_ai/api/presenters/PermissionPresenter.py +2 -0
- mage_ai/api/presenters/RolePresenter.py +15 -0
- mage_ai/api/presenters/UserPresenter.py +9 -15
- mage_ai/api/resources/PermissionResource.py +40 -3
- mage_ai/api/resources/RoleResource.py +1 -0
- mage_ai/api/resources/UserResource.py +35 -4
- mage_ai/orchestration/db/models/oauth.py +126 -0
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/PBVuphyo_muEAj347ZP_b/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{3859-3501cdba0a33f9f2.js → 3859-ba594d21a1260cd2.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/7022-a0fb5af2ebd7bb45.js → frontend_dist/_next/static/chunks/7022-80d082a1d7fd1234.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7361-25f211ef377e5958.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8146-941c5155c3bfcc35.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9264-5730e4e059db40a8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-d7fd4857579e2b00.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-1a95628ea8d0d846.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions-cb1cdf5f8e5bf9c5.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/[...slug]-5061c073e1c0de07.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-f551c5665bfd3494.js +1 -0
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/files.html +5 -5
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist/global-data-products.html +5 -5
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +5 -5
- mage_ai/server/frontend_dist/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist/manage/users.html +5 -5
- mage_ai/server/frontend_dist/manage.html +5 -5
- mage_ai/server/frontend_dist/overview.html +5 -5
- mage_ai/server/frontend_dist/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +5 -5
- mage_ai/server/frontend_dist/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +10 -10
- mage_ai/server/frontend_dist/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist/templates.html +5 -5
- mage_ai/server/frontend_dist/terminal.html +5 -5
- mage_ai/server/frontend_dist/test.html +4 -4
- mage_ai/server/frontend_dist/triggers.html +5 -5
- mage_ai/server/frontend_dist/version-control.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/L-IKw5_bRZUs-wyjnpN_j/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3859-3501cdba0a33f9f2.js → 3859-ba594d21a1260cd2.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/7022-a0fb5af2ebd7bb45.js → frontend_dist_base_path_template/_next/static/chunks/7022-80d082a1d7fd1234.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-25f211ef377e5958.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-941c5155c3bfcc35.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-5730e4e059db40a8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-d7fd4857579e2b00.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-1a95628ea8d0d846.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions-cb1cdf5f8e5bf9c5.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/[...slug]-5061c073e1c0de07.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-f551c5665bfd3494.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/overview.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +10 -10
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/templates.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/terminal.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/test.html +4 -4
- mage_ai/server/frontend_dist_base_path_template/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/version-control.html +5 -5
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/METADATA +1 -1
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/RECORD +137 -133
- mage_ai/server/frontend_dist/_next/static/chunks/8146-6f46ffd7cbe2fd07.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9264-11c4f9e79f8a9fd5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-68f1591d3f4262f1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-672599b18c4eb2a6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions-b7bc84646325062c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/[...slug]-b7b99c3d2109fdea.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-fe480da25b026bb5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/sGWtg0x8VBmlqQeSOAw9E/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-6f46ffd7cbe2fd07.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-11c4f9e79f8a9fd5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-68f1591d3f4262f1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/[...slug]-672599b18c4eb2a6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions-b7bc84646325062c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/[...slug]-b7b99c3d2109fdea.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-fe480da25b026bb5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/dFD_SGZQKSOB83hTxog2E/_buildManifest.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{sGWtg0x8VBmlqQeSOAw9E → PBVuphyo_muEAj347ZP_b}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{dFD_SGZQKSOB83hTxog2E → L-IKw5_bRZUs-wyjnpN_j}/_ssgManifest.js +0 -0
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.33.dist-info → mage_ai-0.9.34.dist-info}/top_level.txt +0 -0
|
@@ -9,9 +9,9 @@ from mage_ai.authentication.passwords import (
|
|
|
9
9
|
)
|
|
10
10
|
from mage_ai.data_preparation.repo_manager import get_project_uuid
|
|
11
11
|
from mage_ai.orchestration.constants import Entity
|
|
12
|
-
from mage_ai.orchestration.db import safe_db_query
|
|
13
|
-
from mage_ai.orchestration.db.models.oauth import Permission, Role, User
|
|
14
|
-
from mage_ai.shared.hash import extract, ignore_keys
|
|
12
|
+
from mage_ai.orchestration.db import db_connection, safe_db_query
|
|
13
|
+
from mage_ai.orchestration.db.models.oauth import Permission, Role, User, UserRole
|
|
14
|
+
from mage_ai.shared.hash import extract, ignore_keys, index_by
|
|
15
15
|
from mage_ai.usage_statistics.logger import UsageStatisticLogger
|
|
16
16
|
|
|
17
17
|
|
|
@@ -176,12 +176,43 @@ class UserResource(DatabaseResource):
|
|
|
176
176
|
payload['password_hash'] = create_bcrypt_hash(password, password_salt)
|
|
177
177
|
payload['password_salt'] = password_salt
|
|
178
178
|
|
|
179
|
+
role_ids = [int(i) for i in payload.get('role_ids') or []]
|
|
180
|
+
role_mapping = index_by(lambda x: x.id, self.roles_new or [])
|
|
181
|
+
|
|
182
|
+
role_ids_create = []
|
|
183
|
+
role_ids_delete = []
|
|
184
|
+
|
|
185
|
+
for role_id in role_ids:
|
|
186
|
+
if role_id not in role_mapping:
|
|
187
|
+
role_ids_create.append(role_id)
|
|
188
|
+
|
|
189
|
+
for role_id in role_mapping.keys():
|
|
190
|
+
if role_id not in role_ids:
|
|
191
|
+
role_ids_delete.append(role_id)
|
|
192
|
+
|
|
193
|
+
if role_ids_create:
|
|
194
|
+
db_connection.session.bulk_save_objects(
|
|
195
|
+
[UserRole(
|
|
196
|
+
role_id=role_id,
|
|
197
|
+
user_id=self.id,
|
|
198
|
+
) for role_id in role_ids_create],
|
|
199
|
+
return_defaults=True,
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
if role_ids_delete:
|
|
203
|
+
delete_statement = UserRole.__table__.delete().where(
|
|
204
|
+
UserRole.role_id.in_(role_ids_delete),
|
|
205
|
+
UserRole.user_id == self.id,
|
|
206
|
+
)
|
|
207
|
+
db_connection.session.execute(delete_statement)
|
|
208
|
+
|
|
179
209
|
return super().update(ignore_keys(payload, [
|
|
210
|
+
'owner',
|
|
180
211
|
'password',
|
|
181
212
|
'password_confirmation',
|
|
182
213
|
'password_current',
|
|
183
|
-
'owner',
|
|
184
214
|
'project_access',
|
|
215
|
+
'role_ids',
|
|
185
216
|
'roles_display',
|
|
186
217
|
]), **kwargs)
|
|
187
218
|
|
|
@@ -12,6 +12,9 @@ from sqlalchemy import (
|
|
|
12
12
|
ForeignKey,
|
|
13
13
|
Integer,
|
|
14
14
|
String,
|
|
15
|
+
and_,
|
|
16
|
+
asc,
|
|
17
|
+
func,
|
|
15
18
|
)
|
|
16
19
|
from sqlalchemy.orm import relationship, validates
|
|
17
20
|
|
|
@@ -158,6 +161,72 @@ class User(BaseModel):
|
|
|
158
161
|
user.roles_new = roles_new
|
|
159
162
|
db_connection.session.commit()
|
|
160
163
|
|
|
164
|
+
def permissions(self) -> List:
|
|
165
|
+
row_number_column = (
|
|
166
|
+
func.
|
|
167
|
+
row_number().
|
|
168
|
+
over(
|
|
169
|
+
order_by=asc(UserRole.id),
|
|
170
|
+
partition_by=Permission.id,
|
|
171
|
+
).
|
|
172
|
+
label('row_number')
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
query = (
|
|
176
|
+
Permission.
|
|
177
|
+
select(
|
|
178
|
+
Permission.access,
|
|
179
|
+
Permission.created_at,
|
|
180
|
+
Permission.entity,
|
|
181
|
+
Permission.entity_id,
|
|
182
|
+
Permission.entity_name,
|
|
183
|
+
Permission.entity_type,
|
|
184
|
+
Permission.id,
|
|
185
|
+
Permission.options,
|
|
186
|
+
Permission.role_id,
|
|
187
|
+
Permission.updated_at,
|
|
188
|
+
Permission.user_id,
|
|
189
|
+
).
|
|
190
|
+
join(
|
|
191
|
+
RolePermission,
|
|
192
|
+
RolePermission.permission_id == Permission.id,
|
|
193
|
+
).
|
|
194
|
+
join(
|
|
195
|
+
Role,
|
|
196
|
+
Role.id == RolePermission.role_id,
|
|
197
|
+
).
|
|
198
|
+
join(
|
|
199
|
+
UserRole,
|
|
200
|
+
and_(
|
|
201
|
+
UserRole.role_id == Role.id,
|
|
202
|
+
UserRole.user_id == self.id,
|
|
203
|
+
),
|
|
204
|
+
)
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
query = query.add_column(row_number_column)
|
|
208
|
+
query = query.from_self().filter(row_number_column == 1)
|
|
209
|
+
rows = query.all()
|
|
210
|
+
|
|
211
|
+
arr = []
|
|
212
|
+
|
|
213
|
+
for row in rows:
|
|
214
|
+
model = Permission()
|
|
215
|
+
model.access = row.access
|
|
216
|
+
model.created_at = row.created_at
|
|
217
|
+
model.entity = row.entity
|
|
218
|
+
model.entity_id = row.entity_id
|
|
219
|
+
model.entity_name = row.entity_name
|
|
220
|
+
model.entity_type = row.entity_type
|
|
221
|
+
model.id = row.id
|
|
222
|
+
model.options = row.options
|
|
223
|
+
model.role_id = row.role_id
|
|
224
|
+
model.updated_at = row.updated_at
|
|
225
|
+
model.user_id = row.user_id
|
|
226
|
+
arr.append(model)
|
|
227
|
+
|
|
228
|
+
return arr
|
|
229
|
+
|
|
161
230
|
|
|
162
231
|
class Role(BaseModel):
|
|
163
232
|
name = Column(String(255), index=True, unique=True)
|
|
@@ -492,6 +561,63 @@ class Permission(BaseModel):
|
|
|
492
561
|
def write_attributes(self, values: List[str]) -> None:
|
|
493
562
|
self.__set_access_attributes('write_attributes', values)
|
|
494
563
|
|
|
564
|
+
def users(self) -> List[User]:
|
|
565
|
+
row_number_column = (
|
|
566
|
+
func.
|
|
567
|
+
row_number().
|
|
568
|
+
over(
|
|
569
|
+
order_by=asc(UserRole.id),
|
|
570
|
+
partition_by=User.id,
|
|
571
|
+
).
|
|
572
|
+
label('row_number')
|
|
573
|
+
)
|
|
574
|
+
|
|
575
|
+
query = (
|
|
576
|
+
User.
|
|
577
|
+
select(
|
|
578
|
+
User.avatar,
|
|
579
|
+
User.created_at,
|
|
580
|
+
User.email,
|
|
581
|
+
User.first_name,
|
|
582
|
+
User.id,
|
|
583
|
+
User.last_name,
|
|
584
|
+
User.preferences,
|
|
585
|
+
User.roles,
|
|
586
|
+
User.updated_at,
|
|
587
|
+
User.username,
|
|
588
|
+
).
|
|
589
|
+
join(UserRole, UserRole.user_id == User.id).
|
|
590
|
+
join(Role, Role.id == UserRole.role_id).
|
|
591
|
+
join(
|
|
592
|
+
RolePermission,
|
|
593
|
+
and_(
|
|
594
|
+
RolePermission.permission_id == self.id,
|
|
595
|
+
RolePermission.role_id == Role.id,
|
|
596
|
+
),
|
|
597
|
+
)
|
|
598
|
+
)
|
|
599
|
+
|
|
600
|
+
query = query.add_column(row_number_column)
|
|
601
|
+
query = query.from_self().filter(row_number_column == 1)
|
|
602
|
+
rows = query.all()
|
|
603
|
+
|
|
604
|
+
arr = []
|
|
605
|
+
|
|
606
|
+
for row in rows:
|
|
607
|
+
user = User()
|
|
608
|
+
user.avatar = row.avatar
|
|
609
|
+
user.created_at = row.created_at
|
|
610
|
+
user.first_name = row.first_name
|
|
611
|
+
user.id = row.id
|
|
612
|
+
user.last_name = row.last_name
|
|
613
|
+
user.preferences = row.preferences
|
|
614
|
+
user.roles = row.roles
|
|
615
|
+
user.updated_at = row.updated_at
|
|
616
|
+
user.username = row.username
|
|
617
|
+
arr.append(user)
|
|
618
|
+
|
|
619
|
+
return arr
|
|
620
|
+
|
|
495
621
|
def __get_access_attributes(self, access_name: str) -> List[str]:
|
|
496
622
|
return (self.options or {}).get(access_name)
|
|
497
623
|
|
mage_ai/server/constants.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=0" name="viewport"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link href="/favicon.ico" rel="icon"/><link rel="preload" href="/_next/static/css/d1e8e64d0b07af2f.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d1e8e64d0b07af2f.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-69c488534b494a9b.js" defer=""></script><script src="/_next/static/chunks/framework-7c365855dab1bf41.js" defer=""></script><script src="/_next/static/chunks/main-77fe248a6fbd12d8.js" defer=""></script><script src="/_next/static/chunks/pages/_app-752d991f239a128f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-e989623bffcbf724.js" defer=""></script><script src="/_next/static/
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=0" name="viewport"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><link href="/favicon.ico" rel="icon"/><link rel="preload" href="/_next/static/css/d1e8e64d0b07af2f.css" as="style"/><link rel="stylesheet" href="/_next/static/css/d1e8e64d0b07af2f.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script><script src="/_next/static/chunks/webpack-69c488534b494a9b.js" defer=""></script><script src="/_next/static/chunks/framework-7c365855dab1bf41.js" defer=""></script><script src="/_next/static/chunks/main-77fe248a6fbd12d8.js" defer=""></script><script src="/_next/static/chunks/pages/_app-752d991f239a128f.js" defer=""></script><script src="/_next/static/chunks/pages/_error-e989623bffcbf724.js" defer=""></script><script src="/_next/static/PBVuphyo_muEAj347ZP_b/_buildManifest.js" defer=""></script><script src="/_next/static/PBVuphyo_muEAj347ZP_b/_ssgManifest.js" defer=""></script><style data-styled="" data-styled-version="5.3.6">html{-webkit-box-sizing:border-box;box-sizing:border-box;-ms-overflow-style:scrollbar;}/*!sc*/
|
|
2
2
|
*,*::before,*::after{-webkit-box-sizing:inherit;box-sizing:inherit;}/*!sc*/
|
|
3
3
|
data-styled.g4[id="sc-global-czSCUT1"]{content:"sc-global-czSCUT1,"}/*!sc*/
|
|
4
4
|
.kOVcuR .Toastify__toast-container{margin-top:24px;padding:0 !important;width:500px !important;}/*!sc*/
|
|
@@ -20,4 +20,4 @@ data-styled.g5[id="ToastWrapper-sc-1a33ph1-0"]{content:"kOVcuR,"}/*!sc*/
|
|
|
20
20
|
.next-error-h1 {
|
|
21
21
|
border-right: 1px solid rgba(255, 255, 255, .3);
|
|
22
22
|
}
|
|
23
|
-
}</style><h1 class="next-error-h1" style="display:inline-block;margin:0;margin-right:20px;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404<!-- --></h1><div style="display:inline-block;text-align:left;line-height:49px;height:49px;vertical-align:middle"><h2 style="font-size:14px;font-weight:normal;line-height:49px;margin:0;padding:0">This page could not be found<!-- -->.<!-- --></h2></div></div></div><div></div><div></div><div></div><div class="ToastWrapper-sc-1a33ph1-0 kOVcuR"><div class="Toastify"></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404},"currentTheme":{"accent":{"alert":"#F6540B","blue":"#4877FF","blueLight":"rgba(72, 119, 255, 0.5)","contentDefaultTransparent":"rgba(174, 174, 174, 0.5)","cyan":"#65E3FF","cyanLight":"rgba(101, 227, 255, 0.3)","cyanTransparent":"rgba(101, 227, 255, 0.12)","dbt":"#fc6949","dbtLight":"rgba(252, 105, 73, 0.5)","info":"#00ABFF","infoTransparent":"rgba(0, 171, 255, 0.5)","negative":"#FF1E59","negativeTransparent":"rgba(255, 30, 89, 0.3)","pink":"#FF4FF8","pinkLight":"rgb(255, 79, 248, 0.5)","positive":"#00A81A","primaryTransparent":"rgba(155, 108, 167, 0.5)","purple":"#7D55EC","purpleLight":"rgba(125, 85, 236, 0.5)","rose":"#D1A2AB","roseLight":"rgba(209, 162, 171, 0.5)","sky":"#6AA1E0","skyLight":"rgba(106, 161, 224, 0.05)","teal":"#00B4CC","tealLight":"rgba(0, 180, 204, 0.5)","warning":"#DD9900","warningTransparent":"rgba(221, 153, 0, 0.5)","yellow":"#FFCC19","yellowLight":"rgba(255, 204, 25, 0.5)"},"background":{"chartBlock":"#2E3036","codeArea":"#1E1F24","codeTextarea":"#000000","content":"#1B1C20","danger":"#FFD0DB","dark":"#B1B8C3","dashboard":"#18181C","header":"#1B1B1B","menu":"#0F4CFF","muted":"#F9FAFC","navigation":"#EDEDED","output":"#2E3036","page":"#1E1F24","panel":"#232429","popup":"#27292E","row":"#2C2C2C","row2":"#51535C","scrollbarThumb":"rgba(100, 100, 100, 0.5)","scrollbarThumbHover":"rgba(255, 255, 255, 0.3)","scrollbarTrack":"#2E3036","success":"#8ADE00","successLight":"rgb(138, 222, 0, 0.3)","table":"#292A2F","tag":"#3A4550"},"borders":{"button":"#454850","contrast":"#FFFFFF","danger":"#FF144D","dark":"#000000","darkLight":"#2E3036","info":"#FFCC19","light":"#2F3034","medium":"#1C1C1C","medium2":"#141414","success":"#2FCB52"},"brand":{"earth100":"#C6EEDB","earth200":"#9DDFBF","earth300":"#6BBF96","earth400":"#37A46F","earth400Transparent":"rgba(55, 164, 111, 0.4)","earth500":"#00954C","energy100":"#FFF4BA","energy200":"#FFED92","energy300":"#FFE662","energy400":"#FFDA19","energy400Transparent":"rgba(255, 218, 25, 0.04)","energy500":"#F6C000","fire100":"#FFD7E0","fire200":"#FFA3B9","fire300":"#FF547D","fire400":"#FF144D","fire400Transparent":"rgba(255, 20, 77, 0.4)","fire500":"#EB0032","stone100":"#F3E6D7","stone200":"#E3D4C2","stone400":"#BFA78B","stone500":"#AF8859","water100":"#BDCEFF","water200":"#81A1FF","water300":"#517DFF","water400":"#2A60FE","water400Transparent":"rgba(42, 96, 254, 0.4)","water500":"#0F4CFF","wind100":"#EEEAFF","wind200":"#CCC1F4","wind300":"#A698DD","wind400":"#6B50D7","wind400SuperTransparent":"rgba(107, 80, 215, 0.12)","wind400Transparent":"rgba(107, 80, 215, 0.4)","wind500":"#4E32BC"},"chart":{"backgroundPrimary":"#7D55EC","backgroundSecondary":"#FF144D","backgroundTertiary":"#86E2FF","button1":"#4877FF","button2":"#FFCC19","button3":"#8ADE00","button4":"#FF4FF8","button5":"#B98D95","lines":"#9B6CA7","primary":"#6B50D7","secondary":"#FF144D","tertiary":"#2A60FE"},"content":{"active":"#FFFFFF","default":"#AEAEAE","disabled":"rgba(255, 255, 255, 0.3)","inverted":"#2C2C2C","muted":"#787A85"},"elevation":{"visualizationAccent":"#996CFF","visualizationAccentAlt":"#C1ACF7"},"feature":{"active":"rgba(250, 248, 254, 0.14)","disabled":"rgba(201, 206, 218, 0.12)"},"icons":{"neutral":"#787878"},"interactive":{"activeBorder":"#060606","checked":"#060606","dangerBorder":"#FF144D","defaultBackground":"#36383F","defaultBorder":"#ffffff1a","disabledBorder":"#B1B8C3","focusBackground":"#B1B8C3","focusBorder":"#86E2FF","hoverBackground":"#4E4E4E","hoverBorder":"#B9BFCA","hoverOverlay":"rgba(255, 255, 255, 0.1)","linkPrimary":"#1752FF","linkPrimaryHover":"#4877FF","linkPrimaryLight":"#5982ff","linkSecondary":"#6B50D7","linkSecondaryDisabled":"#C4B9EF","linkText":"#6AA1E0","linkTextLight":"#9ECBFF","purple":"#885EFF","rowHoverBackground":"rgba(0, 0, 0, 0.1)","transparent":"rgba(255, 255, 255, 0)"},"loader":{"color":"#EB0032","colorInverted":"#8ADE00"},"logo":{"color":"#FFFFFF"},"monotone":{"black":"#060606","blackTransparent":"rgba(0, 0, 0, 0.6)","gray":"#B1B8C3","grey100":"#F2F2F2","grey200":"#D5D7DC","grey300":"#B4B8C0","grey400":"#70747C","grey500":"#51535C","purple":"#6B50D7","white":"#FFFFFF","whiteTransparent":"rgba(255, 255, 255, 0.6)"},"neutral":{"n100":"#E7E8EA","n200":"#D8DADE","n300":"#CBCCD0","n400":"#BCBEC4","n500":"#AEB0B6"},"progress":{"negative":"#FF144D","positive":"#6B50D7"},"shadow":{"base":"12px 40px 120px rgba(106, 117, 139, 0.4)","frame":"0px 10px 40px rgba(0, 0, 0, 0.26)","menu":"4px 10px 20px rgba(6, 6, 6, 0.12)","popup":"10px 20px 40px rgba(0, 0, 0, 0.2)","small":"0px, 4px, rgba(0, 0, 0, 0.25)","window":"0px 10px 60px rgba(0, 0, 0, 0.7)"},"status":{"negative":"#FF144D","positive":"#24B400"},"text":{"fileBrowser":"#787A85"}}},"page":"/_error","query":{},"buildId":"
|
|
23
|
+
}</style><h1 class="next-error-h1" style="display:inline-block;margin:0;margin-right:20px;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404<!-- --></h1><div style="display:inline-block;text-align:left;line-height:49px;height:49px;vertical-align:middle"><h2 style="font-size:14px;font-weight:normal;line-height:49px;margin:0;padding:0">This page could not be found<!-- -->.<!-- --></h2></div></div></div><div></div><div></div><div></div><div class="ToastWrapper-sc-1a33ph1-0 kOVcuR"><div class="Toastify"></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404},"currentTheme":{"accent":{"alert":"#F6540B","blue":"#4877FF","blueLight":"rgba(72, 119, 255, 0.5)","contentDefaultTransparent":"rgba(174, 174, 174, 0.5)","cyan":"#65E3FF","cyanLight":"rgba(101, 227, 255, 0.3)","cyanTransparent":"rgba(101, 227, 255, 0.12)","dbt":"#fc6949","dbtLight":"rgba(252, 105, 73, 0.5)","info":"#00ABFF","infoTransparent":"rgba(0, 171, 255, 0.5)","negative":"#FF1E59","negativeTransparent":"rgba(255, 30, 89, 0.3)","pink":"#FF4FF8","pinkLight":"rgb(255, 79, 248, 0.5)","positive":"#00A81A","primaryTransparent":"rgba(155, 108, 167, 0.5)","purple":"#7D55EC","purpleLight":"rgba(125, 85, 236, 0.5)","rose":"#D1A2AB","roseLight":"rgba(209, 162, 171, 0.5)","sky":"#6AA1E0","skyLight":"rgba(106, 161, 224, 0.05)","teal":"#00B4CC","tealLight":"rgba(0, 180, 204, 0.5)","warning":"#DD9900","warningTransparent":"rgba(221, 153, 0, 0.5)","yellow":"#FFCC19","yellowLight":"rgba(255, 204, 25, 0.5)"},"background":{"chartBlock":"#2E3036","codeArea":"#1E1F24","codeTextarea":"#000000","content":"#1B1C20","danger":"#FFD0DB","dark":"#B1B8C3","dashboard":"#18181C","header":"#1B1B1B","menu":"#0F4CFF","muted":"#F9FAFC","navigation":"#EDEDED","output":"#2E3036","page":"#1E1F24","panel":"#232429","popup":"#27292E","row":"#2C2C2C","row2":"#51535C","scrollbarThumb":"rgba(100, 100, 100, 0.5)","scrollbarThumbHover":"rgba(255, 255, 255, 0.3)","scrollbarTrack":"#2E3036","success":"#8ADE00","successLight":"rgb(138, 222, 0, 0.3)","table":"#292A2F","tag":"#3A4550"},"borders":{"button":"#454850","contrast":"#FFFFFF","danger":"#FF144D","dark":"#000000","darkLight":"#2E3036","info":"#FFCC19","light":"#2F3034","medium":"#1C1C1C","medium2":"#141414","success":"#2FCB52"},"brand":{"earth100":"#C6EEDB","earth200":"#9DDFBF","earth300":"#6BBF96","earth400":"#37A46F","earth400Transparent":"rgba(55, 164, 111, 0.4)","earth500":"#00954C","energy100":"#FFF4BA","energy200":"#FFED92","energy300":"#FFE662","energy400":"#FFDA19","energy400Transparent":"rgba(255, 218, 25, 0.04)","energy500":"#F6C000","fire100":"#FFD7E0","fire200":"#FFA3B9","fire300":"#FF547D","fire400":"#FF144D","fire400Transparent":"rgba(255, 20, 77, 0.4)","fire500":"#EB0032","stone100":"#F3E6D7","stone200":"#E3D4C2","stone400":"#BFA78B","stone500":"#AF8859","water100":"#BDCEFF","water200":"#81A1FF","water300":"#517DFF","water400":"#2A60FE","water400Transparent":"rgba(42, 96, 254, 0.4)","water500":"#0F4CFF","wind100":"#EEEAFF","wind200":"#CCC1F4","wind300":"#A698DD","wind400":"#6B50D7","wind400SuperTransparent":"rgba(107, 80, 215, 0.12)","wind400Transparent":"rgba(107, 80, 215, 0.4)","wind500":"#4E32BC"},"chart":{"backgroundPrimary":"#7D55EC","backgroundSecondary":"#FF144D","backgroundTertiary":"#86E2FF","button1":"#4877FF","button2":"#FFCC19","button3":"#8ADE00","button4":"#FF4FF8","button5":"#B98D95","lines":"#9B6CA7","primary":"#6B50D7","secondary":"#FF144D","tertiary":"#2A60FE"},"content":{"active":"#FFFFFF","default":"#AEAEAE","disabled":"rgba(255, 255, 255, 0.3)","inverted":"#2C2C2C","muted":"#787A85"},"elevation":{"visualizationAccent":"#996CFF","visualizationAccentAlt":"#C1ACF7"},"feature":{"active":"rgba(250, 248, 254, 0.14)","disabled":"rgba(201, 206, 218, 0.12)"},"icons":{"neutral":"#787878"},"interactive":{"activeBorder":"#060606","checked":"#060606","dangerBorder":"#FF144D","defaultBackground":"#36383F","defaultBorder":"#ffffff1a","disabledBorder":"#B1B8C3","focusBackground":"#B1B8C3","focusBorder":"#86E2FF","hoverBackground":"#4E4E4E","hoverBorder":"#B9BFCA","hoverOverlay":"rgba(255, 255, 255, 0.1)","linkPrimary":"#1752FF","linkPrimaryHover":"#4877FF","linkPrimaryLight":"#5982ff","linkSecondary":"#6B50D7","linkSecondaryDisabled":"#C4B9EF","linkText":"#6AA1E0","linkTextLight":"#9ECBFF","purple":"#885EFF","rowHoverBackground":"rgba(0, 0, 0, 0.1)","transparent":"rgba(255, 255, 255, 0)"},"loader":{"color":"#EB0032","colorInverted":"#8ADE00"},"logo":{"color":"#FFFFFF"},"monotone":{"black":"#060606","blackTransparent":"rgba(0, 0, 0, 0.6)","gray":"#B1B8C3","grey100":"#F2F2F2","grey200":"#D5D7DC","grey300":"#B4B8C0","grey400":"#70747C","grey500":"#51535C","purple":"#6B50D7","white":"#FFFFFF","whiteTransparent":"rgba(255, 255, 255, 0.6)"},"neutral":{"n100":"#E7E8EA","n200":"#D8DADE","n300":"#CBCCD0","n400":"#BCBEC4","n500":"#AEB0B6"},"progress":{"negative":"#FF144D","positive":"#6B50D7"},"shadow":{"base":"12px 40px 120px rgba(106, 117, 139, 0.4)","frame":"0px 10px 40px rgba(0, 0, 0, 0.26)","menu":"4px 10px 20px rgba(6, 6, 6, 0.12)","popup":"10px 20px 40px rgba(0, 0, 0, 0.2)","small":"0px, 4px, rgba(0, 0, 0, 0.25)","window":"0px 10px 60px rgba(0, 0, 0, 0.7)"},"status":{"negative":"#FF144D","positive":"#24B400"},"text":{"fileBrowser":"#787A85"}}},"page":"/_error","query":{},"buildId":"PBVuphyo_muEAj347ZP_b","nextExport":true,"isFallback":false,"gip":true,"appGip":true,"scriptLoader":[]}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,e,i,a,c,t,n,p,l,u,g,r,k,b,d,f,o,h,j,m,w,_,v,y,I,B,F,A,D,E,L,M,N,S,T,U,C,x,P,q,z,G,H,J,K,O,Q){return{__rewrites:{beforeFiles:[],afterFiles:[],fallback:[]},"/":["static/chunks/pages/index-a22f976b85beef2d.js"],"/_error":["static/chunks/pages/_error-e989623bffcbf724.js"],"/block-layout":[I,t,r,k,f,j,_,B,D,s,e,i,o,m,E,N,"static/chunks/pages/block-layout-a27a28d2a615e364.js"],"/files":[a,t,k,S,"static/chunks/6750-3c4c9e36f3a27999.js",s,e,c,i,n,p,l,o,T,"static/chunks/pages/files-98e27a4d7bd0da47.js"],"/global-data-products":[a,t,s,e,c,i,n,p,v,L,x,"static/chunks/pages/global-data-products-26909dec66f00231.js"],"/global-data-products/[...slug]":[a,t,s,e,c,i,n,p,v,L,x,"static/chunks/pages/global-data-products/[...slug]-9eb5dad57da13efd.js"],"/manage":[a,t,k,s,e,c,i,n,p,o,"static/chunks/pages/manage-476c921d62f565fc.js"],"/manage/settings":[a,t,k,"static/chunks/2261-27a93815f4d82dfc.js",s,e,c,i,o,"static/chunks/pages/manage/settings-b9eea6abc676ca81.js"],"/manage/users":[a,t,s,e,c,i,n,p,"static/chunks/pages/manage/users-bfce0ee677d57206.js"],"/manage/users/new":[a,s,e,c,i,U,"static/chunks/pages/manage/users/new-ae6083077c9c1c41.js"],"/manage/users/[user]":[a,t,s,e,c,i,n,p,U,"static/chunks/pages/manage/users/[user]-11c601c6ef07fe86.js"],"/overview":[I,a,t,g,b,r,k,f,j,_,F,B,D,s,e,c,i,n,p,l,d,o,w,m,A,E,N,P,"static/chunks/pages/overview-2ec6b17e45a52be8.js"],"/pipeline-runs":[a,t,s,e,c,i,n,p,v,"static/chunks/pages/pipeline-runs-605918f3a5c1aac4.js"],"/pipelines":[a,t,g,b,r,k,f,F,s,e,c,i,n,p,l,d,o,w,m,A,P,q,"static/chunks/pages/pipelines-270b912e1ac189b5.js"],"/pipelines/[pipeline]":["static/chunks/pages/pipelines/[pipeline]-35fe7762cb83a733.js"],"/pipelines/[pipeline]/backfills":[a,t,s,e,c,i,n,p,u,"static/chunks/pages/pipelines/[pipeline]/backfills-2402004a19a6ad53.js"],"/pipelines/[pipeline]/backfills/[...slug]":[a,t,g,b,y,M,s,e,c,i,n,p,l,u,d,v,"static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ee65a62ed166bd85.js"],"/pipelines/[pipeline]/dashboard":[I,a,t,r,k,f,j,_,B,D,s,e,c,i,u,o,m,E,N,"static/chunks/pages/pipelines/[pipeline]/dashboard-8781db69f19759a1.js"],"/pipelines/[pipeline]/edit":[I,a,t,g,b,r,k,f,j,_,y,F,B,D,S,"static/chunks/6563-5b3b97c9088baf69.js",s,e,c,i,n,p,l,d,w,A,E,T,z,"static/chunks/pages/pipelines/[pipeline]/edit-d7fd4857579e2b00.js"],"/pipelines/[pipeline]/logs":[a,t,g,f,M,s,e,c,i,n,p,l,u,m,"static/chunks/pages/pipelines/[pipeline]/logs-234007c99efdccf6.js"],"/pipelines/[pipeline]/monitors":[a,t,j,_,"static/chunks/9737-1456491f9fdb09d3.js",s,e,c,i,u,C,"static/chunks/pages/pipelines/[pipeline]/monitors-a057b17847b82468.js"],"/pipelines/[pipeline]/monitors/block-runs":[a,t,j,_,"static/chunks/9210-b26999bcfb636602.js",s,e,c,i,l,u,C,"static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-da7510d4b277e47b.js"],"/pipelines/[pipeline]/monitors/block-runtime":[I,a,t,j,_,"static/chunks/6485-dbc1ca8f24401caf.js",s,e,c,i,l,u,C,"static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-eae853ff34b09481.js"],"/pipelines/[pipeline]/runs":[a,t,g,b,y,s,e,c,i,n,p,l,u,d,v,G,"static/chunks/pages/pipelines/[pipeline]/runs-3f0980d8810a540b.js"],"/pipelines/[pipeline]/runs/[run]":[a,t,g,b,f,j,y,B,s,e,c,i,n,p,l,u,d,m,G,"static/chunks/pages/pipelines/[pipeline]/runs/[run]-99d11c86f8b15369.js"],"/pipelines/[pipeline]/settings":[a,t,s,e,c,i,u,"static/chunks/pages/pipelines/[pipeline]/settings-9edf75d03460aaeb.js"],"/pipelines/[pipeline]/syncs":[a,t,s,e,c,i,n,p,u,"static/chunks/pages/pipelines/[pipeline]/syncs-e7692e54979f037d.js"],"/pipelines/[pipeline]/triggers":[a,t,g,b,r,y,M,H,s,e,c,i,n,p,l,u,d,w,L,J,q,"static/chunks/pages/pipelines/[pipeline]/triggers-5eff96c149584e87.js"],"/pipelines/[pipeline]/triggers/[...slug]":[a,t,g,b,r,y,M,H,s,e,c,i,n,p,l,u,d,w,v,J,"static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-cb6a3bcaf4fa1a81.js"],"/settings":["static/chunks/pages/settings-56f83205752b1323.js"],"/settings/account/profile":[a,s,e,c,i,h,U,"static/chunks/pages/settings/account/profile-2058d022972cdea4.js"],"/settings/workspace/permissions":[a,t,s,e,c,i,n,p,h,K,"static/chunks/pages/settings/workspace/permissions-cb1cdf5f8e5bf9c5.js"],"/settings/workspace/permissions/[...slug]":[a,t,s,e,c,i,n,p,h,K,"static/chunks/pages/settings/workspace/permissions/[...slug]-1a95628ea8d0d846.js"],"/settings/workspace/preferences":[a,s,e,c,i,h,"static/chunks/pages/settings/workspace/preferences-58978256db4efbda.js"],"/settings/workspace/roles":[a,t,s,e,c,i,n,p,h,O,"static/chunks/pages/settings/workspace/roles-1694c5eb1acbcf30.js"],"/settings/workspace/roles/[...slug]":[a,t,s,e,c,i,n,p,h,O,"static/chunks/pages/settings/workspace/roles/[...slug]-9ddd7eb842d5a911.js"],"/settings/workspace/sync-data":[a,s,e,c,i,h,"static/chunks/pages/settings/workspace/sync-data-6850e854fbedbb61.js"],"/settings/workspace/users":[a,t,s,e,c,i,n,p,h,Q,"static/chunks/pages/settings/workspace/users-f551c5665bfd3494.js"],"/settings/workspace/users/[...slug]":[a,t,s,e,c,i,n,p,h,Q,"static/chunks/pages/settings/workspace/users/[...slug]-5061c073e1c0de07.js"],"/sign-in":[a,s,e,c,"static/chunks/pages/sign-in-e779dbab123e626e.js"],"/templates":[a,t,g,b,r,k,f,F,s,e,c,i,n,p,l,d,o,w,m,A,"static/chunks/pages/templates-7079d637e396f2a8.js"],"/templates/[...slug]":[a,t,g,b,r,k,f,F,s,e,c,i,n,p,l,d,o,w,m,A,"static/chunks/pages/templates/[...slug]-935113d252ada806.js"],"/terminal":[a,s,e,c,i,"static/chunks/pages/terminal-67fdb4a3be93aa14.js"],"/test":[t,r,s,n,l,w,z,"static/chunks/pages/test-4a5ae8f9da088932.js"],"/triggers":[a,t,s,e,c,i,n,p,L,"static/chunks/pages/triggers-9c0374c7c783b34a.js"],"/version-control":[a,t,S,"static/chunks/8478-3f642f8420d9ef66.js",s,e,c,i,n,p,l,T,"static/chunks/pages/version-control-ea3a0d48e5822b42.js"],sortedPages:["/","/_app","/_error","/block-layout","/files","/global-data-products","/global-data-products/[...slug]","/manage","/manage/settings","/manage/users","/manage/users/new","/manage/users/[user]","/overview","/pipeline-runs","/pipelines","/pipelines/[pipeline]","/pipelines/[pipeline]/backfills","/pipelines/[pipeline]/backfills/[...slug]","/pipelines/[pipeline]/dashboard","/pipelines/[pipeline]/edit","/pipelines/[pipeline]/logs","/pipelines/[pipeline]/monitors","/pipelines/[pipeline]/monitors/block-runs","/pipelines/[pipeline]/monitors/block-runtime","/pipelines/[pipeline]/runs","/pipelines/[pipeline]/runs/[run]","/pipelines/[pipeline]/settings","/pipelines/[pipeline]/syncs","/pipelines/[pipeline]/triggers","/pipelines/[pipeline]/triggers/[...slug]","/settings","/settings/account/profile","/settings/workspace/permissions","/settings/workspace/permissions/[...slug]","/settings/workspace/preferences","/settings/workspace/roles","/settings/workspace/roles/[...slug]","/settings/workspace/sync-data","/settings/workspace/users","/settings/workspace/users/[...slug]","/sign-in","/templates","/templates/[...slug]","/terminal","/test","/triggers","/version-control"]}}("static/chunks/8013-e67c71ddea072a20.js","static/chunks/600-2b6bafe425cfd52c.js","static/chunks/8264-2743af6deab87497.js","static/chunks/844-1e171f361e63b36d.js","static/chunks/4636-84f545d1d238df13.js","static/chunks/2083-78a438dbdc57d1e4.js","static/chunks/4666-d8994abbc40b52ee.js","static/chunks/5499-b74459f6be5f9229.js","static/chunks/4839-e5fe343a369734bc.js","static/chunks/5457-97433bc45b42a88a.js","static/chunks/2851-dc553b2d9ee109c2.js","static/chunks/341-ef0f7b98b7f69802.js","static/chunks/8789-4f858e520d46973b.js","static/chunks/1124-d8fc76201b83b376.js","static/chunks/7055-17504ff848d2ce56.js","static/chunks/4913-24ccab3739f1c678.js","static/chunks/5810-7f576f7267788fe0.js","static/chunks/3684-e1a713b7c16f0151.js","static/chunks/5896-14e5a23b1c6a0769.js","static/chunks/3859-ba594d21a1260cd2.js","static/chunks/1769-613e23e361eb5bce.js","static/chunks/2714-1e79e9f2e998b544.js","static/chunks/3943-35659e0a3fc6bda5.js","static/chunks/9161-837b653aa849a76f.js","static/chunks/29107295-989a0767a635d9d5.js","static/chunks/2631-b9f9bea3f1cf906d.js","static/chunks/1821-953efd0da290d25f.js","static/chunks/9264-5730e4e059db40a8.js","static/chunks/4783-1a21d9be47574bba.js","static/chunks/976-9a0469f807d8a343.js","static/chunks/1743-fe9deb3242e0e587.js","static/chunks/4495-4f0340aa82e0c623.js","static/chunks/9440-0267f0e8690ea3c4.js","static/chunks/7011-81dd8269c4806d26.js","static/chunks/553-9a94dd8b33e381f8.js","static/chunks/6043-6ea109833b88eb1d.js","static/chunks/9242-4c61fd2e1018e626.js","static/chunks/2327-1a797c758f8b064a.js","static/chunks/2677-a85c5a72bb695304.js","static/chunks/3951-22dc3b7d6ec6f5d5.js","static/chunks/1749-a6bdce4ee8a09bce.js","static/chunks/3419-0df6c5ef72f2e672.js","static/chunks/9302-913007e2f801ad65.js","static/chunks/6333-ca4cd6a73a597a40.js","static/chunks/8146-941c5155c3bfcc35.js","static/chunks/7022-80d082a1d7fd1234.js","static/chunks/7361-25f211ef377e5958.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3859],{93859:function(e,n,t){t.d(n,{r:function(){return B},Z:function(){return P}});var r=t(82394),o=t(21831),i=t(82684),a=t(48670),c=t(12691),l=t.n(c),u=t(38626),d=t(78141),s=t(44628),h=t(6508),m=t(55485),f=t(30160),p=t(44897),g=t(70987),v=function(){var e=document.createElement("div");e.setAttribute("style","width: 100px; height: 100px; overflow: scroll; position:absolute; top:-9999px;"),document.body.appendChild(e);var n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),n},b=t(95363),y=t(61896),x=t(47041),w=t(48888),H=t(70515),S=t(40489),j=t(86735),O=t(28598);function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Z=2*H.iI+y.dN,A=20*H.iI,B=8.7,C=u.default.div.withConfig({displayName:"DataTable__Styles",componentId:"sc-1arr863-0"})([""," "," "," .body > div{","}.table{border-spacing:0;display:inline-block;"," "," "," "," .tr{.td.td-index-column{","}}.th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;","}.th,.td{"," font-family:",";margin:0;","}.td{padding:","px;}&.sticky{overflow:auto;}.header{overflow:hidden;}}"],(function(e){return e.disableScrolling&&"\n overflow: hidden;\n "}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),x.w5,(function(e){return!e.noBorderBottom&&"\n border-bottom: 1px solid ".concat((e.theme.borders||g.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderLeft&&"\n border-left: 1px solid ".concat((e.theme.borders||g.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||g.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderTop&&"\n border-top: 1px solid ".concat((e.theme.borders||g.Z.borders).medium,";\n ")}),(function(e){return"\n color: ".concat((e.theme.content||g.Z.content).default,";\n ")}),(function(e){return"\n height: ".concat(e.columnHeaderHeight||Z,"px;\n ")}),y.iD,b.ry,(function(e){return"\n background-color: ".concat((e.theme.background||g.Z.background).table,";\n border-bottom: 1px solid ").concat((e.theme.borders||g.Z.borders).medium,";\n border-right: 1px solid ").concat((e.theme.borders||g.Z.borders).medium,";\n ")}),1*H.iI);function M(e){var n=e.original,t=8.5*Math.max.apply(Math,(0,o.Z)(n.map((function(e){return(null===e||void 0===e?void 0:e.length)||0})))),r=Math.ceil(t/(A-2*H.iI));return Math.max(r,1)*y.dN+2*H.iI}function I(e){var n=e.columnHeaderHeight,t=e.columns,r=e.data,c=e.disableScrolling,x=e.height,k=e.index,C=e.invalidValues,I=e.maxHeight,P=e.numberOfIndexes,T=e.previewIndexes,N=e.renderColumnHeader,_=e.width,R=(0,i.useContext)(u.ThemeContext),D=(0,i.useRef)(null),L=(0,i.useRef)(null);(0,i.useEffect)((function(){var e=function(e){var n;null===D||void 0===D||null===(n=D.current)||void 0===n||n.scroll(e.target.scrollLeft,0)};return L&&L.current.addEventListener("scroll",e),function(){var n;null===L||void 0===L||null===(n=L.current)||void 0===n||n.removeEventListener("scroll",e)}}),[D,L]);var V=(0,i.useMemo)((function(){return k&&r&&k.length===r.length}),[r,k]),W=(0,i.useMemo)((function(){var e=[];return(0,j.w6)(P).forEach((function(n,t){var i=String(null===r||void 0===r?void 0:r.length).length*B;if(V){var a=k.map((function(e){return P>=2?String(e[t]).length:String(e).length}));i=Math.max.apply(Math,(0,o.Z)(a))*B}e.push(i+2*H.iI)})),e}),[r,k,P,V]),z=t.map((function(e){return null===e||void 0===e?void 0:e.Header})).slice(1),F=(0,i.useMemo)((function(){return v()}),[]),G=(0,i.useMemo)((function(){var e=_-(Math.max.apply(Math,(0,o.Z)(W))+1.5*H.iI+F),n=t.length-1,r=A;return r*n<e&&(r=e/n),{width:r}}),[t,W,F,_]),U=(0,s.useTable)({columns:t,data:r,defaultColumn:G},s.useBlockLayout,h.useSticky),q=U.getTableBodyProps,J=U.getTableProps,X=U.headerGroups,K=U.prepareRow,Q=U.rows,Y=(0,i.useCallback)((function(e){var n=e.index,t=e.style,r=new Set((null===T||void 0===T?void 0:T.removedRows)||[]),o=Q[n];K(o);var c=o.original,u=r.has(n);return(0,O.jsx)("div",E(E({},o.getRowProps({style:E(E({},t),{},{width:"auto"})})),{},{className:"tr",children:o.cells.map((function(e,t){var r,o=t<=P-1,d=e.getCellProps(),s=e.column.id,h=null===C||void 0===C||null===(r=C[s])||void 0===r?void 0:r.includes(n),p=E({},d.style);o&&(p.fontFamily=b.Vp,p.left=0,p.position="sticky",p.textAlign=k?"right":"center",p.width=W[t]);var v,y=c[t-P],x=z.indexOf(s);if(h&&(p.color=g.Z.interactive.dangerBorder),u&&(p.backgroundColor=g.Z.background.danger),Array.isArray(y)||"object"===typeof y)try{y=JSON.stringify(y)}catch(H){y="Error: cannot display value"}return o&&(V?(v=k[n],Array.isArray(v)&&(v=v[t])):v=e.render("Cell")),(0,i.createElement)("div",E(E({},d),{},{className:"td ".concat(o?"td-index-column":""),key:"".concat(t,"-").concat(y),style:p}),v,!o&&(0,O.jsxs)(m.ZP,{justifyContent:"space-between",children:[(0,O.jsxs)(f.ZP,{danger:h,default:!0,wordBreak:!0,children:[!0===y&&"true",!1===y&&"false",(null===y||"null"===y)&&"null",!0!==y&&!1!==y&&null!==y&&"null"!==y&&y]}),h&&(0,O.jsx)(l(),{as:(0,S.o_)(w.mW,x),href:"/datasets/[...slug]",passHref:!0,children:(0,O.jsx)(a.Z,{danger:!0,children:"View all"})})]}))}))}))}),[z,k,C,W,P,K,Q,V,T]),$=(0,i.useMemo)((function(){var e;return I?(e=(0,j.Sm)(Q.map(M)),e+=n||Z-y.dN):(e=x,e-=n||Z),e}),[n,x,I,Q]),ee=(0,i.useMemo)((function(){return(0,O.jsx)(d.S_,{estimatedItemSize:Z,height:$,itemCount:null===Q||void 0===Q?void 0:Q.length,itemSize:function(e){return M(Q[e])},outerRef:L,style:{maxHeight:I,pointerEvents:c?"none":null},children:Y})}),[c,$,I,Y,Q]);return(0,O.jsx)("div",E(E({},J()),{},{className:"table sticky",style:{width:_},children:(0,O.jsxs)("div",E(E({},q()),{},{className:"body",children:[(0,O.jsx)("div",{className:"header",ref:D,children:X.map((function(e,n){return(0,i.createElement)("div",E(E({},e.getHeaderGroupProps()),{},{className:"tr",key:"".concat(e.id,"_").concat(n)}),e.headers.map((function(e,n){var t,r=n<=P-1,o=e.getHeaderProps(),a=E({},o.style);return r?(a.fontFamily=b.Vp,a.left=0,a.position="sticky",a.textAlign="center",a.width=W[n],a.minWidth=W[n]):N?t=N(e,n-P,{width:G.width}):(t=e.render("Header"),a.color=(R||p.Z).content.default,a.padding=1*H.iI,a.minWidth=G.width),(0,i.createElement)("div",E(E({},o),{},{className:"th",key:e.id,style:a,title:r?"Row number":void 0}),t)})))}))}),ee]}))}))}var P=function(e){var n=e.columnHeaderHeight,t=e.columns,r=e.disableScrolling,o=e.height,a=e.index,c=e.invalidValues,l=e.maxHeight,u=e.noBorderBottom,d=e.noBorderLeft,s=e.noBorderRight,h=e.noBorderTop,m=e.previewIndexes,f=e.renderColumnHeader,p=e.rows,g=e.width
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3859],{93859:function(e,n,t){t.d(n,{r:function(){return B},Z:function(){return P}});var r=t(82394),o=t(21831),i=t(82684),a=t(48670),c=t(12691),l=t.n(c),u=t(38626),d=t(78141),s=t(44628),h=t(6508),m=t(55485),f=t(30160),p=t(44897),g=t(70987),v=function(){var e=document.createElement("div");e.setAttribute("style","width: 100px; height: 100px; overflow: scroll; position:absolute; top:-9999px;"),document.body.appendChild(e);var n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),n},b=t(95363),y=t(61896),x=t(47041),w=t(48888),H=t(70515),S=t(40489),j=t(86735),O=t(28598);function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Z=2*H.iI+y.dN,A=20*H.iI,B=8.7,C=u.default.div.withConfig({displayName:"DataTable__Styles",componentId:"sc-1arr863-0"})([""," "," "," .body > div{","}.table{border-spacing:0;display:inline-block;"," "," "," "," .tr{.td.td-index-column{","}}.th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;","}.th,.td{"," font-family:",";margin:0;","}.td{padding:","px;}&.sticky{overflow:auto;}.header{overflow:hidden;}}"],(function(e){return e.disableScrolling&&"\n overflow: hidden;\n "}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),x.w5,(function(e){return!e.noBorderBottom&&"\n border-bottom: 1px solid ".concat((e.theme.borders||g.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderLeft&&"\n border-left: 1px solid ".concat((e.theme.borders||g.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||g.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderTop&&"\n border-top: 1px solid ".concat((e.theme.borders||g.Z.borders).medium,";\n ")}),(function(e){return"\n color: ".concat((e.theme.content||g.Z.content).default,";\n ")}),(function(e){return"\n height: ".concat(e.columnHeaderHeight||Z,"px;\n ")}),y.iD,b.ry,(function(e){return"\n background-color: ".concat((e.theme.background||g.Z.background).table,";\n border-bottom: 1px solid ").concat((e.theme.borders||g.Z.borders).medium,";\n border-right: 1px solid ").concat((e.theme.borders||g.Z.borders).medium,";\n ")}),1*H.iI);function M(e){var n=e.original,t=8.5*Math.max.apply(Math,(0,o.Z)(n.map((function(e){return(null===e||void 0===e?void 0:e.length)||0})))),r=Math.ceil(t/(A-2*H.iI));return Math.max(r,1)*y.dN+2*H.iI}function I(e){var n=e.columnHeaderHeight,t=e.columns,r=e.data,c=e.disableScrolling,x=e.height,k=e.index,C=e.invalidValues,I=e.maxHeight,P=e.numberOfIndexes,T=e.previewIndexes,N=e.renderColumnHeader,_=e.width,R=(0,i.useContext)(u.ThemeContext),D=(0,i.useRef)(null),L=(0,i.useRef)(null);(0,i.useEffect)((function(){var e=function(e){var n;null===D||void 0===D||null===(n=D.current)||void 0===n||n.scroll(e.target.scrollLeft,0)};return L&&L.current.addEventListener("scroll",e),function(){var n;null===L||void 0===L||null===(n=L.current)||void 0===n||n.removeEventListener("scroll",e)}}),[D,L]);var V=(0,i.useMemo)((function(){return k&&r&&k.length===r.length}),[r,k]),W=(0,i.useMemo)((function(){var e=[];return(0,j.w6)(P).forEach((function(n,t){var i=String(null===r||void 0===r?void 0:r.length).length*B;if(V){var a=k.map((function(e){return P>=2?String(e[t]).length:String(e).length}));i=Math.max.apply(Math,(0,o.Z)(a))*B}e.push(i+2*H.iI)})),e}),[r,k,P,V]),z=t.map((function(e){return null===e||void 0===e?void 0:e.Header})).slice(1),F=(0,i.useMemo)((function(){return v()}),[]),G=(0,i.useMemo)((function(){var e=_-(Math.max.apply(Math,(0,o.Z)(W))+1.5*H.iI+F),n=t.length-1,r=A;return r*n<e&&(r=e/n),{width:r}}),[t,W,F,_]),U=(0,s.useTable)({columns:t,data:r,defaultColumn:G},s.useBlockLayout,h.useSticky),q=U.getTableBodyProps,J=U.getTableProps,X=U.headerGroups,K=U.prepareRow,Q=U.rows,Y=(0,i.useCallback)((function(e){var n=e.index,t=e.style,r=new Set((null===T||void 0===T?void 0:T.removedRows)||[]),o=Q[n];K(o);var c=o.original,u=r.has(n);return(0,O.jsx)("div",E(E({},o.getRowProps({style:E(E({},t),{},{width:"auto"})})),{},{className:"tr",children:o.cells.map((function(e,t){var r,o=t<=P-1,d=e.getCellProps(),s=e.column.id,h=null===C||void 0===C||null===(r=C[s])||void 0===r?void 0:r.includes(n),p=E({},d.style);o&&(p.fontFamily=b.Vp,p.left=0,p.position="sticky",p.textAlign=k?"right":"center",p.width=W[t]);var v,y=c[t-P],x=z.indexOf(s);if(h&&(p.color=g.Z.interactive.dangerBorder),u&&(p.backgroundColor=g.Z.background.danger),Array.isArray(y)||"object"===typeof y)try{y=JSON.stringify(y)}catch(H){y="Error: cannot display value"}return o&&(V?(v=k[n],Array.isArray(v)&&(v=v[t])):v=e.render("Cell")),(0,i.createElement)("div",E(E({},d),{},{className:"td ".concat(o?"td-index-column":""),key:"".concat(t,"-").concat(y),style:p}),v,!o&&(0,O.jsxs)(m.ZP,{justifyContent:"space-between",children:[(0,O.jsxs)(f.ZP,{danger:h,default:!0,wordBreak:!0,children:[!0===y&&"true",!1===y&&"false",(null===y||"null"===y)&&"null",!0!==y&&!1!==y&&null!==y&&"null"!==y&&y]}),h&&(0,O.jsx)(l(),{as:(0,S.o_)(w.mW,x),href:"/datasets/[...slug]",passHref:!0,children:(0,O.jsx)(a.Z,{danger:!0,children:"View all"})})]}))}))}))}),[z,k,C,W,P,K,Q,V,T]),$=(0,i.useMemo)((function(){var e;return I?(e=(0,j.Sm)(Q.map(M)),e+=n||Z-y.dN):(e=x,e-=n||Z),e}),[n,x,I,Q]),ee=(0,i.useMemo)((function(){return(0,O.jsx)(d.S_,{estimatedItemSize:Z,height:$,itemCount:null===Q||void 0===Q?void 0:Q.length,itemSize:function(e){return M(Q[e])},outerRef:L,style:{maxHeight:I,pointerEvents:c?"none":null},children:Y})}),[c,$,I,Y,Q]);return(0,O.jsx)("div",E(E({},J()),{},{className:"table sticky",style:{width:_},children:(0,O.jsxs)("div",E(E({},q()),{},{className:"body",children:[(0,O.jsx)("div",{className:"header",ref:D,children:X.map((function(e,n){return(0,i.createElement)("div",E(E({},e.getHeaderGroupProps()),{},{className:"tr",key:"".concat(e.id,"_").concat(n)}),e.headers.map((function(e,n){var t,r=n<=P-1,o=e.getHeaderProps(),a=E({},o.style);return r?(a.fontFamily=b.Vp,a.left=0,a.position="sticky",a.textAlign="center",a.width=W[n],a.minWidth=W[n]):N?t=N(e,n-P,{width:G.width}):(t=e.render("Header"),a.color=(R||p.Z).content.default,a.padding=1*H.iI,a.minWidth=G.width),(0,i.createElement)("div",E(E({},o),{},{className:"th",key:e.id,style:a,title:r?"Row number":void 0}),t)})))}))}),ee]}))}))}var P=function(e){var n=e.columnHeaderHeight,t=e.columns,r=e.disableScrolling,o=e.height,a=e.index,c=e.invalidValues,l=e.maxHeight,u=e.noBorderBottom,d=e.noBorderLeft,s=e.noBorderRight,h=e.noBorderTop,m=e.previewIndexes,f=e.renderColumnHeader,p=e.rows,g=e.width;if(null===t||void 0===t?void 0:t.some((function(e){return""===e})))return null;var v=(0,i.useMemo)((function(){return null!==a&&void 0!==a&&a.length&&Array.isArray(a[0])?a[0].length:1}),[a]),b=(0,i.useMemo)((function(){return(0,j.w6)(v).map((function(e,n){return{Header:(0,j.w6)(n+1).map((function(){return" "})).join(" "),accessor:function(e,n){return n},sticky:"left"}})).concat(null===t||void 0===t?void 0:t.map((function(e){return{Header:String(e),accessor:String(e)}})))}),[t,v]),y=(0,i.useMemo)((function(){return(0,O.jsx)(I,{columnHeaderHeight:n,columns:b,data:p,disableScrolling:r,height:o,index:a,invalidValues:c,maxHeight:l,numberOfIndexes:v,previewIndexes:m,renderColumnHeader:f,width:g})}),[n,b,p,r,o,a,c,l,v,m,f,g]);return(0,O.jsx)(C,{columnHeaderHeight:n,disableScrolling:r,height:o,maxHeight:l?l+37:l,noBorderBottom:u,noBorderLeft:d,noBorderRight:s,noBorderTop:h,children:y})}},48888:function(e,n,t){t.d(n,{AE:function(){return o},H3:function(){return i},mW:function(){return a},oE:function(){return c},yg:function(){return r}});var r="tabs[]",o="show_columns",i="column",a="Reports",c="Visualizations"},40489:function(e,n,t){t.d(n,{o_:function(){return l}});var r=t(75582),o=t(34376),i=t(48888);t(82684),t(12691),t(71180),t(58036),t(97618),t(55485),t(48670),t(38276),t(30160),t(72473),t(28598);var a,c=t(69419);!function(e){e.DATASETS="datasets",e.DATASET_DETAIL="dataset_detail",e.COLUMNS="features",e.COLUMN_DETAIL="feature_detail",e.EXPORT="export"}(a||(a={}));var l=function(e,n){var t=(0,o.useRouter)().query.slug,l=void 0===t?[]:t,u=(0,r.Z)(l,1)[0],d=(0,c.iV)(),s=d.show_columns,h=d.column,m="/".concat(a.DATASETS,"/").concat(u),f="".concat(i.H3,"=").concat(h||n),p="".concat(i.yg,"=").concat(e,"&").concat(f,"&").concat(i.AE,"=").concat(s||0);return"".concat(m,"?").concat(p)}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7022],{17022:function(e,n,i){var r=i(75582),t=i(82394),o=i(21764),l=i(82684),s=i(69864),c=i(34376),d=i(70652),u=i(71180),a=i(15338),f=i(97618),m=i(55485),h=i(85854),E=i(65956),x=i(28274),p=i(38276),I=i(75499),v=i(30160),A=i(17488),g=i(35686),L=i(8193),Z=i(72473),j=i(70515),b=i(24755),D=i(3917),_=i(76417),R=i(36717),P=i(86735),S=i(42122),T=i(72619),O=i(28598);function y(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,r)}return i}function k(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?y(Object(i),!0).forEach((function(n){(0,t.Z)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var B,C=2*j.iI;!function(e){e.PERMISSIONS="Permissions",e.USERS="Users"}(B||(B={})),n.Z=function(e){var n,i=e.contained,t=e.onCancel,y=e.slug,w=(0,c.useRouter)(),N=(0,l.useState)(!0),M=N[0],W=N[1],U=(0,l.useState)(null),H=U[0],Y=U[1],Q=(0,l.useState)({}),V=Q[0],F=Q[1],q=(0,l.useState)(null),G=q[0],z=q[1],K=(0,l.useCallback)((function(e,n,i){z(k(k({},e),{},{permissionsMapping:(0,P.HK)(n||[],(function(e){return e.id})),usersMapping:(0,P.HK)(i||[],(function(e){return e.id}))}))}),[z]),$=(0,l.useCallback)((function(e){F((function(n){return k(k({},n),e)})),z((function(n){return k(k({},n),e)}))}),[F,z]),J=g.ZP.roles.detail(y,{},{revalidateOnFocus:!1}).data,X=(0,l.useMemo)((function(){return null===J||void 0===J?void 0:J.role}),[J]);(0,l.useEffect)((function(){X&&K(X,null===X||void 0===X?void 0:X.role_permissions,null===X||void 0===X?void 0:X.users)}),[K,X]);var ee=(0,s.Db)(X?g.ZP.roles.useUpdate(null===X||void 0===X?void 0:X.id):g.ZP.roles.useCreate(),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(e){var n=e.role;F({}),K(n,null===n||void 0===n?void 0:n.role_permissions,null===n||void 0===n?void 0:n.users),X||w.push("/settings/workspace/roles/".concat(null===n||void 0===n?void 0:n.id)),o.Am.success(X?"Role successfully updated.":"New role created successfully.",{position:o.Am.POSITION.BOTTOM_RIGHT,toastId:"role-mutate-success-".concat(n.id)})},onErrorCallback:function(e){var n=e.error,i=n.errors,r=n.exception,t=n.message,l=n.type;o.Am.error((null===i||void 0===i?void 0:i.error)||r||t,{position:o.Am.POSITION.BOTTOM_RIGHT,toastId:l})}})}}),ne=(0,r.Z)(ee,2),ie=ne[0],re=ne[1].isLoading,te=(0,s.Db)(g.ZP.roles.useDelete(null===X||void 0===X?void 0:X.id),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){w.push("/settings/workspace/roles"),o.Am.success("Role successfully delete.",{position:o.Am.POSITION.BOTTOM_RIGHT,toastId:"role-delete-success-".concat(null===X||void 0===X?void 0:X.id)})},onErrorCallback:function(e){var n=e.error,i=n.errors,r=n.exception,t=n.message,l=n.type;o.Am.error((null===i||void 0===i?void 0:i.error)||r||t,{position:o.Am.POSITION.BOTTOM_RIGHT,toastId:l})}})}}),oe=(0,r.Z)(te,2),le=oe[0],se=oe[1].isLoading,ce=g.ZP.permissions.list({},{},{pauseFetch:!X}).data,de=(0,l.useMemo)((function(){return(0,P.YC)((null===ce||void 0===ce?void 0:ce.permissions)||[],"entity_name")}),[ce]),ue=(0,l.useMemo)((function(){return(null===G||void 0===G?void 0:G.permissionsMapping)||{}}),[G]),ae=(0,l.useMemo)((function(){return(0,P.YC)(Object.values(ue),"entity_name")}),[ue]),fe=g.ZP.users.list({},{},{pauseFetch:!X}).data,me=(0,l.useMemo)((function(){return(0,P.YC)((null===fe||void 0===fe?void 0:fe.users)||[],(function(e){return(0,_.s)(e)}))}),[fe]),he=(0,l.useMemo)((function(){return(null===G||void 0===G?void 0:G.usersMapping)||{}}),[G]),Ee=(0,l.useMemo)((function(){return(0,P.YC)(Object.values(he),(function(e){return(0,_.s)(e)}))}),[he]),xe=(0,l.useMemo)((function(){return(null===ae||void 0===ae?void 0:ae.length)>=1}),[ae]),pe=(0,l.useMemo)((function(){return(0,O.jsx)(u.Z,{beforeIcon:(0,O.jsx)(Z.mm,{}),compact:!0,onClick:function(){Y(B.PERMISSIONS),W(!1)},primary:!xe,secondary:xe,small:!0,children:"Add permission"})}),[xe,Y,W]),Ie=(0,l.useMemo)((function(){return(null===Ee||void 0===Ee?void 0:Ee.length)>=1}),[Ee]),ve=(0,l.useMemo)((function(){return(0,O.jsx)(u.Z,{beforeIcon:(0,O.jsx)(Z.mm,{}),compact:!0,onClick:function(){Y(B.USERS),W(!1)},primary:!Ie,secondary:Ie,small:!0,children:"Add user"})}),[Ie]),Ae=(0,l.useCallback)((function(e){return(0,O.jsx)(I.Z,{columnFlex:[null,2,1,1,6],columns:[{label:function(){var n=null===e||void 0===e?void 0:e.every((function(e){var n=e.id;return null===ue||void 0===ue?void 0:ue[n]}));return(0,O.jsx)(d.Z,{checked:n,onClick:function(){$(n?{permissionsMapping:{}}:{permissionsMapping:(0,P.HK)(e,(function(e){return e.id}))})}},"checkbox")},uuid:"actions"},{uuid:"Entity"},{uuid:"Subtype"},{uuid:"Entity ID"},{rightAligned:!0,uuid:"Access"}],onClickRow:function(n){var i=e[n],r=null===i||void 0===i?void 0:i.id,t=!(null===ue||void 0===ue||!ue[r]),o=k({},ue);t?null===o||void 0===o||delete o[r]:o[r]=i,$({permissionsMapping:o})},rows:null===e||void 0===e?void 0:e.map((function(e){var n=e.access,i=e.entity,r=e.entity_id,t=e.entity_name,o=e.entity_type,l=e.id,s=n?(0,R.q)(n):[],c=(null===s||void 0===s?void 0:s.length)||0,u=!(null===ue||void 0===ue||!ue[l]);return[(0,O.jsx)(d.Z,{checked:u},"checkbox"),(0,O.jsx)(v.ZP,{monospace:!0,children:t||i},"entityName"),(0,O.jsx)(v.ZP,{default:!0,monospace:!!o,children:o||"-"},"entityType"),(0,O.jsx)(v.ZP,{default:!0,monospace:!!r,children:r||"-"},"entityID"),(0,O.jsx)("div",{children:c>=1&&(0,O.jsx)(m.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:null===s||void 0===s?void 0:s.map((function(e,n){return(0,O.jsx)("div",{children:(0,O.jsxs)(v.ZP,{default:!0,monospace:!0,small:!0,children:[e,c>=2&&n<c-1&&(0,O.jsx)(v.ZP,{inline:!0,muted:!0,small:!0,children:",\xa0"})]})},e)}))})},"access")]})),uuid:"permissions"})}),[ue,$]),ge=(0,l.useCallback)((function(e){return(0,O.jsx)(I.Z,{columnFlex:[null,1,1,1],columns:[{label:function(){var n=null===e||void 0===e?void 0:e.every((function(e){var n=e.id;return null===he||void 0===he?void 0:he[n]}));return(0,O.jsx)(d.Z,{checked:n,onClick:function(){$(n?{usersMapping:{}}:{usersMapping:(0,P.HK)(e,(function(e){return e.id}))})}},"checkbox")},uuid:"actions"},{uuid:"Username"},{uuid:"First name"},{uuid:"Last name"}],onClickRow:function(n){var i=e[n],r=null===i||void 0===i?void 0:i.id,t=!(null===he||void 0===he||!he[r]),o=k({},he);t?null===o||void 0===o||delete o[r]:o[r]=i,$({usersMapping:o})},rows:null===e||void 0===e?void 0:e.map((function(e){var n=e.first_name,i=e.id,r=e.last_name,t=e.username,o=!(null===he||void 0===he||!he[i]);return[(0,O.jsx)(d.Z,{checked:o},"checkbox"),(0,O.jsx)(v.ZP,{children:t},"username"),(0,O.jsx)(v.ZP,{default:!0,children:n},"firstName"),(0,O.jsx)(v.ZP,{default:!0,children:r},"lastName")]})),uuid:"users"})}),[he,$]),Le=(0,l.useMemo)((function(){return Ae(de)}),[Ae,de]),Ze=(0,l.useMemo)((function(){return ge(me)}),[ge,me]),je=(0,l.useMemo)((function(){return Ae(ae)}),[Ae,ae]),be=(0,l.useMemo)((function(){return ge(Ee)}),[Ae,Ee]),De=(0,O.jsxs)(L.N,{children:[(0,O.jsxs)(E.Z,{noPadding:!0,children:[(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsx)(h.Z,{level:4,children:"Role"})}),(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",children:[(0,O.jsxs)(v.ZP,{danger:"name"in V&&!(null!==G&&void 0!==G&&G.name),default:!0,large:!0,children:["Name ","name"in V&&!(null!==G&&void 0!==G&&G.name)&&(0,O.jsx)(v.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(f.Z,{flex:1,children:(0,O.jsx)(A.Z,{afterIcon:(0,O.jsx)(Z.I8,{}),afterIconClick:function(e,n){var i;null===n||void 0===n||null===(i=n.current)||void 0===i||i.focus()},afterIconSize:C,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return $({name:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. Archmage",value:(null===G||void 0===G?void 0:G.name)||""})})]})})]}),(0,O.jsx)(p.Z,{mb:j.HN}),X&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(E.Z,{noPadding:!0,children:[(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,O.jsx)(h.Z,{level:4,children:"Permissions"}),(0,O.jsx)(p.Z,{mr:j.cd}),xe&&(0,O.jsx)(m.ZP,{alignItems:"center",children:pe})]})}),(0,O.jsx)(a.Z,{light:!0}),!xe&&(0,O.jsxs)(p.Z,{p:j.cd,children:[(0,O.jsx)(p.Z,{mb:j.cd,children:(0,O.jsx)(v.ZP,{default:!0,children:"This role currently has no permissions attached."})}),(0,O.jsx)(m.ZP,{alignItems:"center",children:pe})]}),xe&&(0,O.jsx)(p.Z,{pb:j.Mq,children:je})]}),(0,O.jsx)(p.Z,{mb:j.HN}),(0,O.jsxs)(E.Z,{noPadding:!0,children:[(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,O.jsx)(h.Z,{level:4,children:"Users"}),(0,O.jsx)(p.Z,{mr:j.cd}),Ie&&(0,O.jsx)(m.ZP,{alignItems:"center",children:ve})]})}),(0,O.jsx)(a.Z,{light:!0}),!Ie&&(0,O.jsxs)(p.Z,{p:j.cd,children:[(0,O.jsx)(p.Z,{mb:j.cd,children:(0,O.jsx)(v.ZP,{default:!0,children:"There are currently no users with this role."})}),(0,O.jsx)(m.ZP,{alignItems:"center",children:ve})]}),Ie&&(0,O.jsx)(p.Z,{pb:j.Mq,children:be})]}),(0,O.jsx)(p.Z,{mb:j.HN}),(0,O.jsxs)(E.Z,{noPadding:!0,children:[(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsx)(h.Z,{level:4,children:"Metadata"})}),(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",children:[(0,O.jsx)(v.ZP,{default:!0,large:!0,children:"Last updated"}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,O.jsx)(v.ZP,{large:!0,monospace:!0,muted:!0,children:(null===G||void 0===G?void 0:G.updated_at)&&(0,D.d$)(null===G||void 0===G?void 0:G.updated_at,{includeSeconds:!0})}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(Z.Pf,{muted:!0,size:C}),(0,O.jsx)(p.Z,{mr:1})]})]})}),(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",children:[(0,O.jsx)(v.ZP,{default:!0,large:!0,children:"Created at"}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,O.jsx)(v.ZP,{large:!0,monospace:!0,muted:!0,children:(null===G||void 0===G?void 0:G.created_at)&&(0,D.d$)(null===G||void 0===G?void 0:G.created_at,{includeSeconds:!0})}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(Z.Pf,{muted:!0,size:C}),(0,O.jsx)(p.Z,{mr:1})]})]})}),(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",children:[(0,O.jsx)(v.ZP,{default:!0,large:!0,children:"Created by"}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,O.jsx)(v.ZP,{large:!0,monospace:!0,muted:!0,children:(0,_.s)(null===X||void 0===X?void 0:X.user)}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(Z.Pf,{muted:!0,size:C}),(0,O.jsx)(p.Z,{mr:1})]})]})})]}),(0,O.jsx)(p.Z,{mb:j.HN})]}),(0,O.jsxs)(m.ZP,{children:[(0,O.jsx)(u.Z,{beforeIcon:(0,O.jsx)(Z.vc,{}),disabled:!V||!(null!==(n=Object.keys(V))&&void 0!==n&&n.length),loading:re,onClick:function(){return ie({role:k(k({},(0,S.GL)(G,["name"],{include_blanks:!0})),{},{permission_ids:Object.keys((null===G||void 0===G?void 0:G.permissionsMapping)||{}).map((function(e){return Number(e)})),user_ids:Object.keys((null===G||void 0===G?void 0:G.usersMapping)||{}).map((function(e){return Number(e)}))})})},primary:!0,children:X?"Save changes":"Create new role"}),t&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(u.Z,{onClick:function(){return null===t||void 0===t?void 0:t()},secondary:!0,children:"Cancel and go back"})]}),X&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(u.Z,{beforeIcon:(0,O.jsx)(Z.rF,{}),danger:!0,loading:se,onClick:function(){return le()},children:"Delete role"})]})]})]});return i?De:(0,O.jsx)(x.Z,{after:B.PERMISSIONS===H?Le:B.USERS===H?Ze:null,afterHeader:(0,O.jsx)(p.Z,{px:j.cd,children:(0,O.jsx)(v.ZP,{bold:!0,children:H})}),afterHidden:M,afterWidth:60*j.iI,appendBreadcrumbs:!0,breadcrumbs:[{label:function(){return"Roles"},linkProps:{href:"/settings/workspace/roles"}},{bold:!0,label:function(){return null===X||void 0===X?void 0:X.name}}],setAfterHidden:W,title:null!==X&&void 0!==X&&X.name?"".concat(null===X||void 0===X?void 0:X.name," role"):"New role",uuidItemSelected:b.B2.ROLES,uuidWorkspaceSelected:b.Pl.USER_MANAGEMENT,children:X&&De})}},8193:function(e,n,i){i.d(n,{N:function(){return s}});var r=i(38626),t=i(44897),o=i(42631),l=i(70515),s=r.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1ck7mzt-0"})(["border-radius:","px;padding:","px;",""],o.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||t.Z.background).codeArea,";\n ")}))},36288:function(e,n,i){i.d(n,{Fy:function(){return a},G9:function(){return s},H1:function(){return f},K4:function(){return l},Pt:function(){return c},hl:function(){return u},oO:function(){return d}});var r,t,o=i(82394);!function(e){e[e.OWNER=1]="OWNER",e[e.ADMIN=2]="ADMIN",e[e.EDITOR=4]="EDITOR",e[e.VIEWER=8]="VIEWER",e[e.LIST=16]="LIST",e[e.DETAIL=32]="DETAIL",e[e.CREATE=64]="CREATE",e[e.UPDATE=128]="UPDATE",e[e.DELETE=512]="DELETE",e[e.OPERATION_ALL=1024]="OPERATION_ALL",e[e.QUERY=2048]="QUERY",e[e.QUERY_ALL=4096]="QUERY_ALL",e[e.READ=8192]="READ",e[e.READ_ALL=16384]="READ_ALL",e[e.WRITE=32768]="WRITE",e[e.WRITE_ALL=65536]="WRITE_ALL",e[e.ALL=131072]="ALL",e[e.DISABLE_LIST=262144]="DISABLE_LIST",e[e.DISABLE_DETAIL=524288]="DISABLE_DETAIL",e[e.DISABLE_CREATE=1048576]="DISABLE_CREATE",e[e.DISABLE_UPDATE=2097152]="DISABLE_UPDATE",e[e.DISABLE_DELETE=4194304]="DISABLE_DELETE",e[e.DISABLE_OPERATION_ALL=8388608]="DISABLE_OPERATION_ALL",e[e.DISABLE_QUERY=16777216]="DISABLE_QUERY",e[e.DISABLE_QUERY_ALL=33554432]="DISABLE_QUERY_ALL",e[e.DISABLE_READ=67108864]="DISABLE_READ",e[e.DISABLE_READ_ALL=134217728]="DISABLE_READ_ALL",e[e.DISABLE_WRITE=268435456]="DISABLE_WRITE",e[e.DISABLE_WRITE_ALL=536870912]="DISABLE_WRITE_ALL"}(t||(t={}));var l=(r={},(0,o.Z)(r,t.OWNER,"Owner"),(0,o.Z)(r,t.ADMIN,"Admin"),(0,o.Z)(r,t.EDITOR,"Editor"),(0,o.Z)(r,t.VIEWER,"Viewer"),(0,o.Z)(r,t.LIST,"List"),(0,o.Z)(r,t.DETAIL,"Detail"),(0,o.Z)(r,t.CREATE,"Create"),(0,o.Z)(r,t.UPDATE,"Update"),(0,o.Z)(r,t.DELETE,"Delete"),(0,o.Z)(r,t.OPERATION_ALL,"All operations"),(0,o.Z)(r,t.QUERY,"Query"),(0,o.Z)(r,t.QUERY_ALL,"Query all attributes"),(0,o.Z)(r,t.READ,"Read"),(0,o.Z)(r,t.READ_ALL,"Read all attributes"),(0,o.Z)(r,t.WRITE,"Write"),(0,o.Z)(r,t.WRITE_ALL,"Write all attributes"),(0,o.Z)(r,t.ALL,"All"),(0,o.Z)(r,t.DISABLE_LIST,"Disable list"),(0,o.Z)(r,t.DISABLE_DETAIL,"Disable detail"),(0,o.Z)(r,t.DISABLE_CREATE,"Disable create"),(0,o.Z)(r,t.DISABLE_UPDATE,"Disable update"),(0,o.Z)(r,t.DISABLE_DELETE,"Disable delete"),(0,o.Z)(r,t.DISABLE_OPERATION_ALL,"Disable all operations"),(0,o.Z)(r,t.DISABLE_QUERY,"Disable query"),(0,o.Z)(r,t.DISABLE_QUERY_ALL,"Disable all query parameters"),(0,o.Z)(r,t.DISABLE_READ,"Disable read"),(0,o.Z)(r,t.DISABLE_READ_ALL,"Disable all read attributes"),(0,o.Z)(r,t.DISABLE_WRITE,"Disable write"),(0,o.Z)(r,t.DISABLE_WRITE_ALL,"Disable all write attributes"),r),s=[t.OWNER,t.ADMIN,t.EDITOR,t.VIEWER,t.ALL],c=[t.LIST,t.DETAIL,t.CREATE,t.UPDATE,t.DELETE,t.OPERATION_ALL],d=[t.DISABLE_LIST,t.DISABLE_DETAIL,t.DISABLE_CREATE,t.DISABLE_UPDATE,t.DISABLE_DELETE,t.DISABLE_OPERATION_ALL],u=[t.QUERY,t.QUERY_ALL,t.DISABLE_QUERY,t.DISABLE_QUERY_ALL],a=[t.READ,t.READ_ALL,t.DISABLE_READ,t.DISABLE_READ_ALL],f=[t.WRITE,t.WRITE_ALL,t.DISABLE_WRITE,t.DISABLE_WRITE_ALL]},65956:function(e,n,i){var r=i(38626),t=i(55485),o=i(38276),l=i(30160),s=i(44897),c=i(42631),d=i(47041),u=i(70515),a=i(28598),f=(0,r.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*u.iI,1.5*u.iI,1.5*u.iI),m=r.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," "," "," ",""],c.n_,(function(e){return e.fullWidth&&"\n width: 100%;\n "}),(function(e){return!e.borderless&&"\n border: 1px solid ".concat((e.theme.interactive||s.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.success&&"\n background-color: ".concat((e.theme.background||s.Z.background).successLight,";\n ")}),(function(e){return e.success&&!e.borderless&&"\n border: 1px solid ".concat((e.theme.background||s.Z.background).success,";\n ")}),(function(e){return!e.dark&&!e.success&&"\n background-color: ".concat((e.theme.background||s.Z.background).panel,";\n ")}),(function(e){return e.dark&&"\n background-color: ".concat((e.theme.background||s.Z.background).content,";\n ")}),(function(e){return!e.fullHeight&&"\n height: fit-content;\n "}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")}),(function(e){return e.maxWidth&&"\n max-width: ".concat(e.maxWidth,"px;\n ")}),(function(e){return e.minWidth&&"\n min-width: ".concat(e.minWidth,"px;\n\n @media (max-width: ").concat(e.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(e){return e.borderless&&"\n border: none;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),h=r.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],c.n_,c.n_,(function(e){return"\n background-color: ".concat((e.theme.background||s.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||s.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),f,(function(e){return e.headerPaddingVertical&&"\n padding-bottom: ".concat(e.headerPaddingVertical,"px;\n padding-top: ").concat(e.headerPaddingVertical,"px;\n ")})),E=r.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*u.iI,d.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: calc(".concat(e.maxHeight," - ").concat(15*u.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),x=r.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],c.M8,c.YF,1.75*u.iI);n.Z=function(e){var n=e.borderless,i=e.children,r=e.containerRef,s=e.contentContainerRef,c=e.dark,d=e.footer,u=e.fullHeight,f=void 0===u||u,p=e.fullWidth,I=void 0===p||p,v=e.header,A=e.headerHeight,g=e.headerIcon,L=e.headerPaddingVertical,Z=e.headerTitle,j=e.maxHeight,b=e.maxWidth,D=e.minWidth,_=e.noPadding,R=e.overflowVisible,P=e.subtitle,S=e.success;return(0,a.jsxs)(m,{borderless:n,dark:c,fullHeight:f,fullWidth:I,maxHeight:j,maxWidth:b,minWidth:D,overflowVisible:R,ref:r,success:S,children:[(v||Z)&&(0,a.jsxs)(h,{headerPaddingVertical:L,height:A,children:[v&&v,Z&&(0,a.jsx)(t.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,a.jsxs)(t.ZP,{alignItems:"center",children:[g&&g,(0,a.jsx)(o.Z,{ml:g?1:0,children:(0,a.jsx)(l.ZP,{bold:!0,default:!0,children:Z})})]})})]}),(0,a.jsxs)(E,{maxHeight:j,noPadding:_,overflowVisible:R,ref:s,children:[P&&(0,a.jsx)(o.Z,{mb:2,children:(0,a.jsx)(l.ZP,{default:!0,children:P})}),i]}),d&&(0,a.jsx)(x,{children:d})]})}},36717:function(e,n,i){i.d(n,{q:function(){return o}});var r=i(75582),t=i(36288);function o(e){return Object.entries(t.K4).reduce((function(n,i){var t=(0,r.Z)(i,2),o=t[0],l=t[1];return e&Number(o)?n.concat(l):n}),[])}},76417:function(e,n,i){function r(e){return null!==e&&void 0!==e&&e.first_name?[null===e||void 0===e?void 0:e.first_name,null===e||void 0===e?void 0:e.last_name].filter((function(e){return e})).join(" "):null===e||void 0===e?void 0:e.username}i.d(n,{s:function(){return r}})}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7022],{17022:function(e,n,i){var r=i(75582),t=i(82394),o=i(21764),l=i(82684),s=i(69864),c=i(34376),d=i(71180),u=i(70652),a=i(15338),f=i(97618),m=i(55485),h=i(85854),E=i(65956),x=i(28274),p=i(38276),I=i(75499),v=i(30160),A=i(17488),g=i(35686),L=i(8193),Z=i(72473),j=i(70515),b=i(24755),D=i(3917),_=i(76417),R=i(36717),P=i(86735),S=i(42122),T=i(72619),O=i(28598);function y(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,r)}return i}function k(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?y(Object(i),!0).forEach((function(n){(0,t.Z)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var B,C=2*j.iI;!function(e){e.PERMISSIONS="Permissions",e.USERS="Users"}(B||(B={})),n.Z=function(e){var n,i=e.contained,t=e.onCancel,y=e.slug,w=(0,c.useRouter)(),N=(0,l.useState)(!0),M=N[0],W=N[1],U=(0,l.useState)(null),H=U[0],Y=U[1],Q=(0,l.useState)({}),V=Q[0],F=Q[1],q=(0,l.useState)(null),G=q[0],z=q[1],K=(0,l.useCallback)((function(e,n,i){z(k(k({},e),{},{permissionsMapping:(0,P.HK)(n||[],(function(e){return e.id})),usersMapping:(0,P.HK)(i||[],(function(e){return e.id}))}))}),[z]),$=(0,l.useCallback)((function(e){F((function(n){return k(k({},n),e)})),z((function(n){return k(k({},n),e)}))}),[F,z]),J=g.ZP.roles.detail(y,{},{revalidateOnFocus:!1}).data,X=(0,l.useMemo)((function(){return null===J||void 0===J?void 0:J.role}),[J]);(0,l.useEffect)((function(){X&&K(X,null===X||void 0===X?void 0:X.role_permissions,null===X||void 0===X?void 0:X.users)}),[K,X]);var ee=(0,s.Db)(X?g.ZP.roles.useUpdate(null===X||void 0===X?void 0:X.id):g.ZP.roles.useCreate(),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(e){var n=e.role;F({}),K(n,null===n||void 0===n?void 0:n.role_permissions,null===n||void 0===n?void 0:n.users),X||w.push("/settings/workspace/roles/".concat(null===n||void 0===n?void 0:n.id)),o.Am.success(X?"Role successfully updated.":"New role created successfully.",{position:o.Am.POSITION.BOTTOM_RIGHT,toastId:"role-mutate-success-".concat(n.id)})},onErrorCallback:function(e){var n=e.error,i=n.errors,r=n.exception,t=n.message,l=n.type;o.Am.error((null===i||void 0===i?void 0:i.error)||r||t,{position:o.Am.POSITION.BOTTOM_RIGHT,toastId:l})}})}}),ne=(0,r.Z)(ee,2),ie=ne[0],re=ne[1].isLoading,te=(0,s.Db)(g.ZP.roles.useDelete(null===X||void 0===X?void 0:X.id),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){w.push("/settings/workspace/roles"),o.Am.success("Role successfully delete.",{position:o.Am.POSITION.BOTTOM_RIGHT,toastId:"role-delete-success-".concat(null===X||void 0===X?void 0:X.id)})},onErrorCallback:function(e){var n=e.error,i=n.errors,r=n.exception,t=n.message,l=n.type;o.Am.error((null===i||void 0===i?void 0:i.error)||r||t,{position:o.Am.POSITION.BOTTOM_RIGHT,toastId:l})}})}}),oe=(0,r.Z)(te,2),le=oe[0],se=oe[1].isLoading,ce=g.ZP.permissions.list({},{},{pauseFetch:!X}).data,de=(0,l.useMemo)((function(){return(0,P.YC)((null===ce||void 0===ce?void 0:ce.permissions)||[],"entity_name")}),[ce]),ue=(0,l.useMemo)((function(){return(null===G||void 0===G?void 0:G.permissionsMapping)||{}}),[G]),ae=(0,l.useMemo)((function(){return(0,P.YC)(Object.values(ue),"entity_name")}),[ue]),fe=g.ZP.users.list({},{},{pauseFetch:!X}).data,me=(0,l.useMemo)((function(){return(0,P.YC)((null===fe||void 0===fe?void 0:fe.users)||[],(function(e){return(0,_.s)(e)}))}),[fe]),he=(0,l.useMemo)((function(){return(null===G||void 0===G?void 0:G.usersMapping)||{}}),[G]),Ee=(0,l.useMemo)((function(){return(0,P.YC)(Object.values(he),(function(e){return(0,_.s)(e)}))}),[he]),xe=(0,l.useMemo)((function(){return(null===ae||void 0===ae?void 0:ae.length)>=1}),[ae]),pe=(0,l.useMemo)((function(){return(0,O.jsx)(d.Z,{beforeIcon:(0,O.jsx)(Z.mm,{}),compact:!0,onClick:function(){Y(B.PERMISSIONS),W(!1)},primary:!xe,secondary:xe,small:!0,children:"Add permission"})}),[xe,Y,W]),Ie=(0,l.useMemo)((function(){return(null===Ee||void 0===Ee?void 0:Ee.length)>=1}),[Ee]),ve=(0,l.useMemo)((function(){return(0,O.jsx)(d.Z,{beforeIcon:(0,O.jsx)(Z.mm,{}),compact:!0,onClick:function(){Y(B.USERS),W(!1)},primary:!Ie,secondary:Ie,small:!0,children:"Add user"})}),[Ie]),Ae=(0,l.useCallback)((function(e){return(0,O.jsx)(I.Z,{columnFlex:[null,2,1,1,6],columns:[{label:function(){var n=null===e||void 0===e?void 0:e.every((function(e){var n=e.id;return null===ue||void 0===ue?void 0:ue[n]}));return(0,O.jsx)(u.Z,{checked:n,onClick:function(){$(n?{permissionsMapping:{}}:{permissionsMapping:(0,P.HK)(e,(function(e){return e.id}))})}},"checkbox")},uuid:"actions"},{uuid:"Entity"},{uuid:"Subtype"},{uuid:"Entity ID"},{rightAligned:!0,uuid:"Access"}],onClickRow:function(n){var i=e[n],r=null===i||void 0===i?void 0:i.id,t=!(null===ue||void 0===ue||!ue[r]),o=k({},ue);t?null===o||void 0===o||delete o[r]:o[r]=i,$({permissionsMapping:o})},rows:null===e||void 0===e?void 0:e.map((function(e){var n=e.access,i=e.entity,r=e.entity_id,t=e.entity_name,o=e.entity_type,l=e.id,s=n?(0,R.q)(n):[],c=(null===s||void 0===s?void 0:s.length)||0,d=!(null===ue||void 0===ue||!ue[l]);return[(0,O.jsx)(u.Z,{checked:d},"checkbox"),(0,O.jsx)(v.ZP,{monospace:!0,children:t||i},"entityName"),(0,O.jsx)(v.ZP,{default:!0,monospace:!!o,children:o||"-"},"entityType"),(0,O.jsx)(v.ZP,{default:!0,monospace:!!r,children:r||"-"},"entityID"),(0,O.jsx)("div",{children:c>=1&&(0,O.jsx)(m.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:null===s||void 0===s?void 0:s.map((function(e,n){return(0,O.jsx)("div",{children:(0,O.jsxs)(v.ZP,{default:!0,monospace:!0,small:!0,children:[e,c>=2&&n<c-1&&(0,O.jsx)(v.ZP,{inline:!0,muted:!0,small:!0,children:",\xa0"})]})},e)}))})},"access")]})),uuid:"permissions"})}),[ue,$]),ge=(0,l.useCallback)((function(e){return(0,O.jsx)(I.Z,{columnFlex:[null,1,1,1],columns:[{label:function(){var n=null===e||void 0===e?void 0:e.every((function(e){var n=e.id;return null===he||void 0===he?void 0:he[n]}));return(0,O.jsx)(u.Z,{checked:n,onClick:function(){$(n?{usersMapping:{}}:{usersMapping:(0,P.HK)(e,(function(e){return e.id}))})}},"checkbox")},uuid:"actions"},{uuid:"Username"},{uuid:"First name"},{uuid:"Last name"}],onClickRow:function(n){var i=e[n],r=null===i||void 0===i?void 0:i.id,t=!(null===he||void 0===he||!he[r]),o=k({},he);t?null===o||void 0===o||delete o[r]:o[r]=i,$({usersMapping:o})},rows:null===e||void 0===e?void 0:e.map((function(e){var n=e.first_name,i=e.id,r=e.last_name,t=e.username,o=!(null===he||void 0===he||!he[i]);return[(0,O.jsx)(u.Z,{checked:o},"checkbox"),(0,O.jsx)(v.ZP,{children:t},"username"),(0,O.jsx)(v.ZP,{default:!0,children:n},"firstName"),(0,O.jsx)(v.ZP,{default:!0,children:r},"lastName")]})),uuid:"users"})}),[he,$]),Le=(0,l.useMemo)((function(){return Ae(de)}),[Ae,de]),Ze=(0,l.useMemo)((function(){return ge(me)}),[ge,me]),je=(0,l.useMemo)((function(){return Ae(ae)}),[Ae,ae]),be=(0,l.useMemo)((function(){return ge(Ee)}),[ge,Ee]),De=(0,O.jsxs)(L.N,{children:[(0,O.jsxs)(E.Z,{noPadding:!0,children:[(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsx)(h.Z,{level:4,children:"Role"})}),(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",children:[(0,O.jsxs)(v.ZP,{danger:"name"in V&&!(null!==G&&void 0!==G&&G.name),default:!0,large:!0,children:["Name ","name"in V&&!(null!==G&&void 0!==G&&G.name)&&(0,O.jsx)(v.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(f.Z,{flex:1,children:(0,O.jsx)(A.Z,{afterIcon:(0,O.jsx)(Z.I8,{}),afterIconClick:function(e,n){var i;null===n||void 0===n||null===(i=n.current)||void 0===i||i.focus()},afterIconSize:C,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return $({name:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. Archmage",value:(null===G||void 0===G?void 0:G.name)||""})})]})})]}),(0,O.jsx)(p.Z,{mb:j.HN}),X&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(E.Z,{noPadding:!0,children:[(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,O.jsx)(h.Z,{level:4,children:"Permissions"}),(0,O.jsx)(p.Z,{mr:j.cd}),xe&&(0,O.jsx)(m.ZP,{alignItems:"center",children:pe})]})}),(0,O.jsx)(a.Z,{light:!0}),!xe&&(0,O.jsxs)(p.Z,{p:j.cd,children:[(0,O.jsx)(p.Z,{mb:j.cd,children:(0,O.jsx)(v.ZP,{default:!0,children:"This role currently has no permissions attached."})}),(0,O.jsx)(m.ZP,{alignItems:"center",children:pe})]}),xe&&(0,O.jsx)(p.Z,{pb:j.Mq,children:je})]}),(0,O.jsx)(p.Z,{mb:j.HN}),(0,O.jsxs)(E.Z,{noPadding:!0,children:[(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,O.jsx)(h.Z,{level:4,children:"Users"}),(0,O.jsx)(p.Z,{mr:j.cd}),Ie&&(0,O.jsx)(m.ZP,{alignItems:"center",children:ve})]})}),(0,O.jsx)(a.Z,{light:!0}),!Ie&&(0,O.jsxs)(p.Z,{p:j.cd,children:[(0,O.jsx)(p.Z,{mb:j.cd,children:(0,O.jsx)(v.ZP,{default:!0,children:"There are currently no users with this role."})}),(0,O.jsx)(m.ZP,{alignItems:"center",children:ve})]}),Ie&&(0,O.jsx)(p.Z,{pb:j.Mq,children:be})]}),(0,O.jsx)(p.Z,{mb:j.HN}),(0,O.jsxs)(E.Z,{noPadding:!0,children:[(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsx)(h.Z,{level:4,children:"Metadata"})}),(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",children:[(0,O.jsx)(v.ZP,{default:!0,large:!0,children:"Last updated"}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,O.jsx)(v.ZP,{large:!0,monospace:!0,muted:!0,children:(null===G||void 0===G?void 0:G.updated_at)&&(0,D.d$)(null===G||void 0===G?void 0:G.updated_at,{includeSeconds:!0})}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(Z.Pf,{muted:!0,size:C}),(0,O.jsx)(p.Z,{mr:1})]})]})}),(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",children:[(0,O.jsx)(v.ZP,{default:!0,large:!0,children:"Created at"}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,O.jsx)(v.ZP,{large:!0,monospace:!0,muted:!0,children:(null===G||void 0===G?void 0:G.created_at)&&(0,D.d$)(null===G||void 0===G?void 0:G.created_at,{includeSeconds:!0})}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(Z.Pf,{muted:!0,size:C}),(0,O.jsx)(p.Z,{mr:1})]})]})}),(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(p.Z,{p:j.cd,children:(0,O.jsxs)(m.ZP,{alignItems:"center",children:[(0,O.jsx)(v.ZP,{default:!0,large:!0,children:"Created by"}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,O.jsx)(v.ZP,{large:!0,monospace:!0,muted:!0,children:(0,_.s)(null===X||void 0===X?void 0:X.user)}),(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(Z.Pf,{muted:!0,size:C}),(0,O.jsx)(p.Z,{mr:1})]})]})})]}),(0,O.jsx)(p.Z,{mb:j.HN})]}),(0,O.jsxs)(m.ZP,{children:[(0,O.jsx)(d.Z,{beforeIcon:(0,O.jsx)(Z.vc,{}),disabled:!V||!(null!==(n=Object.keys(V))&&void 0!==n&&n.length),loading:re,onClick:function(){return ie({role:k(k({},(0,S.GL)(G,["name"],{include_blanks:!0})),{},{permission_ids:Object.keys((null===G||void 0===G?void 0:G.permissionsMapping)||{}).map((function(e){return Number(e)})),user_ids:Object.keys((null===G||void 0===G?void 0:G.usersMapping)||{}).map((function(e){return Number(e)}))})})},primary:!0,children:X?"Save changes":"Create new role"}),t&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(d.Z,{onClick:function(){return null===t||void 0===t?void 0:t()},secondary:!0,children:"Cancel and go back"})]}),X&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(p.Z,{mr:j.cd}),(0,O.jsx)(d.Z,{beforeIcon:(0,O.jsx)(Z.rF,{}),danger:!0,loading:se,onClick:function(){return le()},children:"Delete role"})]})]})]});return i?De:(0,O.jsx)(x.Z,{after:B.PERMISSIONS===H?Le:B.USERS===H?Ze:null,afterHeader:(0,O.jsx)(p.Z,{px:j.cd,children:(0,O.jsx)(v.ZP,{bold:!0,children:H})}),afterHidden:M,afterWidth:60*j.iI,appendBreadcrumbs:!0,breadcrumbs:[{label:function(){return"Roles"},linkProps:{href:"/settings/workspace/roles"}},{bold:!0,label:function(){return null===X||void 0===X?void 0:X.name}}],setAfterHidden:W,title:null!==X&&void 0!==X&&X.name?"".concat(null===X||void 0===X?void 0:X.name," role"):"New role",uuidItemSelected:b.B2.ROLES,uuidWorkspaceSelected:b.Pl.USER_MANAGEMENT,children:X&&De})}},8193:function(e,n,i){i.d(n,{N:function(){return s}});var r=i(38626),t=i(44897),o=i(42631),l=i(70515),s=r.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1ck7mzt-0"})(["border-radius:","px;padding:","px;",""],o.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||t.Z.background).codeArea,";\n ")}))},36288:function(e,n,i){i.d(n,{Fy:function(){return a},G9:function(){return s},H1:function(){return f},K4:function(){return l},Pt:function(){return c},hl:function(){return u},oO:function(){return d}});var r,t,o=i(82394);!function(e){e[e.OWNER=1]="OWNER",e[e.ADMIN=2]="ADMIN",e[e.EDITOR=4]="EDITOR",e[e.VIEWER=8]="VIEWER",e[e.LIST=16]="LIST",e[e.DETAIL=32]="DETAIL",e[e.CREATE=64]="CREATE",e[e.UPDATE=128]="UPDATE",e[e.DELETE=512]="DELETE",e[e.OPERATION_ALL=1024]="OPERATION_ALL",e[e.QUERY=2048]="QUERY",e[e.QUERY_ALL=4096]="QUERY_ALL",e[e.READ=8192]="READ",e[e.READ_ALL=16384]="READ_ALL",e[e.WRITE=32768]="WRITE",e[e.WRITE_ALL=65536]="WRITE_ALL",e[e.ALL=131072]="ALL",e[e.DISABLE_LIST=262144]="DISABLE_LIST",e[e.DISABLE_DETAIL=524288]="DISABLE_DETAIL",e[e.DISABLE_CREATE=1048576]="DISABLE_CREATE",e[e.DISABLE_UPDATE=2097152]="DISABLE_UPDATE",e[e.DISABLE_DELETE=4194304]="DISABLE_DELETE",e[e.DISABLE_OPERATION_ALL=8388608]="DISABLE_OPERATION_ALL",e[e.DISABLE_QUERY=16777216]="DISABLE_QUERY",e[e.DISABLE_QUERY_ALL=33554432]="DISABLE_QUERY_ALL",e[e.DISABLE_READ=67108864]="DISABLE_READ",e[e.DISABLE_READ_ALL=134217728]="DISABLE_READ_ALL",e[e.DISABLE_WRITE=268435456]="DISABLE_WRITE",e[e.DISABLE_WRITE_ALL=536870912]="DISABLE_WRITE_ALL"}(t||(t={}));var l=(r={},(0,o.Z)(r,t.OWNER,"Owner"),(0,o.Z)(r,t.ADMIN,"Admin"),(0,o.Z)(r,t.EDITOR,"Editor"),(0,o.Z)(r,t.VIEWER,"Viewer"),(0,o.Z)(r,t.LIST,"List"),(0,o.Z)(r,t.DETAIL,"Detail"),(0,o.Z)(r,t.CREATE,"Create"),(0,o.Z)(r,t.UPDATE,"Update"),(0,o.Z)(r,t.DELETE,"Delete"),(0,o.Z)(r,t.OPERATION_ALL,"All operations"),(0,o.Z)(r,t.QUERY,"Query"),(0,o.Z)(r,t.QUERY_ALL,"Query all attributes"),(0,o.Z)(r,t.READ,"Read"),(0,o.Z)(r,t.READ_ALL,"Read all attributes"),(0,o.Z)(r,t.WRITE,"Write"),(0,o.Z)(r,t.WRITE_ALL,"Write all attributes"),(0,o.Z)(r,t.ALL,"All"),(0,o.Z)(r,t.DISABLE_LIST,"Disable list"),(0,o.Z)(r,t.DISABLE_DETAIL,"Disable detail"),(0,o.Z)(r,t.DISABLE_CREATE,"Disable create"),(0,o.Z)(r,t.DISABLE_UPDATE,"Disable update"),(0,o.Z)(r,t.DISABLE_DELETE,"Disable delete"),(0,o.Z)(r,t.DISABLE_OPERATION_ALL,"Disable all operations"),(0,o.Z)(r,t.DISABLE_QUERY,"Disable query"),(0,o.Z)(r,t.DISABLE_QUERY_ALL,"Disable all query parameters"),(0,o.Z)(r,t.DISABLE_READ,"Disable read"),(0,o.Z)(r,t.DISABLE_READ_ALL,"Disable all read attributes"),(0,o.Z)(r,t.DISABLE_WRITE,"Disable write"),(0,o.Z)(r,t.DISABLE_WRITE_ALL,"Disable all write attributes"),r),s=[t.OWNER,t.ADMIN,t.EDITOR,t.VIEWER,t.ALL],c=[t.LIST,t.DETAIL,t.CREATE,t.UPDATE,t.DELETE,t.OPERATION_ALL],d=[t.DISABLE_LIST,t.DISABLE_DETAIL,t.DISABLE_CREATE,t.DISABLE_UPDATE,t.DISABLE_DELETE,t.DISABLE_OPERATION_ALL],u=[t.QUERY,t.QUERY_ALL,t.DISABLE_QUERY,t.DISABLE_QUERY_ALL],a=[t.READ,t.READ_ALL,t.DISABLE_READ,t.DISABLE_READ_ALL],f=[t.WRITE,t.WRITE_ALL,t.DISABLE_WRITE,t.DISABLE_WRITE_ALL]},65956:function(e,n,i){var r=i(38626),t=i(55485),o=i(38276),l=i(30160),s=i(44897),c=i(42631),d=i(47041),u=i(70515),a=i(28598),f=(0,r.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*u.iI,1.5*u.iI,1.5*u.iI),m=r.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," "," "," ",""],c.n_,(function(e){return e.fullWidth&&"\n width: 100%;\n "}),(function(e){return!e.borderless&&"\n border: 1px solid ".concat((e.theme.interactive||s.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.success&&"\n background-color: ".concat((e.theme.background||s.Z.background).successLight,";\n ")}),(function(e){return e.success&&!e.borderless&&"\n border: 1px solid ".concat((e.theme.background||s.Z.background).success,";\n ")}),(function(e){return!e.dark&&!e.success&&"\n background-color: ".concat((e.theme.background||s.Z.background).panel,";\n ")}),(function(e){return e.dark&&"\n background-color: ".concat((e.theme.background||s.Z.background).content,";\n ")}),(function(e){return!e.fullHeight&&"\n height: fit-content;\n "}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")}),(function(e){return e.maxWidth&&"\n max-width: ".concat(e.maxWidth,"px;\n ")}),(function(e){return e.minWidth&&"\n min-width: ".concat(e.minWidth,"px;\n\n @media (max-width: ").concat(e.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(e){return e.borderless&&"\n border: none;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),h=r.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],c.n_,c.n_,(function(e){return"\n background-color: ".concat((e.theme.background||s.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||s.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),f,(function(e){return e.headerPaddingVertical&&"\n padding-bottom: ".concat(e.headerPaddingVertical,"px;\n padding-top: ").concat(e.headerPaddingVertical,"px;\n ")})),E=r.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*u.iI,d.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: calc(".concat(e.maxHeight," - ").concat(15*u.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),x=r.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],c.M8,c.YF,1.75*u.iI);n.Z=function(e){var n=e.borderless,i=e.children,r=e.containerRef,s=e.contentContainerRef,c=e.dark,d=e.footer,u=e.fullHeight,f=void 0===u||u,p=e.fullWidth,I=void 0===p||p,v=e.header,A=e.headerHeight,g=e.headerIcon,L=e.headerPaddingVertical,Z=e.headerTitle,j=e.maxHeight,b=e.maxWidth,D=e.minWidth,_=e.noPadding,R=e.overflowVisible,P=e.subtitle,S=e.success;return(0,a.jsxs)(m,{borderless:n,dark:c,fullHeight:f,fullWidth:I,maxHeight:j,maxWidth:b,minWidth:D,overflowVisible:R,ref:r,success:S,children:[(v||Z)&&(0,a.jsxs)(h,{headerPaddingVertical:L,height:A,children:[v&&v,Z&&(0,a.jsx)(t.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,a.jsxs)(t.ZP,{alignItems:"center",children:[g&&g,(0,a.jsx)(o.Z,{ml:g?1:0,children:(0,a.jsx)(l.ZP,{bold:!0,default:!0,children:Z})})]})})]}),(0,a.jsxs)(E,{maxHeight:j,noPadding:_,overflowVisible:R,ref:s,children:[P&&(0,a.jsx)(o.Z,{mb:2,children:(0,a.jsx)(l.ZP,{default:!0,children:P})}),i]}),d&&(0,a.jsx)(x,{children:d})]})}},36717:function(e,n,i){i.d(n,{q:function(){return o}});var r=i(75582),t=i(36288);function o(e){return Object.entries(t.K4).reduce((function(n,i){var t=(0,r.Z)(i,2),o=t[0],l=t[1];return e&Number(o)?n.concat(l):n}),[])}},76417:function(e,n,i){function r(e){return null!==e&&void 0!==e&&e.first_name?[null===e||void 0===e?void 0:e.first_name,null===e||void 0===e?void 0:e.last_name].filter((function(e){return e})).join(" "):null===e||void 0===e?void 0:e.username}i.d(n,{s:function(){return r}})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7361],{8193:function(e,n,r){r.d(n,{N:function(){return d}});var i=r(38626),t=r(44897),l=r(42631),o=r(70515),d=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1ck7mzt-0"})(["border-radius:","px;padding:","px;",""],l.n_,o.cd*o.iI,(function(e){return"\n background-color: ".concat((e.theme.background||t.Z.background).codeArea,";\n ")}))},37361:function(e,n,r){var i=r(75582),t=r(82394),l=r(21764),o=r(82684),d=r(69864),s=r(34376),a=r(71180),c=r(70652),u=r(15338),f=r(97618),h=r(55485),g=r(85854),x=r(65956),m=r(28274),p=r(38276),v=r(75499),j=r(30160),E=r(17488),Z=r(35686),I=r(8193),A=r(72473),L=r(70515),_=r(24755),b=r(3917),D=r(76417),P=r(36717),R=r(50178),S=r(86735),T=r(42122),w=r(72619),B=r(28598);function k(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,i)}return r}function y(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?k(Object(r),!0).forEach((function(n){(0,t.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var C,O=2*L.iI;!function(e){e.PERMISSIONS="Permissions",e.ROLES="Roles"}(C||(C={})),n.Z=function(e){var n,r=e.contained,t=e.onCancel,k=e.slug,W=(0,R.PR)()||{},N=W.id,M=W.owner,H=(0,s.useRouter)(),U=(0,o.useState)(!0),V=U[0],z=U[1],Y=(0,o.useState)(null),Q=Y[0],F=Y[1],q=(0,o.useState)({}),G=q[0],K=q[1],J=(0,o.useState)(null),$=J[0],X=J[1],ee=(0,o.useCallback)((function(e,n,r){X(y(y({},e),{},{rolesMapping:(0,S.HK)(n||[],(function(e){return e.id})),permissionsMapping:(0,S.HK)(r||[],(function(e){return e.id}))}))}),[X]),ne=(0,o.useCallback)((function(e){K((function(n){return y(y({},n),e)})),X((function(n){return y(y({},n),e)}))}),[K,X]),re=Z.ZP.users.detail(k,{},{revalidateOnFocus:!1}).data,ie=(0,o.useMemo)((function(){return null===re||void 0===re?void 0:re.user}),[re]);(0,o.useEffect)((function(){ie&&ee(ie,null===ie||void 0===ie?void 0:ie.roles_new,null===ie||void 0===ie?void 0:ie.permissions)}),[ee,ie]);var te=(0,d.Db)(ie?Z.ZP.users.useUpdate(k):Z.ZP.users.useCreate(),{onSuccess:function(e){return(0,w.wD)(e,{callback:function(e){var n=e.user;K({}),ee(n,null===n||void 0===n?void 0:n.roles_new,null===n||void 0===n?void 0:n.permissions),ie||H.push("/settings/workspace/users/".concat(null===n||void 0===n?void 0:n.id)),l.Am.success(ie?"User profile successfully updated.":"New user created successfully.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:"user-update-success-".concat(n.id)})},onErrorCallback:function(e){var n=e.error,r=n.errors,i=n.exception,t=n.message,o=n.type;l.Am.error((null===r||void 0===r?void 0:r.error)||i||t,{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:o})}})}}),le=(0,i.Z)(te,2),oe=le[0],de=le[1].isLoading,se=(0,d.Db)(Z.ZP.users.useDelete(null===ie||void 0===ie?void 0:ie.id),{onSuccess:function(e){return(0,w.wD)(e,{callback:function(){H.push("/settings/workspace/users"),l.Am.success("User successfully delete.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:"user-delete-success-".concat(null===ie||void 0===ie?void 0:ie.id)})},onErrorCallback:function(e){var n=e.error,r=n.errors,i=n.exception,t=n.message,o=n.type;l.Am.error((null===r||void 0===r?void 0:r.error)||i||t,{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:o})}})}}),ae=(0,i.Z)(se,2),ce=ae[0],ue=ae[1].isLoading,fe=Z.ZP.roles.list().data,he=(0,o.useMemo)((function(){return(0,S.YC)((null===fe||void 0===fe?void 0:fe.roles)||[],"name")}),[fe]),ge=(0,o.useMemo)((function(){return(null===$||void 0===$?void 0:$.rolesMapping)||{}}),[$]),xe=(0,o.useMemo)((function(){return(0,S.YC)(Object.values(ge),"name")}),[ge]),me=Z.ZP.permissions.list().data,pe=((0,o.useMemo)((function(){return(0,S.YC)((null===me||void 0===me?void 0:me.permissions)||[],"entity_name")}),[me]),(0,o.useMemo)((function(){return(null===$||void 0===$?void 0:$.permissionsMapping)||{}}),[$])),ve=(0,o.useMemo)((function(){return(0,S.YC)(Object.values(pe),"entity_name")}),[pe]),je=(0,o.useMemo)((function(){return(null===xe||void 0===xe?void 0:xe.length)>=1}),[xe]),Ee=(0,o.useMemo)((function(){return(0,B.jsx)(a.Z,{beforeIcon:(0,B.jsx)(A.mm,{}),compact:!0,onClick:function(){F(C.ROLES),z(!1)},primary:!je,secondary:je,small:!0,children:"Add roles"})}),[je,F,z]),Ze=(0,o.useMemo)((function(){return(null===ve||void 0===ve?void 0:ve.length)>=1}),[ve]),Ie=((0,o.useMemo)((function(){return(0,B.jsx)(a.Z,{beforeIcon:(0,B.jsx)(A.mm,{}),compact:!0,onClick:function(){F(C.PERMISSIONS),z(!1)},primary:!Ze,secondary:Ze,small:!0,children:"Add permission"})}),[Ze,F,z]),(0,o.useCallback)((function(e){return(0,B.jsx)(v.Z,{columnFlex:[null,1],columns:[{label:function(){var n=null===e||void 0===e?void 0:e.every((function(e){var n=e.id;return null===ge||void 0===ge?void 0:ge[n]}));return(0,B.jsx)(c.Z,{checked:n,onClick:function(){ne(n?{rolesMapping:{}}:{rolesMapping:(0,S.HK)(e,(function(e){return e.id}))})}},"checkbox")},uuid:"actions"},{uuid:"Role"}],onClickRow:function(n){var r=e[n],i=null===r||void 0===r?void 0:r.id,t=!(null===ge||void 0===ge||!ge[i]),l=y({},ge);t?null===l||void 0===l||delete l[i]:l[i]=r,ne({rolesMapping:l})},rows:null===e||void 0===e?void 0:e.map((function(e){var n=e.name,r=e.id,i=!(null===ge||void 0===ge||!ge[r]);return[(0,B.jsx)(c.Z,{checked:i},"checkbox"),(0,B.jsx)(j.ZP,{monospace:!0,children:n},"name")]})),uuid:"roles"})}),[ge,ne])),Ae=(0,o.useCallback)((function(e){return(0,B.jsx)(v.Z,{columnFlex:[2,1,1,6],columns:[{uuid:"Entity"},{uuid:"Subtype"},{uuid:"Entity ID"},{rightAligned:!0,uuid:"Access"}],rows:null===e||void 0===e?void 0:e.map((function(e){var n=e.access,r=e.entity,i=e.entity_id,t=e.entity_name,l=e.entity_type,o=n?(0,P.q)(n):[],d=(null===o||void 0===o?void 0:o.length)||0;return[(0,B.jsx)(j.ZP,{monospace:!0,children:t||r},"entityName"),(0,B.jsx)(j.ZP,{default:!0,monospace:!!l,children:l||"-"},"entityType"),(0,B.jsx)(j.ZP,{default:!0,monospace:!!i,children:i||"-"},"entityID"),(0,B.jsx)("div",{children:d>=1&&(0,B.jsx)(h.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:null===o||void 0===o?void 0:o.map((function(e,n){return(0,B.jsx)("div",{children:(0,B.jsxs)(j.ZP,{default:!0,monospace:!0,small:!0,children:[e,d>=2&&n<d-1&&(0,B.jsx)(j.ZP,{inline:!0,muted:!0,small:!0,children:",\xa0"})]})},e)}))})},"access")]})),uuid:"permissions"})}),[]),Le=(0,o.useMemo)((function(){return Ie(he)}),[Ie,he]),_e=(0,o.useMemo)((function(){return Ie(xe)}),[Ie,xe]),be=(0,o.useMemo)((function(){return Ae(ve)}),[Ae,ve]),De=(0,B.jsxs)(I.N,{children:[(0,B.jsxs)(x.Z,{noPadding:!0,children:[(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsx)(g.Z,{level:4,children:"Profile"})}),(0,B.jsx)(u.Z,{light:!0}),(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[(0,B.jsx)(j.ZP,{default:!0,large:!0,children:"Avatar"}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(f.Z,{flex:1,children:(0,B.jsx)(E.Z,{afterIcon:(0,B.jsx)(A.I8,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:O,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return ne({avatar:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"Add initials or an emoji",value:(null===$||void 0===$?void 0:$.avatar)||""})})]})}),(0,B.jsx)(u.Z,{light:!0}),(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[(0,B.jsxs)(j.ZP,{danger:"username"in G&&!(null!==$&&void 0!==$&&$.username),default:!0,large:!0,children:["Username ","username"in G&&!(null!==$&&void 0!==$&&$.username)&&(0,B.jsx)(j.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(f.Z,{flex:1,children:(0,B.jsx)(E.Z,{afterIcon:(0,B.jsx)(A.I8,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:O,alignRight:!0,large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return ne({username:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. Mage Supreme",value:(null===$||void 0===$?void 0:$.username)||""})})]})}),(0,B.jsx)(u.Z,{light:!0}),(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[(0,B.jsx)(j.ZP,{default:!0,large:!0,children:"First name"}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(f.Z,{flex:1,children:(0,B.jsx)(E.Z,{afterIcon:(0,B.jsx)(A.I8,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:O,alignRight:!0,large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return ne({first_name:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. Urza",value:(null===$||void 0===$?void 0:$.first_name)||""})})]})}),(0,B.jsx)(u.Z,{light:!0}),(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[(0,B.jsx)(j.ZP,{default:!0,large:!0,children:"Last name"}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(f.Z,{flex:1,children:(0,B.jsx)(E.Z,{afterIcon:(0,B.jsx)(A.I8,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:O,alignRight:!0,large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return ne({last_name:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. Andromeda",value:(null===$||void 0===$?void 0:$.last_name)||""})})]})}),(0,B.jsx)(u.Z,{light:!0}),(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[ie&&(0,B.jsx)(j.ZP,{default:!0,large:!0,children:"Email"}),!ie&&(0,B.jsxs)(j.ZP,{danger:"email"in G&&!(null!==$&&void 0!==$&&$.email),default:!0,large:!0,children:["Email ","email"in G&&!(null!==$&&void 0!==$&&$.email)&&(0,B.jsx)(j.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,B.jsx)(p.Z,{mr:L.cd}),ie&&(0,B.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,B.jsx)(j.ZP,{large:!0,muted:!0,children:null===$||void 0===$?void 0:$.email}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(A.KJ,{muted:!0,size:O}),(0,B.jsx)(p.Z,{mr:1})]}),!ie&&(0,B.jsx)(f.Z,{flex:1,children:(0,B.jsx)(E.Z,{afterIcon:(0,B.jsx)(A.KJ,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:O,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return ne({email:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"e.g. mage@power.com",type:"email",value:(null===$||void 0===$?void 0:$.email)||""})})]})})]}),(0,B.jsx)(p.Z,{mb:L.HN}),(0,B.jsxs)(x.Z,{noPadding:!0,children:[(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsx)(g.Z,{level:4,children:"Authentication"})}),(0,B.jsx)(u.Z,{light:!0}),ie&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[(0,B.jsxs)(j.ZP,{danger:"password_current"in G&&!(null!==$&&void 0!==$&&$.password_current),default:!0,large:!0,children:["Current password ","password_current"in G&&!(null!==$&&void 0!==$&&$.password_current)&&(0,B.jsx)(j.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(f.Z,{flex:1,children:(0,B.jsx)(E.Z,{afterIcon:(0,B.jsx)(A.I8,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:O,alignRight:!0,large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return ne({password_current:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"* * * * * * * *",type:"password",value:(null===$||void 0===$?void 0:$.password_current)||""})})]})}),(0,B.jsx)(u.Z,{light:!0})]}),(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[(0,B.jsxs)(j.ZP,{danger:"password"in G&&!(null!==$&&void 0!==$&&$.password),default:!0,large:!0,children:[ie?"New password":"Password"," ","password"in G&&!(null!==$&&void 0!==$&&$.password)&&(0,B.jsx)(j.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(f.Z,{flex:1,children:(0,B.jsx)(E.Z,{afterIcon:(0,B.jsx)(A.I8,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:O,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return ne({password:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"* * * * * * * *",type:"password",value:(null===$||void 0===$?void 0:$.password)||""})})]})}),(0,B.jsx)(u.Z,{light:!0}),(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[(0,B.jsxs)(j.ZP,{danger:"password_confirmation"in G&&!(null!==$&&void 0!==$&&$.password_confirmation),default:!0,large:!0,children:["Confirm ",ie?"new password":"password"," ","password_confirmation"in G&&!(null!==$&&void 0!==$&&$.password_confirmation)&&(0,B.jsx)(j.ZP,{danger:!0,inline:!0,large:!0,children:"is required"})]}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(f.Z,{flex:1,children:(0,B.jsx)(E.Z,{afterIcon:(0,B.jsx)(A.I8,{}),afterIconClick:function(e,n){var r;null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()},afterIconSize:O,alignRight:!0,autoComplete:"off",large:!0,noBackground:!0,noBorder:!0,fullWidth:!0,onChange:function(e){return ne({password_confirmation:e.target.value})},paddingHorizontal:0,paddingVertical:0,placeholder:"* * * * * * * *",type:"password",value:(null===$||void 0===$?void 0:$.password_confirmation)||""})})]})})]}),(0,B.jsx)(p.Z,{mb:L.HN}),ie&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(x.Z,{noPadding:!0,children:[(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,B.jsx)(g.Z,{level:4,children:"Roles"}),(0,B.jsx)(p.Z,{mr:L.cd}),je&&(0,B.jsx)(h.ZP,{alignItems:"center",children:Ee})]})}),(0,B.jsx)(u.Z,{light:!0}),!je&&(0,B.jsxs)(p.Z,{p:L.cd,children:[(0,B.jsx)(p.Z,{mb:L.cd,children:(0,B.jsx)(j.ZP,{default:!0,children:"This user currently has no roles attached."})}),(0,B.jsx)(h.ZP,{alignItems:"center",children:Ee})]}),je&&(0,B.jsx)(p.Z,{pb:L.Mq,children:_e})]}),(0,B.jsx)(p.Z,{mb:L.HN}),(0,B.jsxs)(x.Z,{noPadding:!0,children:[(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsx)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,B.jsx)(g.Z,{level:4,children:"Permissions"})})}),(0,B.jsx)(u.Z,{light:!0}),!Ze&&(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsx)(j.ZP,{default:!0,children:"This user currently has no permissions."})}),Ze&&(0,B.jsx)(p.Z,{pb:L.Mq,children:be})]}),(0,B.jsx)(p.Z,{mb:L.HN}),(0,B.jsxs)(x.Z,{noPadding:!0,children:[(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsx)(g.Z,{level:4,children:"Metadata"})}),(0,B.jsx)(u.Z,{light:!0}),(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[(0,B.jsx)(j.ZP,{default:!0,large:!0,children:"Last updated"}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,B.jsx)(j.ZP,{large:!0,monospace:!0,muted:!0,children:(null===$||void 0===$?void 0:$.updated_at)&&(0,b.d$)(null===$||void 0===$?void 0:$.updated_at,{includeSeconds:!0})}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(A.Pf,{muted:!0,size:O}),(0,B.jsx)(p.Z,{mr:1})]})]})}),(0,B.jsx)(u.Z,{light:!0}),(0,B.jsx)(p.Z,{p:L.cd,children:(0,B.jsxs)(h.ZP,{alignItems:"center",children:[(0,B.jsx)(j.ZP,{default:!0,large:!0,children:"Created at"}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsxs)(f.Z,{alignItems:"center",flex:1,justifyContent:"flex-end",children:[(0,B.jsx)(j.ZP,{large:!0,monospace:!0,muted:!0,children:(null===$||void 0===$?void 0:$.created_at)&&(0,b.d$)(null===$||void 0===$?void 0:$.created_at,{includeSeconds:!0})}),(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(A.Pf,{muted:!0,size:O}),(0,B.jsx)(p.Z,{mr:1})]})]})})]}),(0,B.jsx)(p.Z,{mb:L.HN})]}),(0,B.jsxs)(h.ZP,{children:[(0,B.jsx)(a.Z,{beforeIcon:(0,B.jsx)(A.vc,{}),disabled:!G||!(null!==(n=Object.keys(G))&&void 0!==n&&n.length),loading:de,onClick:function(){return oe({user:y(y({},(0,T.GL)($,["avatar","first_name","last_name","password","password_confirmation","password_current","username"].concat(ie?[]:"email"),{include_blanks:!0})),{},{role_ids:Object.keys((null===$||void 0===$?void 0:$.rolesMapping)||{}).map((function(e){return Number(e)}))})})},primary:!0,children:ie?"Save changes":"Create new user"}),t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(a.Z,{onClick:function(){return null===t||void 0===t?void 0:t()},secondary:!0,children:"Cancel and go back"})]}),ie&&String(N)!==String(k)&&M&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(p.Z,{mr:L.cd}),(0,B.jsx)(a.Z,{beforeIcon:(0,B.jsx)(A.rF,{}),danger:!0,loading:ue,onClick:function(){return ce()},children:"Delete user"})]})]})]});return r?De:(0,B.jsx)(m.Z,{after:Le,afterHeader:(0,B.jsx)(p.Z,{px:L.cd,children:(0,B.jsx)(j.ZP,{bold:!0,children:Q})}),afterHidden:V,afterWidth:60*L.iI,appendBreadcrumbs:!0,breadcrumbs:[{label:function(){return"Users"},linkProps:{href:"/settings/workspace/users"}},{bold:!0,label:function(){return(0,D.s)($)}}],setAfterHidden:z,title:ie?(0,D.s)(ie):"New user",uuidItemSelected:_.B2.USERS,uuidWorkspaceSelected:_.Pl.USER_MANAGEMENT,children:ie&&De})}},36288:function(e,n,r){r.d(n,{Fy:function(){return u},G9:function(){return d},H1:function(){return f},K4:function(){return o},Pt:function(){return s},hl:function(){return c},oO:function(){return a}});var i,t,l=r(82394);!function(e){e[e.OWNER=1]="OWNER",e[e.ADMIN=2]="ADMIN",e[e.EDITOR=4]="EDITOR",e[e.VIEWER=8]="VIEWER",e[e.LIST=16]="LIST",e[e.DETAIL=32]="DETAIL",e[e.CREATE=64]="CREATE",e[e.UPDATE=128]="UPDATE",e[e.DELETE=512]="DELETE",e[e.OPERATION_ALL=1024]="OPERATION_ALL",e[e.QUERY=2048]="QUERY",e[e.QUERY_ALL=4096]="QUERY_ALL",e[e.READ=8192]="READ",e[e.READ_ALL=16384]="READ_ALL",e[e.WRITE=32768]="WRITE",e[e.WRITE_ALL=65536]="WRITE_ALL",e[e.ALL=131072]="ALL",e[e.DISABLE_LIST=262144]="DISABLE_LIST",e[e.DISABLE_DETAIL=524288]="DISABLE_DETAIL",e[e.DISABLE_CREATE=1048576]="DISABLE_CREATE",e[e.DISABLE_UPDATE=2097152]="DISABLE_UPDATE",e[e.DISABLE_DELETE=4194304]="DISABLE_DELETE",e[e.DISABLE_OPERATION_ALL=8388608]="DISABLE_OPERATION_ALL",e[e.DISABLE_QUERY=16777216]="DISABLE_QUERY",e[e.DISABLE_QUERY_ALL=33554432]="DISABLE_QUERY_ALL",e[e.DISABLE_READ=67108864]="DISABLE_READ",e[e.DISABLE_READ_ALL=134217728]="DISABLE_READ_ALL",e[e.DISABLE_WRITE=268435456]="DISABLE_WRITE",e[e.DISABLE_WRITE_ALL=536870912]="DISABLE_WRITE_ALL"}(t||(t={}));var o=(i={},(0,l.Z)(i,t.OWNER,"Owner"),(0,l.Z)(i,t.ADMIN,"Admin"),(0,l.Z)(i,t.EDITOR,"Editor"),(0,l.Z)(i,t.VIEWER,"Viewer"),(0,l.Z)(i,t.LIST,"List"),(0,l.Z)(i,t.DETAIL,"Detail"),(0,l.Z)(i,t.CREATE,"Create"),(0,l.Z)(i,t.UPDATE,"Update"),(0,l.Z)(i,t.DELETE,"Delete"),(0,l.Z)(i,t.OPERATION_ALL,"All operations"),(0,l.Z)(i,t.QUERY,"Query"),(0,l.Z)(i,t.QUERY_ALL,"Query all attributes"),(0,l.Z)(i,t.READ,"Read"),(0,l.Z)(i,t.READ_ALL,"Read all attributes"),(0,l.Z)(i,t.WRITE,"Write"),(0,l.Z)(i,t.WRITE_ALL,"Write all attributes"),(0,l.Z)(i,t.ALL,"All"),(0,l.Z)(i,t.DISABLE_LIST,"Disable list"),(0,l.Z)(i,t.DISABLE_DETAIL,"Disable detail"),(0,l.Z)(i,t.DISABLE_CREATE,"Disable create"),(0,l.Z)(i,t.DISABLE_UPDATE,"Disable update"),(0,l.Z)(i,t.DISABLE_DELETE,"Disable delete"),(0,l.Z)(i,t.DISABLE_OPERATION_ALL,"Disable all operations"),(0,l.Z)(i,t.DISABLE_QUERY,"Disable query"),(0,l.Z)(i,t.DISABLE_QUERY_ALL,"Disable all query parameters"),(0,l.Z)(i,t.DISABLE_READ,"Disable read"),(0,l.Z)(i,t.DISABLE_READ_ALL,"Disable all read attributes"),(0,l.Z)(i,t.DISABLE_WRITE,"Disable write"),(0,l.Z)(i,t.DISABLE_WRITE_ALL,"Disable all write attributes"),i),d=[t.OWNER,t.ADMIN,t.EDITOR,t.VIEWER,t.ALL],s=[t.LIST,t.DETAIL,t.CREATE,t.UPDATE,t.DELETE,t.OPERATION_ALL],a=[t.DISABLE_LIST,t.DISABLE_DETAIL,t.DISABLE_CREATE,t.DISABLE_UPDATE,t.DISABLE_DELETE,t.DISABLE_OPERATION_ALL],c=[t.QUERY,t.QUERY_ALL,t.DISABLE_QUERY,t.DISABLE_QUERY_ALL],u=[t.READ,t.READ_ALL,t.DISABLE_READ,t.DISABLE_READ_ALL],f=[t.WRITE,t.WRITE_ALL,t.DISABLE_WRITE,t.DISABLE_WRITE_ALL]},65956:function(e,n,r){var i=r(38626),t=r(55485),l=r(38276),o=r(30160),d=r(44897),s=r(42631),a=r(47041),c=r(70515),u=r(28598),f=(0,i.css)(["padding:","px;padding-bottom:","px;padding-top:","px;"],2*c.iI,1.5*c.iI,1.5*c.iI),h=i.default.div.withConfig({displayName:"Panel__PanelStyle",componentId:"sc-1ct8cgl-0"})(["border-radius:","px;overflow:hidden;"," "," "," "," "," "," "," "," "," "," "," ",""],s.n_,(function(e){return e.fullWidth&&"\n width: 100%;\n "}),(function(e){return!e.borderless&&"\n border: 1px solid ".concat((e.theme.interactive||d.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.success&&"\n background-color: ".concat((e.theme.background||d.Z.background).successLight,";\n ")}),(function(e){return e.success&&!e.borderless&&"\n border: 1px solid ".concat((e.theme.background||d.Z.background).success,";\n ")}),(function(e){return!e.dark&&!e.success&&"\n background-color: ".concat((e.theme.background||d.Z.background).panel,";\n ")}),(function(e){return e.dark&&"\n background-color: ".concat((e.theme.background||d.Z.background).content,";\n ")}),(function(e){return!e.fullHeight&&"\n height: fit-content;\n "}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")}),(function(e){return e.maxWidth&&"\n max-width: ".concat(e.maxWidth,"px;\n ")}),(function(e){return e.minWidth&&"\n min-width: ".concat(e.minWidth,"px;\n\n @media (max-width: ").concat(e.minWidth,"px) {\n min-width: 0;\n }\n ")}),(function(e){return e.borderless&&"\n border: none;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),g=i.default.div.withConfig({displayName:"Panel__HeaderStyle",componentId:"sc-1ct8cgl-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;"," "," "," ",""],s.n_,s.n_,(function(e){return"\n background-color: ".concat((e.theme.background||d.Z.background).chartBlock,";\n border-bottom: 1px solid ").concat((e.theme.interactive||d.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),f,(function(e){return e.headerPaddingVertical&&"\n padding-bottom: ".concat(e.headerPaddingVertical,"px;\n padding-top: ").concat(e.headerPaddingVertical,"px;\n ")})),x=i.default.div.withConfig({displayName:"Panel__ContentStyle",componentId:"sc-1ct8cgl-2"})(["overflow-y:auto;padding:","px;height:100%;"," "," "," "," ",""],1.75*c.iI,a.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: calc(".concat(e.maxHeight," - ").concat(15*c.iI,"px);\n ")}),(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.overflowVisible&&"\n overflow: visible;\n "})),m=i.default.div.withConfig({displayName:"Panel__FooterStyle",componentId:"sc-1ct8cgl-3"})(["border-style:",";border-top-width:","px;padding:","px;"],s.M8,s.YF,1.75*c.iI);n.Z=function(e){var n=e.borderless,r=e.children,i=e.containerRef,d=e.contentContainerRef,s=e.dark,a=e.footer,c=e.fullHeight,f=void 0===c||c,p=e.fullWidth,v=void 0===p||p,j=e.header,E=e.headerHeight,Z=e.headerIcon,I=e.headerPaddingVertical,A=e.headerTitle,L=e.maxHeight,_=e.maxWidth,b=e.minWidth,D=e.noPadding,P=e.overflowVisible,R=e.subtitle,S=e.success;return(0,u.jsxs)(h,{borderless:n,dark:s,fullHeight:f,fullWidth:v,maxHeight:L,maxWidth:_,minWidth:b,overflowVisible:P,ref:i,success:S,children:[(j||A)&&(0,u.jsxs)(g,{headerPaddingVertical:I,height:E,children:[j&&j,A&&(0,u.jsx)(t.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,u.jsxs)(t.ZP,{alignItems:"center",children:[Z&&Z,(0,u.jsx)(l.Z,{ml:Z?1:0,children:(0,u.jsx)(o.ZP,{bold:!0,default:!0,children:A})})]})})]}),(0,u.jsxs)(x,{maxHeight:L,noPadding:D,overflowVisible:P,ref:d,children:[R&&(0,u.jsx)(l.Z,{mb:2,children:(0,u.jsx)(o.ZP,{default:!0,children:R})}),r]}),a&&(0,u.jsx)(m,{children:a})]})}},36717:function(e,n,r){r.d(n,{q:function(){return l}});var i=r(75582),t=r(36288);function l(e){return Object.entries(t.K4).reduce((function(n,r){var t=(0,i.Z)(r,2),l=t[0],o=t[1];return e&Number(l)?n.concat(o):n}),[])}},76417:function(e,n,r){function i(e){return null!==e&&void 0!==e&&e.first_name?[null===e||void 0===e?void 0:e.first_name,null===e||void 0===e?void 0:e.last_name].filter((function(e){return e})).join(" "):null===e||void 0===e?void 0:e.username}r.d(n,{s:function(){return i}})}}]);
|