@bigbinary/neeto-team-members-frontend 3.0.0 → 3.0.2
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.
- package/README.md +1 -0
- package/app/javascript/src/translations/en.json +7 -3
- package/dist/index.cjs.js +131 -39
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +134 -43
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
- package/types.d.ts +4 -0
package/README.md
CHANGED
|
@@ -71,6 +71,7 @@ You can learn more about the setup and usage here:
|
|
|
71
71
|
1. [Permissions](./docs/engine/permissions.md)
|
|
72
72
|
2. [Roles](./docs/engine/roles.md)
|
|
73
73
|
3. [Concerns](./docs/engine/concerns.md)
|
|
74
|
+
4. [Member Limit](./docs/engine/member_limits.md)
|
|
74
75
|
|
|
75
76
|
### Frontend package
|
|
76
77
|
|
|
@@ -60,7 +60,9 @@
|
|
|
60
60
|
"role_one": "Role",
|
|
61
61
|
"role_other": "Roles",
|
|
62
62
|
"search_": "Search {{what}}",
|
|
63
|
-
"takeAction": "Take action"
|
|
63
|
+
"takeAction": "Take action",
|
|
64
|
+
"pro": "Pro",
|
|
65
|
+
"subscriptionPlan": "Subscription plan"
|
|
64
66
|
},
|
|
65
67
|
"helpers": {
|
|
66
68
|
"addMembersToNeetoProducts": "Add {{- emails, boldList}} to the following neeto products.",
|
|
@@ -75,7 +77,8 @@
|
|
|
75
77
|
"selectedMembersCount_other": "{{count}} {{taxonomies.member.plural}} selected of <span>{{totalCount}}</span>",
|
|
76
78
|
"singleProductInvitation": "{{- emails, boldList}} will be invited to <strong>{{product, anyCase}}</strong> with a role of <strong>{{role, anyCase}}</strong>.",
|
|
77
79
|
"themeSelector": "Theme selector",
|
|
78
|
-
"whyIsItDisabled": "Why is it disabled?"
|
|
80
|
+
"whyIsItDisabled": "Why is it disabled?",
|
|
81
|
+
"subscriptionWarning": "You will be charged <strong>{{amount}}</strong> for each newly added member on the next renewal."
|
|
79
82
|
},
|
|
80
83
|
"labels": {
|
|
81
84
|
"addNewRole": "Add new role",
|
|
@@ -89,7 +92,8 @@
|
|
|
89
92
|
"manageRole_other": "Manage roles",
|
|
90
93
|
"neeto_": "neeto{{product, anyCase}}",
|
|
91
94
|
"roleNotFound_one": "There are no role to show",
|
|
92
|
-
"roleNotFound_other": "There are no roles to show"
|
|
95
|
+
"roleNotFound_other": "There are no roles to show",
|
|
96
|
+
"upgradeToProPlan": "Upgrade the above added members to the PRO plan"
|
|
93
97
|
},
|
|
94
98
|
"placeholders": {
|
|
95
99
|
"email": "Please enter the email addresses",
|
package/dist/index.cjs.js
CHANGED
|
@@ -613,6 +613,10 @@ var DATE_FORMAT_OPTIONS = [{
|
|
|
613
613
|
label: i18next.t("neetoTeamMembers.profile.common.ddmmyy"),
|
|
614
614
|
value: "%d/%m/%Y"
|
|
615
615
|
}];
|
|
616
|
+
var SUBSCRIPTION_PLANS = Object.freeze({
|
|
617
|
+
PRO: "pro",
|
|
618
|
+
FREE: "free"
|
|
619
|
+
});
|
|
616
620
|
|
|
617
621
|
var fetchCountries = function fetchCountries() {
|
|
618
622
|
return axios__default["default"].get("".concat(BASE_URL, "/profile/countries"));
|
|
@@ -5843,6 +5847,9 @@ var fetch = function fetch(params) {
|
|
|
5843
5847
|
});
|
|
5844
5848
|
return axios__default["default"].get("".concat(BASE_URL, "/teams?").concat(serializedParams));
|
|
5845
5849
|
};
|
|
5850
|
+
var fetchCountsPerCategory = function fetchCountsPerCategory() {
|
|
5851
|
+
return axios__default["default"].get("".concat(BASE_URL, "/teams/counts_per_category"));
|
|
5852
|
+
};
|
|
5846
5853
|
var create = function create(payload) {
|
|
5847
5854
|
return axios__default["default"].post("".concat(BASE_URL, "/teams"), payload);
|
|
5848
5855
|
};
|
|
@@ -5864,6 +5871,7 @@ var teamsApi = {
|
|
|
5864
5871
|
create: create,
|
|
5865
5872
|
fetch: fetch,
|
|
5866
5873
|
fetchFilterOptions: fetchFilterOptions,
|
|
5874
|
+
fetchCountsPerCategory: fetchCountsPerCategory,
|
|
5867
5875
|
update: update
|
|
5868
5876
|
};
|
|
5869
5877
|
|
|
@@ -5884,13 +5892,21 @@ var useFetchMembers = function useFetchMembers() {
|
|
|
5884
5892
|
refetchOnWindowFocus: false
|
|
5885
5893
|
}));
|
|
5886
5894
|
};
|
|
5895
|
+
var useFetchMembersCountsPerCategory = function useFetchMembersCountsPerCategory() {
|
|
5896
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
5897
|
+
return reactQuery.useQuery([QUERY_KEYS.TEAMS], teamsApi.fetchCountsPerCategory, _objectSpread$8(_objectSpread$8({
|
|
5898
|
+
select: ramda.identity,
|
|
5899
|
+
keepPreviousData: true
|
|
5900
|
+
}, options), {}, {
|
|
5901
|
+
refetchOnWindowFocus: false
|
|
5902
|
+
}));
|
|
5903
|
+
};
|
|
5887
5904
|
var useCreateMember = function useCreateMember(_ref) {
|
|
5888
5905
|
var _onSuccess = _ref.onSuccess,
|
|
5889
5906
|
options = _objectWithoutProperties(_ref, _excluded$2);
|
|
5890
|
-
return
|
|
5907
|
+
return reactUtils.useMutationWithInvalidation(teamsApi.create, _objectSpread$8({
|
|
5908
|
+
keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
|
|
5891
5909
|
onSuccess: function onSuccess(response) {
|
|
5892
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
5893
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
5894
5910
|
// @ts-ignore
|
|
5895
5911
|
_onSuccess === null || _onSuccess === void 0 || _onSuccess(response);
|
|
5896
5912
|
}
|
|
@@ -5899,14 +5915,13 @@ var useCreateMember = function useCreateMember(_ref) {
|
|
|
5899
5915
|
var useUpdateMember = function useUpdateMember(_ref2) {
|
|
5900
5916
|
var _onSuccess2 = _ref2.onSuccess,
|
|
5901
5917
|
options = _objectWithoutProperties(_ref2, _excluded2$1);
|
|
5902
|
-
return
|
|
5918
|
+
return reactUtils.useMutationWithInvalidation(function (_ref3) {
|
|
5903
5919
|
var id = _ref3.id,
|
|
5904
5920
|
payload = _ref3.payload;
|
|
5905
5921
|
return teamsApi.update(id, payload);
|
|
5906
5922
|
}, _objectSpread$8({
|
|
5923
|
+
keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
|
|
5907
5924
|
onSuccess: function onSuccess() {
|
|
5908
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
5909
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
5910
5925
|
_onSuccess2 === null || _onSuccess2 === void 0 || _onSuccess2();
|
|
5911
5926
|
}
|
|
5912
5927
|
}, options));
|
|
@@ -5914,10 +5929,9 @@ var useUpdateMember = function useUpdateMember(_ref2) {
|
|
|
5914
5929
|
var useBulkUpdateMembers = function useBulkUpdateMembers(_ref4) {
|
|
5915
5930
|
var _onSuccess3 = _ref4.onSuccess,
|
|
5916
5931
|
options = _objectWithoutProperties(_ref4, _excluded3);
|
|
5917
|
-
return
|
|
5932
|
+
return reactUtils.useMutationWithInvalidation(teamsApi.bulkUpdate, _objectSpread$8({
|
|
5933
|
+
keysToInvalidate: [QUERY_KEYS.TEAMS, QUERY_KEYS.TEAMS_DEPENDENCIES],
|
|
5918
5934
|
onSuccess: function onSuccess() {
|
|
5919
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
5920
|
-
queryClient.invalidateQueries(QUERY_KEYS.TEAMS_DEPENDENCIES);
|
|
5921
5935
|
_onSuccess3 === null || _onSuccess3 === void 0 || _onSuccess3();
|
|
5922
5936
|
}
|
|
5923
5937
|
}, options));
|
|
@@ -5995,7 +6009,8 @@ var renderNameColumn = function renderNameColumn(_ref) {
|
|
|
5995
6009
|
tableData = _ref.tableData;
|
|
5996
6010
|
var active = tableData.active,
|
|
5997
6011
|
name = tableData.displayName,
|
|
5998
|
-
imageUrl = tableData.profileImageUrl
|
|
6012
|
+
imageUrl = tableData.profileImageUrl,
|
|
6013
|
+
subscriptionPlan = tableData.subscriptionPlan;
|
|
5999
6014
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
6000
6015
|
className: "ntm-members-table__wrapper"
|
|
6001
6016
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -6007,12 +6022,19 @@ var renderNameColumn = function renderNameColumn(_ref) {
|
|
|
6007
6022
|
imageUrl: imageUrl
|
|
6008
6023
|
}
|
|
6009
6024
|
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
6025
|
+
"data-cy": "ntm-member-name-".concat(utils$3.hyphenize(name)),
|
|
6010
6026
|
style: "body2"
|
|
6011
6027
|
}, name), displayStatusTag && /*#__PURE__*/React__default["default"].createElement(neetoui.Tag, {
|
|
6012
6028
|
"data-cy": "ntm-member-status-tag",
|
|
6013
6029
|
style: active ? "primary" : "secondary",
|
|
6014
6030
|
type: "outline",
|
|
6015
6031
|
label: active ? i18next__default["default"].t(MEMBER_FILTER.ACTIVE.label) : i18next__default["default"].t(MEMBER_FILTER.DEACTIVATED.label)
|
|
6032
|
+
}), subscriptionPlan === SUBSCRIPTION_PLANS.PRO && /*#__PURE__*/React__default["default"].createElement(neetoui.Tag, {
|
|
6033
|
+
className: "neeto-ui-text-transform-uppercase",
|
|
6034
|
+
"data-cy": "ntm-member-subscription-plan-tag",
|
|
6035
|
+
label: i18next__default["default"].t("neetoTeamMembers.common.pro"),
|
|
6036
|
+
style: "info",
|
|
6037
|
+
type: "outline"
|
|
6016
6038
|
})), renderDropdownButton({
|
|
6017
6039
|
config: config,
|
|
6018
6040
|
handleUpdateRole: handleUpdateRole,
|
|
@@ -6118,18 +6140,35 @@ var getDefaultColumns = function getDefaultColumns(_ref5) {
|
|
|
6118
6140
|
sorter: true,
|
|
6119
6141
|
width: 200,
|
|
6120
6142
|
title: i18next__default["default"].t("neetoTeamMembers.common.role", constants.SINGULAR)
|
|
6143
|
+
}, {
|
|
6144
|
+
dataIndex: "subscriptionPlan",
|
|
6145
|
+
key: "subscription_plan",
|
|
6146
|
+
hidden: true,
|
|
6147
|
+
isHidable: false,
|
|
6148
|
+
title: ""
|
|
6121
6149
|
}];
|
|
6122
6150
|
};
|
|
6123
6151
|
var removeExcludedRole = ramda.curry(function (excludedRoles, role) {
|
|
6124
6152
|
return !(excludedRoles !== null && excludedRoles !== void 0 && excludedRoles.includes(role === null || role === void 0 ? void 0 : role.name));
|
|
6125
6153
|
});
|
|
6126
|
-
var
|
|
6154
|
+
var getSubscriptionLabelAndValue = function getSubscriptionLabelAndValue() {
|
|
6155
|
+
return Object.entries(SUBSCRIPTION_PLANS).map(function (_ref6) {
|
|
6156
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
6157
|
+
key = _ref7[0],
|
|
6158
|
+
value = _ref7[1];
|
|
6159
|
+
return {
|
|
6160
|
+
label: key,
|
|
6161
|
+
value: value
|
|
6162
|
+
};
|
|
6163
|
+
});
|
|
6164
|
+
};
|
|
6165
|
+
var getColumnData = function getColumnData(_ref8) {
|
|
6127
6166
|
var _config$otherColumns;
|
|
6128
|
-
var config =
|
|
6129
|
-
handleUpdateRole =
|
|
6130
|
-
handleUpdateStatus =
|
|
6131
|
-
memberFilter =
|
|
6132
|
-
isSize =
|
|
6167
|
+
var config = _ref8.config,
|
|
6168
|
+
handleUpdateRole = _ref8.handleUpdateRole,
|
|
6169
|
+
handleUpdateStatus = _ref8.handleUpdateStatus,
|
|
6170
|
+
memberFilter = _ref8.memberFilter,
|
|
6171
|
+
isSize = _ref8.isSize;
|
|
6133
6172
|
var displayStatusTag = ramda.identical(memberFilter, MEMBER_FILTER.ALL.value);
|
|
6134
6173
|
var otherColumns = (_config$otherColumns = config === null || config === void 0 ? void 0 : config.otherColumns) !== null && _config$otherColumns !== void 0 ? _config$otherColumns : [];
|
|
6135
6174
|
var defaultColumns = getDefaultColumns({
|
|
@@ -6141,15 +6180,15 @@ var getColumnData = function getColumnData(_ref6) {
|
|
|
6141
6180
|
isSize: isSize
|
|
6142
6181
|
});
|
|
6143
6182
|
var columns = defaultColumns.map(function (column) {
|
|
6144
|
-
var otherColumn = otherColumns.find(function (
|
|
6145
|
-
var dataIndex =
|
|
6183
|
+
var otherColumn = otherColumns.find(function (_ref9) {
|
|
6184
|
+
var dataIndex = _ref9.dataIndex;
|
|
6146
6185
|
return ramda.identical(dataIndex, column.dataIndex);
|
|
6147
6186
|
});
|
|
6148
6187
|
return otherColumn || column;
|
|
6149
6188
|
});
|
|
6150
6189
|
otherColumns.forEach(function (otherColumn) {
|
|
6151
|
-
var column = columns.find(function (
|
|
6152
|
-
var dataIndex =
|
|
6190
|
+
var column = columns.find(function (_ref10) {
|
|
6191
|
+
var dataIndex = _ref10.dataIndex;
|
|
6153
6192
|
return ramda.identical(dataIndex, otherColumn.dataIndex);
|
|
6154
6193
|
});
|
|
6155
6194
|
if (!column) columns.push(otherColumn);
|
|
@@ -6224,20 +6263,28 @@ var defaultNeetoFiltersColumns = function defaultNeetoFiltersColumns() {
|
|
|
6224
6263
|
node: "organization_role.name",
|
|
6225
6264
|
type: "multi_option",
|
|
6226
6265
|
values: []
|
|
6266
|
+
}, {
|
|
6267
|
+
key: "subscription_plan",
|
|
6268
|
+
label: i18next__default["default"].t("neetoTeamMembers.common.subscriptionPlan", constants.SINGULAR),
|
|
6269
|
+
model: "User",
|
|
6270
|
+
node: "subscription_plan",
|
|
6271
|
+
type: "single_option",
|
|
6272
|
+
values: []
|
|
6227
6273
|
}];
|
|
6228
6274
|
};
|
|
6229
|
-
var buildFilterColumns = function buildFilterColumns(
|
|
6230
|
-
var
|
|
6231
|
-
|
|
6232
|
-
emails =
|
|
6233
|
-
|
|
6234
|
-
organizationRoles =
|
|
6235
|
-
|
|
6236
|
-
setSearchTerm =
|
|
6237
|
-
isLoading =
|
|
6275
|
+
var buildFilterColumns = function buildFilterColumns(_ref11) {
|
|
6276
|
+
var _ref11$options = _ref11.options,
|
|
6277
|
+
_ref11$options$emails = _ref11$options.emails,
|
|
6278
|
+
emails = _ref11$options$emails === void 0 ? [] : _ref11$options$emails,
|
|
6279
|
+
_ref11$options$organi = _ref11$options.organizationRoles,
|
|
6280
|
+
organizationRoles = _ref11$options$organi === void 0 ? [] : _ref11$options$organi,
|
|
6281
|
+
_ref11$emailConfig = _ref11.emailConfig,
|
|
6282
|
+
setSearchTerm = _ref11$emailConfig.setSearchTerm,
|
|
6283
|
+
isLoading = _ref11$emailConfig.isLoading;
|
|
6238
6284
|
var columnValues = {
|
|
6239
6285
|
email: emails.map(neetoCist.toLabelAndValue),
|
|
6240
|
-
role: organizationRoles.map(neetoCist.toLabelAndValue)
|
|
6286
|
+
role: organizationRoles.map(neetoCist.toLabelAndValue),
|
|
6287
|
+
subscription_plan: getSubscriptionLabelAndValue()
|
|
6241
6288
|
};
|
|
6242
6289
|
return defaultNeetoFiltersColumns().map(function (column) {
|
|
6243
6290
|
var values = columnValues[column.key];
|
|
@@ -6252,8 +6299,8 @@ var buildFilterColumns = function buildFilterColumns(_ref9) {
|
|
|
6252
6299
|
};
|
|
6253
6300
|
var getValidCategory = function getValidCategory(category) {
|
|
6254
6301
|
var defaultCategory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MEMBER_FILTER.ACTIVE.value;
|
|
6255
|
-
return Object.values(MEMBER_FILTER).some(function (
|
|
6256
|
-
var value =
|
|
6302
|
+
return Object.values(MEMBER_FILTER).some(function (_ref12) {
|
|
6303
|
+
var value = _ref12.value;
|
|
6257
6304
|
return ramda.identical(value, category);
|
|
6258
6305
|
}) ? category : defaultCategory;
|
|
6259
6306
|
};
|
|
@@ -6262,9 +6309,9 @@ var getFilteredRoles = function getFilteredRoles() {
|
|
|
6262
6309
|
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6263
6310
|
return ramda.filter(removeExcludedRole(config === null || config === void 0 ? void 0 : config.excludedRoles), roles);
|
|
6264
6311
|
};
|
|
6265
|
-
var generateNoDataContent = function generateNoDataContent(
|
|
6266
|
-
var filterCategory =
|
|
6267
|
-
buttonProps =
|
|
6312
|
+
var generateNoDataContent = function generateNoDataContent(_ref13) {
|
|
6313
|
+
var filterCategory = _ref13.filterCategory,
|
|
6314
|
+
buttonProps = _ref13.buttonProps;
|
|
6268
6315
|
var disabled = buttonProps.disabled,
|
|
6269
6316
|
onClick = buttonProps.onClick;
|
|
6270
6317
|
var kind = MEMBER_FILTER[filterCategory].value.toLowerCase();
|
|
@@ -6667,6 +6714,9 @@ var Left = function Left(_ref) {
|
|
|
6667
6714
|
window.location.pathname = "/";
|
|
6668
6715
|
}
|
|
6669
6716
|
};
|
|
6717
|
+
var resetSelectedRows = function resetSelectedRows() {
|
|
6718
|
+
return setSelectedRows(DEFAULT_SELECTED_ROWS);
|
|
6719
|
+
};
|
|
6670
6720
|
var handleActivateMembers = function handleActivateMembers() {
|
|
6671
6721
|
return bulkUpdateMember({
|
|
6672
6722
|
users: {
|
|
@@ -6762,7 +6812,7 @@ var Left = function Left(_ref) {
|
|
|
6762
6812
|
setBulkUpdateRole: setBulkUpdateRole,
|
|
6763
6813
|
disabled: hasDeactivateMembers,
|
|
6764
6814
|
hasUpdatePermission: isUpdatePermissionGranted
|
|
6765
|
-
}), config === null || config === void 0 || (_config$otherBulkActi = config.otherBulkActions) === null || _config$otherBulkActi === void 0 ? void 0 : _config$otherBulkActi.call(config))))), /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, {
|
|
6815
|
+
}), config === null || config === void 0 || (_config$otherBulkActi = config.otherBulkActions) === null || _config$otherBulkActi === void 0 ? void 0 : _config$otherBulkActi.call(config, resetSelectedRows, selectedRows))))), /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, {
|
|
6766
6816
|
isOpen: selectedAlert,
|
|
6767
6817
|
submitButtonLabel: getButtonLabel(selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.type),
|
|
6768
6818
|
title: selectedAlert === null || selectedAlert === void 0 ? void 0 : selectedAlert.title,
|
|
@@ -6884,6 +6934,7 @@ var AppList = function AppList(_ref) {
|
|
|
6884
6934
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Checkbox, {
|
|
6885
6935
|
checked: isAppListEnabled,
|
|
6886
6936
|
className: "ntm-manage-members__checkbox-align-start",
|
|
6937
|
+
"data-cy": "ntm-manage-members-app-list-checkbox",
|
|
6887
6938
|
label: /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
6888
6939
|
component: "span",
|
|
6889
6940
|
lineHeight: "relaxed",
|
|
@@ -7069,6 +7120,7 @@ var renderInitialValues = function renderInitialValues(_ref) {
|
|
|
7069
7120
|
lastName: "",
|
|
7070
7121
|
emails: [],
|
|
7071
7122
|
role: (_roles$1$name = (_roles$ = roles[1]) === null || _roles$ === void 0 ? void 0 : _roles$.name) !== null && _roles$1$name !== void 0 ? _roles$1$name : "",
|
|
7123
|
+
subscriptionPlan: SUBSCRIPTION_PLANS.FREE,
|
|
7072
7124
|
appRoles: generateAppsRolesInitialValue(globalRoles, (_roles$2 = roles[1]) === null || _roles$2 === void 0 ? void 0 : _roles$2.name)
|
|
7073
7125
|
}, additionalFieldsInitialValues);
|
|
7074
7126
|
};
|
|
@@ -7329,10 +7381,45 @@ var RolesRadioGroup = function RolesRadioGroup(_ref) {
|
|
|
7329
7381
|
}));
|
|
7330
7382
|
};
|
|
7331
7383
|
|
|
7384
|
+
var SubscriptionPlan = function SubscriptionPlan(_ref) {
|
|
7385
|
+
var _subscription$plan, _subscription$plan2;
|
|
7386
|
+
var subscription = _ref.subscription;
|
|
7387
|
+
var _useFormikContext = formik.useFormikContext(),
|
|
7388
|
+
values = _useFormikContext.values,
|
|
7389
|
+
setFieldValue = _useFormikContext.setFieldValue;
|
|
7390
|
+
var isProPlan = (values === null || values === void 0 ? void 0 : values.subscriptionPlan) === SUBSCRIPTION_PLANS.PRO;
|
|
7391
|
+
var handleChange = function handleChange(event) {
|
|
7392
|
+
return setFieldValue("subscriptionPlan", event.target.checked ? SUBSCRIPTION_PLANS.PRO : SUBSCRIPTION_PLANS.FREE);
|
|
7393
|
+
};
|
|
7394
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
7395
|
+
className: "flex flex-col space-y-4"
|
|
7396
|
+
}, /*#__PURE__*/React__default["default"].createElement(formik$1.Checkbox, {
|
|
7397
|
+
label: /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
7398
|
+
i18nKey: "neetoTeamMembers.labels.upgradeToProPlan"
|
|
7399
|
+
}),
|
|
7400
|
+
name: "isSubscriptionProPlan",
|
|
7401
|
+
onChange: handleChange
|
|
7402
|
+
}), isProPlan && /*#__PURE__*/React__default["default"].createElement(neetoui.Callout, {
|
|
7403
|
+
icon: neetoIcons.Warning,
|
|
7404
|
+
style: "warning"
|
|
7405
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
7406
|
+
style: "body2",
|
|
7407
|
+
weight: "normal"
|
|
7408
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
7409
|
+
i18nKey: "neetoTeamMembers.helpers.subscriptionWarning",
|
|
7410
|
+
values: {
|
|
7411
|
+
amount: utils$3.currencyFormat.withSymbol(subscription === null || subscription === void 0 || (_subscription$plan = subscription.plan) === null || _subscription$plan === void 0 ? void 0 : _subscription$plan.amount, subscription === null || subscription === void 0 || (_subscription$plan2 = subscription.plan) === null || _subscription$plan2 === void 0 || (_subscription$plan2 = _subscription$plan2.currency) === null || _subscription$plan2 === void 0 ? void 0 : _subscription$plan2.toUpperCase(), {
|
|
7412
|
+
maximumFractionDigits: 2,
|
|
7413
|
+
minimumFractionDigits: 0
|
|
7414
|
+
})
|
|
7415
|
+
}
|
|
7416
|
+
}))));
|
|
7417
|
+
};
|
|
7418
|
+
|
|
7332
7419
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7333
7420
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7334
7421
|
var ManageMember = function ManageMember(_ref) {
|
|
7335
|
-
var _manageMemberComponen, _config$additionalFie2;
|
|
7422
|
+
var _config$subscription, _manageMemberComponen, _config$additionalFie2;
|
|
7336
7423
|
var config = _ref.config,
|
|
7337
7424
|
onComplete = _ref.onComplete,
|
|
7338
7425
|
_ref$roles = _ref.roles,
|
|
@@ -7367,6 +7454,7 @@ var ManageMember = function ManageMember(_ref) {
|
|
|
7367
7454
|
var haveToFetchRoles = ramda.isEmpty(roles) && isViewPermissionGranted;
|
|
7368
7455
|
var isEditForm = !!selectedMember;
|
|
7369
7456
|
var isLastPage = currentPage === FORM_PAGES.CONFIRMATION || isEditForm;
|
|
7457
|
+
var isSubscriptionVisible = !isEditForm && ((_config$subscription = config.subscription) === null || _config$subscription === void 0 ? void 0 : _config$subscription.isActive);
|
|
7370
7458
|
var _useFetchRoles = useFetchRoles({
|
|
7371
7459
|
select: function select(response) {
|
|
7372
7460
|
var _response$organizatio;
|
|
@@ -7466,6 +7554,9 @@ var ManageMember = function ManageMember(_ref) {
|
|
|
7466
7554
|
emails: emails,
|
|
7467
7555
|
selectedMember: selectedMember,
|
|
7468
7556
|
innerRef: inputReference
|
|
7557
|
+
}), isSubscriptionVisible && /*#__PURE__*/React__default["default"].createElement(SubscriptionPlan, {
|
|
7558
|
+
handleClose: handleClose,
|
|
7559
|
+
subscription: config.subscription
|
|
7469
7560
|
}), /*#__PURE__*/React__default["default"].createElement(RolesRadioGroup, {
|
|
7470
7561
|
config: config,
|
|
7471
7562
|
globalRoles: globalRoles,
|
|
@@ -7586,7 +7677,7 @@ var Menu = function Menu(_ref) {
|
|
|
7586
7677
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7587
7678
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7588
7679
|
var TeamMembers = function TeamMembers(_ref) {
|
|
7589
|
-
var _config$fetchApiRespo, _config$table, _config$table$onDropd;
|
|
7680
|
+
var _config$fetchApiRespo, _config$table, _config$table$onDropd, _config$table2;
|
|
7590
7681
|
var config = _ref.config;
|
|
7591
7682
|
var _useTranslation = reactI18next.useTranslation(),
|
|
7592
7683
|
t = _useTranslation.t;
|
|
@@ -7678,7 +7769,7 @@ var TeamMembers = function TeamMembers(_ref) {
|
|
|
7678
7769
|
memberFilter: filters.category,
|
|
7679
7770
|
isSize: isSize
|
|
7680
7771
|
});
|
|
7681
|
-
}, [filters.category] // eslint-disable-line react-hooks/exhaustive-deps
|
|
7772
|
+
}, [filters.category, (_config$table2 = config.table) === null || _config$table2 === void 0 ? void 0 : _config$table2.dropdownProps] // eslint-disable-line react-hooks/exhaustive-deps
|
|
7682
7773
|
);
|
|
7683
7774
|
|
|
7684
7775
|
var _useHiddenColumns = Columns$1.useHiddenColumns(TEAM_MEMBERS_HIDDEN_COLUMNS),
|
|
@@ -7817,4 +7908,5 @@ exports.VIEW_ROLES_PERMISSION = VIEW_ROLES_PERMISSION;
|
|
|
7817
7908
|
exports.hasPermission = hasPermission;
|
|
7818
7909
|
exports.refetchMembers = refetchMembers;
|
|
7819
7910
|
exports.useFetchMembers = useFetchMembers;
|
|
7911
|
+
exports.useFetchMembersCountsPerCategory = useFetchMembersCountsPerCategory;
|
|
7820
7912
|
//# sourceMappingURL=index.cjs.js.map
|