@bigbinary/neeto-team-members-frontend 4.5.3 → 4.5.5
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 -1
- package/app/javascript/src/translations/en.json +115 -113
- package/dist/Profile.js +40 -48
- package/dist/Profile.js.map +1 -1
- package/dist/cjs/Profile.js +38 -46
- package/dist/cjs/Profile.js.map +1 -1
- package/package.json +15 -14
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# neeto-team-members-nano
|
|
2
2
|
|
|
3
|
-
The `neeto-team-members-nano` facilitates the administration of team members within neeto applications. The nano exports the `@bigbinary/neeto-team-members-frontend` NPM package and `neeto-team-members-engine` Rails engine for development.
|
|
3
|
+
The `neeto-team-members-nano` facilitates the administration of team members within neeto applications. The nano exports the `@bigbinary/neeto-team-members-frontend` NPM package and `neeto-team-members-engine` Rails engine for development.
|
|
4
4
|
|
|
5
5
|
## Contents
|
|
6
6
|
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"taxonomyDefaultLabels": {
|
|
3
|
-
"member": {
|
|
4
|
-
"singular": "Team member",
|
|
5
|
-
"plural": "Team members"
|
|
6
|
-
},
|
|
7
|
-
"group": {
|
|
8
|
-
"singular": "Group",
|
|
9
|
-
"plural": "Groups"
|
|
10
|
-
},
|
|
11
|
-
"groupMember": {
|
|
12
|
-
"singular": "Member",
|
|
13
|
-
"plural": "Members"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
2
|
"neetoTeamMembers": {
|
|
17
3
|
"alerts": {
|
|
18
4
|
"messages": {
|
|
@@ -20,31 +6,31 @@
|
|
|
20
6
|
"activateMember_other": "You are activating <strong>{{count}}</strong> {{taxonomies.member.plural}}.",
|
|
21
7
|
"changeRole_one": "You are changing the role of <strong>{{person, anyCase}}</strong> to <strong>{{role, anyCase}}</strong>.",
|
|
22
8
|
"changeRole_other": "You are changing the role of <strong>{{count}}</strong> {{metaName}} to <strong>{{role, anyCase}}</strong>.",
|
|
23
|
-
"removeMember_one": "You are removing the {{taxonomies.member.singular}} <strong>{{person, anyCase}}</strong>.",
|
|
24
|
-
"removeMember_other": "You are removing <strong>{{count}}</strong> {{taxonomies.member.plural}}.",
|
|
25
|
-
"deletingRole": "You are permanently deleting the role <strong>{{name, anyCase}}</strong>. This can't be undone.",
|
|
26
9
|
"delete": "You are permanently deleting the {{resource}} <strong>{{name, anyCase}}</strong>. This can't be undone.",
|
|
27
|
-
"
|
|
10
|
+
"deletingRole": "You are permanently deleting the role <strong>{{name, anyCase}}</strong>. This can't be undone.",
|
|
11
|
+
"removeMember": "You are removing <strong>{{member, anyCase}}</strong> from this group.",
|
|
12
|
+
"removeMember_one": "You are removing the {{taxonomies.member.singular}} <strong>{{person, anyCase}}</strong>.",
|
|
13
|
+
"removeMember_other": "You are removing <strong>{{count}}</strong> {{taxonomies.member.plural}}."
|
|
28
14
|
}
|
|
29
15
|
},
|
|
30
16
|
"buttons": {
|
|
17
|
+
"activate": "Activate",
|
|
31
18
|
"back": "Back",
|
|
32
19
|
"cancel": "Cancel",
|
|
20
|
+
"changeRole": "Change role",
|
|
33
21
|
"continue": "Continue",
|
|
22
|
+
"delete": "Delete",
|
|
34
23
|
"download": "Download",
|
|
35
24
|
"editBasicInfo": "Edit basic info",
|
|
36
25
|
"manageBillingAndSubscriptions": "Manage billing and subscriptions",
|
|
26
|
+
"remove": "Remove",
|
|
37
27
|
"reset": "Reset",
|
|
38
28
|
"saveChanges": "Save changes",
|
|
39
|
-
"delete": "Delete",
|
|
40
|
-
"activate": "Activate",
|
|
41
|
-
"remove": "Remove",
|
|
42
|
-
"changeRole": "Change role",
|
|
43
29
|
"updateEmail": "Update email"
|
|
44
30
|
},
|
|
45
31
|
"columns": {
|
|
46
|
-
"
|
|
47
|
-
"
|
|
32
|
+
"noColumnsFound": "No columns found.",
|
|
33
|
+
"search": "Search columns"
|
|
48
34
|
},
|
|
49
35
|
"common": {
|
|
50
36
|
"activate": "Activate",
|
|
@@ -55,9 +41,7 @@
|
|
|
55
41
|
"all": "All",
|
|
56
42
|
"all_": "All {{what}}",
|
|
57
43
|
"changeRole": "Change role?",
|
|
58
|
-
"remove_": "Remove {{what}}?",
|
|
59
44
|
"deactivated": "Remove",
|
|
60
|
-
"removed_": "Removed {{what}}",
|
|
61
45
|
"delete": "Delete",
|
|
62
46
|
"description": "Description",
|
|
63
47
|
"edit": "Edit",
|
|
@@ -65,48 +49,68 @@
|
|
|
65
49
|
"email_one": "Email",
|
|
66
50
|
"email_other": "Emails",
|
|
67
51
|
"format": "Format",
|
|
52
|
+
"free": "Free",
|
|
53
|
+
"loading": "Loading...",
|
|
68
54
|
"name": "Name",
|
|
69
55
|
"notFound_": "There are no {{what}} to show",
|
|
70
56
|
"notFoundWithKind_": "There are no {{kind}} {{what}} to show",
|
|
71
57
|
"permission_one": "Permission",
|
|
72
58
|
"permission_other": "Permissions",
|
|
73
59
|
"productName": "Product name",
|
|
60
|
+
"remove": "Remove",
|
|
61
|
+
"remove_": "Remove {{what}}?",
|
|
62
|
+
"removed_": "Removed {{what}}",
|
|
74
63
|
"role_one": "Role",
|
|
75
64
|
"role_other": "Roles",
|
|
76
65
|
"search_": "Search {{what}}",
|
|
66
|
+
"subscriptionType": "{{subscription}} plan",
|
|
77
67
|
"takeAction": "Take action",
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
"timeZone": "Etc/UTC"
|
|
69
|
+
},
|
|
70
|
+
"downloadPane": {
|
|
71
|
+
"description": {
|
|
72
|
+
"allMembers": "Download all {{taxonomies.member.plural}}",
|
|
73
|
+
"selectedMembers_one": "Download selected {{taxonomies.member.singular}}",
|
|
74
|
+
"selectedMembers_other": "Download {{count}} selected {{taxonomies.member.plural}}"
|
|
75
|
+
},
|
|
76
|
+
"title": "Download {{taxonomies.member.plural}}"
|
|
81
77
|
},
|
|
82
78
|
"helpers": {
|
|
83
79
|
"addMembersToNeetoProducts": "Add {{- emails, boldList}} to the following neeto products.",
|
|
84
|
-
"manageProducts": "Too many products? <button>Disable some</button> of these products.",
|
|
85
80
|
"configPermissions": "Configure permissions for the modules.",
|
|
81
|
+
"emptyTable": "There are no {{entity}} to show",
|
|
86
82
|
"enterMultipleEmails": "Press space, comma, tab or enter key to add multiple email addresses.",
|
|
83
|
+
"manageProducts": "Too many products? <button>Disable some</button> of these products.",
|
|
84
|
+
"memberCreationStatus_one": "Inviting {{taxonomies.member.singular}}",
|
|
85
|
+
"memberCreationStatus_other": "Inviting {{taxonomies.member.plural}}",
|
|
87
86
|
"metaNameWithCount_one": "{{totalCount}} {{taxonomies.member.singular}}",
|
|
88
87
|
"metaNameWithCount_other": "{{totalCount}} {{taxonomies.member.plural}}",
|
|
89
88
|
"multipleProductInvitation": "{{- emails, boldList}} will be invited to the following neeto products with the role given next to it.",
|
|
89
|
+
"noRecords": "No records found",
|
|
90
90
|
"noRolesFound": "No roles found.",
|
|
91
|
+
"selectAll": "Select all {{count}} team members",
|
|
92
|
+
"selectedMembers": "All {{count}} team members on this page are selected",
|
|
91
93
|
"selectedMembersCount_one": "{{count}} {{taxonomies.member.singular}} selected of <span>{{totalCount}}</span>",
|
|
92
94
|
"selectedMembersCount_other": "{{count}} {{taxonomies.member.plural}} selected of <span>{{totalCount}}</span>",
|
|
93
95
|
"singleProductInvitation": "{{- emails, boldList}} will be invited to <strong>{{product, anyCase}}</strong> with a role of <strong>{{role, anyCase}}</strong>.",
|
|
94
|
-
"memberCreationStatus_one": "Inviting {{taxonomies.member.singular}}",
|
|
95
|
-
"memberCreationStatus_other": "Inviting {{taxonomies.member.plural}}",
|
|
96
96
|
"themeSelector": "Theme selector",
|
|
97
|
-
"whyIsItDisabled": "Why is it disabled?"
|
|
98
|
-
"emptyTable": "There are no {{entity}} to show",
|
|
99
|
-
"noRecords": "No records found",
|
|
100
|
-
"selectAll": "Select all {{count}} team members",
|
|
101
|
-
"selectedMembers": "All {{count}} team members on this page are selected"
|
|
97
|
+
"whyIsItDisabled": "Why is it disabled?"
|
|
102
98
|
},
|
|
103
99
|
"labels": {
|
|
104
100
|
"addNewRole": "Add new role",
|
|
105
101
|
"billingAndSubscriptions": "Billing and subscriptions",
|
|
106
102
|
"country": "Country",
|
|
107
103
|
"deleteRole": "Delete role?",
|
|
104
|
+
"deleteTitle": "Delete {{resource}}?",
|
|
105
|
+
"downloadAs": "Download as {{format, anyCase}}",
|
|
106
|
+
"downloads": {
|
|
107
|
+
"csv": "CSV",
|
|
108
|
+
"pdf": "PDF",
|
|
109
|
+
"xlsx": "Excel"
|
|
110
|
+
},
|
|
108
111
|
"editRole": "Edit role",
|
|
109
112
|
"firstName": "First name",
|
|
113
|
+
"groupName": "{{taxonomies.group.singular, anyCase}} name",
|
|
110
114
|
"lastName": "Last name",
|
|
111
115
|
"manageMember_one": "Manage member",
|
|
112
116
|
"manageMember_other": "Manage members",
|
|
@@ -115,114 +119,112 @@
|
|
|
115
119
|
"neeto_": "Neeto{{product, anyCase}}",
|
|
116
120
|
"preferredDateFormat": "Preferred date format",
|
|
117
121
|
"preferredTimeFormat": "Preferred time format",
|
|
122
|
+
"removeMember": "Remove {{member}}?",
|
|
118
123
|
"roleNotFound_one": "There are no role to show",
|
|
119
124
|
"roleNotFound_other": "There are no roles to show",
|
|
120
|
-
"upgradeToProPlan": "Upgrade the above added members to the PRO",
|
|
121
|
-
"deleteTitle": "Delete {{resource}}?",
|
|
122
|
-
"removeMember": "Remove {{member}}?",
|
|
123
125
|
"timeZone": "Time zone",
|
|
124
126
|
"totalMembers": "Total {{taxonomies.member.plural}}",
|
|
125
|
-
"
|
|
126
|
-
"downloadAs": "Download as {{format, anyCase}}",
|
|
127
|
-
"downloads": {
|
|
128
|
-
"pdf": "PDF",
|
|
129
|
-
"csv": "CSV",
|
|
130
|
-
"xlsx": "Excel"
|
|
131
|
-
}
|
|
127
|
+
"upgradeToProPlan": "Upgrade the above added members to the PRO"
|
|
132
128
|
},
|
|
133
129
|
"placeholders": {
|
|
134
130
|
"email": "Please enter the email addresses",
|
|
135
|
-
"enterName": "Please enter the name",
|
|
136
131
|
"enterDescription": "Please enter a description",
|
|
132
|
+
"enterName": "Please enter the name",
|
|
133
|
+
"search": "Search",
|
|
134
|
+
"searchEntity": "Search {{entity}}",
|
|
137
135
|
"searchPermission_one": "Search permission",
|
|
138
136
|
"searchPermission_other": "Search permissions",
|
|
139
137
|
"searchRole_one": "Search role",
|
|
140
|
-
"searchRole_other": "Search roles"
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
"searchRole_other": "Search roles"
|
|
139
|
+
},
|
|
140
|
+
"profile": {
|
|
141
|
+
"avatar": {
|
|
142
|
+
"changeProfilePicture": "Change profile picture",
|
|
143
|
+
"profilePicture": "Profile picture",
|
|
144
|
+
"profilePictureUploadMessage": "Only JPEG, PNG files are supported. Maximum allowed file size is <strong>{{limit}}MB</strong>.",
|
|
145
|
+
"uploadProfilePicture": "Upload profile picture"
|
|
146
|
+
},
|
|
147
|
+
"common": {
|
|
148
|
+
"ddmmyy": "DD/MM/YYYY",
|
|
149
|
+
"mmddyy": "MM/DD/YYYY",
|
|
150
|
+
"myProfile": "My Profile",
|
|
151
|
+
"neetoAuth": "NeetoAuth",
|
|
152
|
+
"timeZoneOption": "{{timeZone, anyCase}} - {{currentTime}}",
|
|
153
|
+
"toUpdateProfile": "To change your email, billing and subscription <button>visit NeetoAuth.</button>",
|
|
154
|
+
"yymmdd": "YYYY/MM/DD"
|
|
155
|
+
},
|
|
156
|
+
"file": {
|
|
157
|
+
"corrupted": "The submitted file was empty or corrupt. Please select a valid file.",
|
|
158
|
+
"invalidType": {
|
|
159
|
+
"image": "Invalid file type. Please select a JPG, JPEG, or PNG file instead and try again."
|
|
160
|
+
},
|
|
161
|
+
"limitExceeded": "File limit exceeded, maximum allowed size is {{maxSize}} MB. Please select a smaller file and try again."
|
|
162
|
+
},
|
|
163
|
+
"form": {
|
|
164
|
+
"dotsNotAllowed": "Dots are not allowed",
|
|
165
|
+
"invalidName": "Use only letters, numbers, spaces, commas, periods, apostrophes, and hyphens.",
|
|
166
|
+
"isRequired": {
|
|
167
|
+
"dateFormat": "Date format is required",
|
|
168
|
+
"firstName": "First name is required",
|
|
169
|
+
"lastName": "Last name is required"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"inputs": {
|
|
173
|
+
"label": {
|
|
174
|
+
"dateFormat": "Select preferred date format",
|
|
175
|
+
"firstName": "First name",
|
|
176
|
+
"lastName": "Last name",
|
|
177
|
+
"selectCountry": "Select country",
|
|
178
|
+
"selectTimeFormat": "Select preferred time format",
|
|
179
|
+
"selectTimeZone": "Select time zone"
|
|
180
|
+
},
|
|
181
|
+
"placeholder": {
|
|
182
|
+
"firstName": "First name",
|
|
183
|
+
"lastName": "Last name"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
143
186
|
},
|
|
144
187
|
"tooltips": {
|
|
145
188
|
"activateUserToEdit_one": "Please activate the user to edit their role.",
|
|
146
189
|
"activateUserToEdit_other": "Please activate the selected users to edit their role.",
|
|
147
190
|
"adminMustHaveAccess": "{{roleName}} permissions cannot be changed by anyone.",
|
|
148
191
|
"clickToViewPermissions": "Click to view the roles and their permissions.",
|
|
192
|
+
"goBackToChangeRole": "Please go back to change the role.",
|
|
193
|
+
"hostAppIsRequired": "This neeto product is required to continue.",
|
|
149
194
|
"noPermissionToAddMember": "Please ask the admin to permit you to add members.",
|
|
150
195
|
"noPermissionToAddRole": "Please ask the admin to permit you to add roles.",
|
|
151
196
|
"noPermissionToEditMembers": "Please ask the admin to permit you to edit members.",
|
|
152
197
|
"noPermissionToEditRoles": "Please ask the admin to permit you to edit roles.",
|
|
153
198
|
"noPermissionToRemoveRoles": "Please ask the admin to permit you to remove roles.",
|
|
154
|
-
"goBackToChangeRole": "Please go back to change the role.",
|
|
155
|
-
"hostAppIsRequired": "This neeto product is required to continue.",
|
|
156
199
|
"uncheckOnSelectPermissions": "If you select this permission, the following permissions will be unchecked: {{permissions}}"
|
|
157
200
|
},
|
|
158
201
|
"validations": {
|
|
202
|
+
"descriptionLimitExceeded": "You have exceeded the limit of {{limit}} characters for the description.",
|
|
159
203
|
"enterRoleName": "Please enter a valid role name.",
|
|
160
204
|
"filterInvalidEmails": "Click here to remove invalid emails.",
|
|
161
|
-
"
|
|
162
|
-
"
|
|
205
|
+
"max": "Field must be less than {{size}} characters",
|
|
206
|
+
"memberLimitExceeded": "Max {{limit}} team members are allowed. <emailTo>Contact us</emailTo> to increase the limit.",
|
|
163
207
|
"minOneEmail": "Please enter at least one email address.",
|
|
164
|
-
"
|
|
208
|
+
"nameLimitExceeded": "You have exceeded the limit of {{limit}} characters for the name.",
|
|
209
|
+
"noWhiteSpaces": "{{what, anyCase}} should not lead or end with white spaces",
|
|
165
210
|
"removeSpaces": "Please remove the spaces.",
|
|
166
|
-
"validEmail": "Please ensure that all email addresses are valid.",
|
|
167
|
-
"memberLimitExceeded": "Max {{limit}} team members are allowed. <emailTo>Contact us</emailTo> to increase the limit.",
|
|
168
211
|
"required": "{{what, anyCase}} is a required field",
|
|
169
|
-
"
|
|
170
|
-
"
|
|
212
|
+
"roleRequired": "Please select a role.",
|
|
213
|
+
"validEmail": "Please ensure that all email addresses are valid."
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"taxonomyDefaultLabels": {
|
|
217
|
+
"group": {
|
|
218
|
+
"plural": "Groups",
|
|
219
|
+
"singular": "Group"
|
|
171
220
|
},
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"selectedMembers_one": "Download selected {{taxonomies.member.singular}}",
|
|
176
|
-
"selectedMembers_other": "Download {{count}} selected {{taxonomies.member.plural}}",
|
|
177
|
-
"allMembers": "Download all {{taxonomies.member.plural}}"
|
|
178
|
-
}
|
|
221
|
+
"groupMember": {
|
|
222
|
+
"plural": "Members",
|
|
223
|
+
"singular": "Member"
|
|
179
224
|
},
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
-
|
|
183
|
-
"mmddyy": "MM/DD/YYYY",
|
|
184
|
-
"ddmmyy": "DD/MM/YYYY",
|
|
185
|
-
"yymmdd": "YYYY/MM/DD",
|
|
186
|
-
"timeZoneOption": "{{timeZone, anyCase}} - {{currentTime}}",
|
|
187
|
-
"toUpdateProfile": "To change your email, billing and subscription <button>visit NeetoAuth.</button>",
|
|
188
|
-
"neetoAuth": "NeetoAuth"
|
|
189
|
-
},
|
|
190
|
-
"inputs": {
|
|
191
|
-
"label": {
|
|
192
|
-
"firstName": "First name",
|
|
193
|
-
"lastName": "Last name",
|
|
194
|
-
"selectCountry": "Select country",
|
|
195
|
-
"selectTimeZone": "Select time zone",
|
|
196
|
-
"dateFormat": "Select preferred date format",
|
|
197
|
-
"selectTimeFormat": "Select preferred time format"
|
|
198
|
-
},
|
|
199
|
-
"placeholder": {
|
|
200
|
-
"firstName": "First name",
|
|
201
|
-
"lastName": "Last name"
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
"avatar": {
|
|
205
|
-
"profilePicture": "Profile picture",
|
|
206
|
-
"profilePictureUploadMessage": "Only JPEG, PNG files are supported. Maximum allowed file size is <strong>{{limit}}MB</strong>.",
|
|
207
|
-
"changeProfilePicture": "Change profile picture",
|
|
208
|
-
"uploadProfilePicture": "Upload profile picture"
|
|
209
|
-
},
|
|
210
|
-
"file": {
|
|
211
|
-
"invalidType": {
|
|
212
|
-
"image": "Invalid file type. Please select a JPG, JPEG, or PNG file instead and try again."
|
|
213
|
-
},
|
|
214
|
-
"corrupted": "The submitted file was empty or corrupt. Please select a valid file.",
|
|
215
|
-
"limitExceeded": "File limit exceeded, maximum allowed size is {{maxSize}} MB. Please select a smaller file and try again."
|
|
216
|
-
},
|
|
217
|
-
"form": {
|
|
218
|
-
"isRequired": {
|
|
219
|
-
"firstName": "First name is required",
|
|
220
|
-
"lastName": "Last name is required",
|
|
221
|
-
"dateFormat": "Date format is required"
|
|
222
|
-
},
|
|
223
|
-
"invalidName": "Use only letters, numbers, spaces, commas, periods, apostrophes, and hyphens.",
|
|
224
|
-
"dotsNotAllowed": "Dots are not allowed"
|
|
225
|
-
}
|
|
225
|
+
"member": {
|
|
226
|
+
"plural": "Team members",
|
|
227
|
+
"singular": "Team member"
|
|
226
228
|
}
|
|
227
229
|
},
|
|
228
230
|
"toastr": {
|
package/dist/Profile.js
CHANGED
|
@@ -11,7 +11,7 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
|
11
11
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
12
12
|
import { useProfileImageUpload } from '@bigbinary/neeto-image-uploader-frontend/hooks';
|
|
13
13
|
import { NeetoTimezoneSelector, ianaTimezoneToHumanReadable } from '@bigbinary/neeto-time-zones';
|
|
14
|
-
import { findById, findBy, noop, isNotEmpty,
|
|
14
|
+
import { findById, findBy, noop, isNotEmpty, _findBy } from '@bigbinary/neeto-cist';
|
|
15
15
|
import Label from '@bigbinary/neetoui/Label';
|
|
16
16
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
17
17
|
import Toastr from '@bigbinary/neetoui/Toastr';
|
|
@@ -19,7 +19,7 @@ import Input from '@bigbinary/neetoui/formik/Input';
|
|
|
19
19
|
import Select from '@bigbinary/neetoui/formik/Select';
|
|
20
20
|
import Form from '@bigbinary/neetoui/formik/Form';
|
|
21
21
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
22
|
-
import { isNotNil } from 'ramda';
|
|
22
|
+
import { isNotNil, isNil, is, trim } from 'ramda';
|
|
23
23
|
import { B as BASE_URL, Q as QUERY_KEYS, T as TIME_FORMAT_OPTIONS, D as DATE_FORMAT_OPTIONS } from './constants-BdTiHt55.js';
|
|
24
24
|
import { useQuery } from '@tanstack/react-query';
|
|
25
25
|
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
@@ -550,8 +550,12 @@ var useProfileUpdatePaneState = function useProfileUpdatePaneState() {
|
|
|
550
550
|
}, shallow);
|
|
551
551
|
};
|
|
552
552
|
|
|
553
|
+
var sanitizeValue = function sanitizeValue(value, defaultValue) {
|
|
554
|
+
return isNil(value) || is(String, value) && trim(value) === "" ? defaultValue : value;
|
|
555
|
+
};
|
|
556
|
+
|
|
553
557
|
var Preview = function Preview(_ref) {
|
|
554
|
-
var
|
|
558
|
+
var _globalProps$user, _findBy2, _findBy3;
|
|
555
559
|
var _ref$preferredDateFor = _ref.preferredDateFormat,
|
|
556
560
|
preferredDateFormat = _ref$preferredDateFor === void 0 ? {} : _ref$preferredDateFor,
|
|
557
561
|
_ref$preferredTimeFor = _ref.preferredTimeFormat,
|
|
@@ -560,51 +564,39 @@ var Preview = function Preview(_ref) {
|
|
|
560
564
|
preferredTimeZone = _ref$preferredTimeZon === void 0 ? {} : _ref$preferredTimeZon;
|
|
561
565
|
var _useTranslation = useTranslation(),
|
|
562
566
|
t = _useTranslation.t;
|
|
563
|
-
var _useState = useState(""),
|
|
564
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
565
|
-
time = _useState2[0],
|
|
566
|
-
setTime = _useState2[1];
|
|
567
567
|
var _useFetchProfile = useFetchProfile(),
|
|
568
568
|
_useFetchProfile$data = _useFetchProfile.data,
|
|
569
569
|
_useFetchProfile$data2 = _useFetchProfile$data === void 0 ? {} : _useFetchProfile$data,
|
|
570
570
|
_useFetchProfile$data3 = _useFetchProfile$data2.user,
|
|
571
571
|
user = _useFetchProfile$data3 === void 0 ? {} : _useFetchProfile$data3,
|
|
572
572
|
isFetchingUserDetails = _useFetchProfile.isFetching;
|
|
573
|
-
var
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
573
|
+
var sanitizedUser = {
|
|
574
|
+
countryName: sanitizeValue(user.countryName, "-"),
|
|
575
|
+
dateFormat: sanitizeValue(user.dateFormat, ""),
|
|
576
|
+
email: sanitizeValue(user.email, "-"),
|
|
577
|
+
firstName: sanitizeValue(user.firstName, "-"),
|
|
578
|
+
lastName: sanitizeValue(user.lastName, "-"),
|
|
579
|
+
profileImageUrl: sanitizeValue(user.profileImageUrl, ""),
|
|
580
|
+
timeFormat: sanitizeValue(user.timeFormat, ""),
|
|
581
|
+
timeZone: sanitizeValue(user.timeZone, "Etc/UTC")
|
|
582
|
+
};
|
|
583
|
+
var countryName = sanitizedUser.countryName,
|
|
584
|
+
dateFormat = sanitizedUser.dateFormat,
|
|
585
|
+
email = sanitizedUser.email,
|
|
586
|
+
firstName = sanitizedUser.firstName,
|
|
587
|
+
lastName = sanitizedUser.lastName,
|
|
588
|
+
profileImageUrl = sanitizedUser.profileImageUrl,
|
|
589
|
+
timeFormat = sanitizedUser.timeFormat,
|
|
590
|
+
timeZone = sanitizedUser.timeZone;
|
|
589
591
|
var name = "".concat(firstName, " ").concat(lastName).trim();
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
};
|
|
599
|
-
var formattedTime = new Intl.DateTimeFormat("en-US", options).format(now);
|
|
600
|
-
setTime(formattedTime);
|
|
601
|
-
};
|
|
602
|
-
var interval = setInterval(updateTime, 1000);
|
|
603
|
-
return function () {
|
|
604
|
-
return clearInterval(interval);
|
|
605
|
-
};
|
|
606
|
-
}, [timeZone]);
|
|
607
|
-
if (!time || isFetchingUserDetails) {
|
|
592
|
+
var subscription = sanitizeValue((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.subscriptionPlan, t("neetoTeamMembers.common.free"));
|
|
593
|
+
var time = new Intl.DateTimeFormat("en-US", {
|
|
594
|
+
timeZone: timeZone,
|
|
595
|
+
hour: "2-digit",
|
|
596
|
+
minute: "2-digit",
|
|
597
|
+
hour12: (timeFormat || TIME_FORMAT_OPTIONS[0].value) === "12h"
|
|
598
|
+
}).format(new Date());
|
|
599
|
+
if (isFetchingUserDetails) {
|
|
608
600
|
return /*#__PURE__*/jsx("div", {
|
|
609
601
|
className: "flex h-full w-full items-center justify-center",
|
|
610
602
|
children: /*#__PURE__*/jsx(Spinner, {})
|
|
@@ -669,7 +661,7 @@ var Preview = function Preview(_ref) {
|
|
|
669
661
|
}), /*#__PURE__*/jsx(Typography, {
|
|
670
662
|
className: "neeto-ui-text-gray-600",
|
|
671
663
|
style: "body2",
|
|
672
|
-
children: countryName
|
|
664
|
+
children: countryName
|
|
673
665
|
})]
|
|
674
666
|
}), /*#__PURE__*/jsxs("div", {
|
|
675
667
|
className: "flex flex-col gap-1",
|
|
@@ -693,9 +685,9 @@ var Preview = function Preview(_ref) {
|
|
|
693
685
|
}), /*#__PURE__*/jsx(Typography, {
|
|
694
686
|
className: "neeto-ui-text-gray-600",
|
|
695
687
|
style: "body2",
|
|
696
|
-
children: ((
|
|
688
|
+
children: ((_findBy2 = _findBy({
|
|
697
689
|
value: timeFormat
|
|
698
|
-
}, TIME_FORMAT_OPTIONS)) === null ||
|
|
690
|
+
}, TIME_FORMAT_OPTIONS)) === null || _findBy2 === void 0 ? void 0 : _findBy2.label) || "-"
|
|
699
691
|
})]
|
|
700
692
|
}), /*#__PURE__*/jsxs("div", {
|
|
701
693
|
className: "flex flex-col gap-1",
|
|
@@ -707,9 +699,9 @@ var Preview = function Preview(_ref) {
|
|
|
707
699
|
}), /*#__PURE__*/jsx(Typography, {
|
|
708
700
|
className: "neeto-ui-text-gray-600",
|
|
709
701
|
style: "body2",
|
|
710
|
-
children: ((
|
|
702
|
+
children: ((_findBy3 = _findBy({
|
|
711
703
|
value: dateFormat
|
|
712
|
-
}, DATE_FORMAT_OPTIONS)) === null ||
|
|
704
|
+
}, DATE_FORMAT_OPTIONS)) === null || _findBy3 === void 0 ? void 0 : _findBy3.label) || "-"
|
|
713
705
|
})]
|
|
714
706
|
})]
|
|
715
707
|
}), /*#__PURE__*/jsx("div", {
|
|
@@ -719,12 +711,12 @@ var Preview = function Preview(_ref) {
|
|
|
719
711
|
children: [/*#__PURE__*/jsx(Label, {
|
|
720
712
|
children: t("neetoTeamMembers.labels.billingAndSubscriptions")
|
|
721
713
|
}), /*#__PURE__*/jsx(Typography, {
|
|
722
|
-
className: "neeto-ui-text-gray-700",
|
|
714
|
+
className: "neeto-ui-text-gray-700 first-letter:uppercase",
|
|
723
715
|
style: "body2",
|
|
724
716
|
children: /*#__PURE__*/jsx(Trans, {
|
|
725
717
|
i18nKey: "neetoTeamMembers.common.subscriptionType",
|
|
726
718
|
values: {
|
|
727
|
-
subscription:
|
|
719
|
+
subscription: subscription
|
|
728
720
|
}
|
|
729
721
|
})
|
|
730
722
|
})]
|