@crystaldesign/diva-backoffice 24.2.0 → 24.2.1-beta.1

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.
@@ -2054,7 +2054,37 @@ function loadConfiguration(t, root, config, lang) {
2054
2054
  }],
2055
2055
  title: t('backoffice.table.allusers.roleselector.title'),
2056
2056
  label: t('backoffice.table.allusers.roleselector.features')
2057
- }]
2057
+ }, {
2058
+ actionType: 'Modal',
2059
+ title: t('backoffice.table.allusers.modal.title.aktivateuser'),
2060
+ text: t('backoffice.table.allusers.modal.text11'),
2061
+ label: t('backoffice.table.allusers.modal.label.aktivate'),
2062
+ type: 'Form',
2063
+ id: 'FormActivateUser',
2064
+ mapping: {
2065
+ type: 'body',
2066
+ map: [{
2067
+ sourceField: '_id',
2068
+ targetField: 'id'
2069
+ }, {
2070
+ sourceValue: window.location.origin,
2071
+ targetField: 'redirectTo'
2072
+ }]
2073
+ },
2074
+ rule: [{
2075
+ match: {
2076
+ sourceField: 'isActive',
2077
+ value: false
2078
+ }
2079
+ }]
2080
+ }],
2081
+ createAction: {
2082
+ actionType: 'Detail',
2083
+ type: 'Form',
2084
+ id: 'FormUserDetails',
2085
+ title: t('backoffice.table.allusers.createaction.title.userdetails'),
2086
+ permission: 'backoffice_admin_users'
2087
+ }
2058
2088
  },
2059
2089
  TableAllOrganizations: {
2060
2090
  type: 'Table',
@@ -3976,6 +4006,15 @@ function loadConfiguration(t, root, config, lang) {
3976
4006
  targetField: 'organizationId'
3977
4007
  }]
3978
4008
  },
4009
+ createAction: {
4010
+ actionType: 'Detail',
4011
+ type: 'SelectOrCreate',
4012
+ id: 'SelectOrCreateNewMember',
4013
+ title: t('backoffice.table.allorgusers.createAction.title'),
4014
+ label: t('backoffice.table.allorgusers.createAction.title'),
4015
+ disableOnToggle: true,
4016
+ permission: 'backoffice_create_user'
4017
+ },
3979
4018
  downloadAction: {
3980
4019
  actionType: 'CsvExport',
3981
4020
  fileName: 'benutzer'
@@ -4007,6 +4046,30 @@ function loadConfiguration(t, root, config, lang) {
4007
4046
  sourceField: 'phoneNumber'
4008
4047
  }]
4009
4048
  }
4049
+ }, {
4050
+ actionType: 'Modal',
4051
+ title: t('backoffice.table.allorgusers.rowAction.title.aktivateuser'),
4052
+ text: t('backoffice.table.allorgusers.rowAction.text'),
4053
+ label: t('backoffice.table.allorgusers.rowAction.lable.aktivate'),
4054
+ type: 'Form',
4055
+ id: 'FormActivateUser',
4056
+ permission: 'backoffice_create_user',
4057
+ mapping: {
4058
+ type: 'body',
4059
+ map: [{
4060
+ sourceField: '_id',
4061
+ targetField: 'id'
4062
+ }, {
4063
+ sourceValue: window.location.origin,
4064
+ targetField: 'redirectTo'
4065
+ }]
4066
+ },
4067
+ rule: [{
4068
+ match: {
4069
+ sourceField: 'isActive',
4070
+ value: false
4071
+ }
4072
+ }]
4010
4073
  }]
4011
4074
  },
4012
4075
  TableViewpoints: {
@@ -6757,6 +6820,29 @@ function loadConfiguration(t, root, config, lang) {
6757
6820
  }]
6758
6821
  }
6759
6822
  },
6823
+ FormActivateUser: {
6824
+ type: 'Form',
6825
+ apiInterface: {
6826
+ create: {
6827
+ url: '${authService}/v2/users/{id}/activate?redirectTo={redirectTo}',
6828
+ method: 'POST'
6829
+ }
6830
+ },
6831
+ items: [{
6832
+ name: 'id',
6833
+ hidden: true,
6834
+ readonly: true
6835
+ }, {
6836
+ name: 'redirectTo',
6837
+ label: t('backoffice.form.activateuser.items.redirectTo'),
6838
+ rules: [{
6839
+ pattern: new RegExp('((https?)://).*'),
6840
+ required: true,
6841
+ message: t('backoffice.form.activateuser.items.redirectTo.rules')
6842
+ }],
6843
+ type: 'input'
6844
+ }]
6845
+ },
6760
6846
  FormApplicationTranslationsEdit: {
6761
6847
  type: 'Form',
6762
6848
  title: t('backoffice.form.applicationtranslationedit.title'),
@@ -8924,6 +9010,50 @@ function loadConfiguration(t, root, config, lang) {
8924
9010
  }]
8925
9011
  }
8926
9012
  },
9013
+ SelectOrCreateNewMember: {
9014
+ type: 'SelectOrCreate',
9015
+ mode: 'single',
9016
+ apiInterface: {
9017
+ create: '${authService}/v2/organizations/{organizationId}/members/{userId}?roleId=seller',
9018
+ read: {
9019
+ list: '${authService}/v2/organizations/${organizationId}/members?all=true',
9020
+ filterServerSide: true,
9021
+ fallBackToParams: false,
9022
+ permissions: {
9023
+ backoffice_admin_users: '${authService}/v2/users'
9024
+ }
9025
+ }
9026
+ },
9027
+ readMapping: {
9028
+ type: 'query',
9029
+ map: [{
9030
+ targetField: 'organizationId',
9031
+ globalValue: 'selectedOrganizationId'
9032
+ }]
9033
+ },
9034
+ selectMapping: {
9035
+ label: 'mainEmail',
9036
+ value: '_id',
9037
+ searchField: [{
9038
+ field: 'mainEmail',
9039
+ filter: 'contains'
9040
+ }]
9041
+ },
9042
+ formId: 'FormUserDetails',
9043
+ actionMapping: {
9044
+ type: 'body',
9045
+ map: [{
9046
+ targetField: 'userId',
9047
+ sourceField: '_id'
9048
+ }, {
9049
+ targetField: 'organizationId',
9050
+ globalValue: 'selectedOrganizationId'
9051
+ }]
9052
+ },
9053
+ onError: {
9054
+ AUTH_0020: t('errorcodes._source.labels.error.AUTH_0020')
9055
+ }
9056
+ },
8927
9057
  MediaUploadOrganizationLogoMobile: {
8928
9058
  type: 'MediaUpload',
8929
9059
  size: 'medium',
@@ -17673,6 +17803,10 @@ var TableWrapper = function TableWrapper(_ref) {
17673
17803
  rules: state.configuration.downloadAction.rule
17674
17804
  });
17675
17805
  }
17806
+ function checkPermission(permission) {
17807
+ if (!permission) return true;
17808
+ return root.actions.userHasPermission(permission);
17809
+ }
17676
17810
  return /*#__PURE__*/jsxs(Fragment, {
17677
17811
  children: [(state.canDelete || state.configuration.createAction || state.title || state.configuration.canRefresh || state.configuration.clientRelations) && /*#__PURE__*/jsx(Fragment, {
17678
17812
  children: /*#__PURE__*/jsx(Descriptions, {
@@ -17768,7 +17902,7 @@ var TableWrapper = function TableWrapper(_ref) {
17768
17902
  action: action,
17769
17903
  state: state
17770
17904
  }, action.id);
17771
- }), state.configuration.createAction && /*#__PURE__*/jsx(ActionButton, {
17905
+ }), state.configuration.createAction && checkPermission(state.configuration.createAction.permission) && /*#__PURE__*/jsx(ActionButton, {
17772
17906
  action: state.configuration.createAction,
17773
17907
  callback: function callback(data) {
17774
17908
  var _state$onUpdate, _state$configuration$16, _state$configuration$17;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/Table/BaseTable/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,EAAgB,MAAM,UAAU,CAAC;AA6B/C,eAAO,MAAM,UAAU,yCAAoB,CAAC;AAG5C,UAAU,KAAK,CAAC,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CACjB;;;;AAiRD,wBAAsC;AACtC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/Table/BaseTable/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,EAAgB,MAAM,UAAU,CAAC;AA6B/C,eAAO,MAAM,UAAU,yCAAoB,CAAC;AAG5C,UAAU,KAAK,CAAC,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CACjB;;;;AAqRD,wBAAsC;AACtC,cAAc,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "24.2.0",
3
+ "version": "24.2.1-beta.1",
4
4
  "license": "COMMERCIAL",
5
5
  "devDependencies": {
6
6
  "@testing-library/jest-dom": "^5.15.0",
@@ -50,5 +50,5 @@
50
50
  },
51
51
  "module": "build/esm/index.js",
52
52
  "types": "./build/types/backoffice/src/index.d.ts",
53
- "gitHead": "23991521e92c885907ad86850f7972ed518425e6"
53
+ "gitHead": "183203984a7da88d964e14fbba12b8ac036f3c26"
54
54
  }