ui-soxo-bootstrap-core 2.6.1-dev.3 → 2.6.1-dev.31

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.
Files changed (68) hide show
  1. package/core/components/extra-info/extra-info-details.js +2 -2
  2. package/core/components/index.js +2 -11
  3. package/core/components/landing-api/landing-api.js +216 -18
  4. package/core/components/landing-api/landing-api.scss +22 -0
  5. package/core/components/license-management/license-alert.js +97 -0
  6. package/core/lib/Store.js +8 -4
  7. package/core/lib/components/global-header/global-header.js +217 -242
  8. package/core/lib/components/index.js +2 -2
  9. package/core/lib/components/sidemenu/sidemenu.js +19 -13
  10. package/core/lib/components/sidemenu/sidemenu.scss +1 -1
  11. package/core/lib/elements/basic/country-phone-input/country-phone-input.js +14 -9
  12. package/core/lib/elements/basic/dragabble-wrapper/draggable-wrapper.js +1 -1
  13. package/core/lib/elements/basic/menu-tree/menu-tree.js +26 -13
  14. package/core/lib/models/forms/components/form-creator/form-creator.js +525 -468
  15. package/core/lib/models/forms/components/form-creator/form-creator.scss +30 -26
  16. package/core/lib/models/menus/components/menu-list/menu-list.js +424 -467
  17. package/core/lib/models/process/components/process-dashboard/process-dashboard.js +469 -3
  18. package/core/lib/models/process/components/process-dashboard/process-dashboard.scss +4 -0
  19. package/core/lib/modules/generic/generic-list/ExportReactCSV.js +28 -2
  20. package/core/lib/pages/change-password/change-password.js +17 -24
  21. package/core/lib/pages/change-password/change-password.scss +45 -48
  22. package/core/lib/pages/login/commnication-mode-selection.js +2 -2
  23. package/core/lib/pages/login/login.js +53 -64
  24. package/core/lib/pages/login/login.scss +9 -0
  25. package/core/lib/pages/login/reset-password.js +17 -17
  26. package/core/lib/pages/login/reset-password.scss +10 -1
  27. package/core/lib/pages/profile/themes.json +4 -4
  28. package/core/lib/utils/api/api.utils.js +53 -45
  29. package/core/lib/utils/common/common.utils.js +49 -35
  30. package/core/lib/utils/generic/generic.utils.js +2 -1
  31. package/core/lib/utils/http/http.utils.js +33 -4
  32. package/core/lib/utils/index.js +4 -1
  33. package/core/models/base/base.js +7 -3
  34. package/core/models/core-scripts/core-scripts.js +147 -126
  35. package/core/models/doctor/components/doctor-add/doctor-add.js +9 -4
  36. package/core/models/menus/components/menu-add/menu-add.js +1 -1
  37. package/core/models/menus/components/menu-lists/menu-lists.js +53 -54
  38. package/core/models/menus/menus.js +49 -2
  39. package/core/models/roles/components/role-add/role-add.js +92 -59
  40. package/core/models/roles/components/role-list/role-list.js +1 -1
  41. package/core/models/staff/components/staff-add/staff-add.js +20 -32
  42. package/core/models/users/components/assign-role/assign-role.js +145 -50
  43. package/core/models/users/components/assign-role/assign-role.scss +209 -45
  44. package/core/models/users/components/assign-role/avatar-props.js +45 -0
  45. package/core/models/users/components/user-add/user-add.js +46 -55
  46. package/core/models/users/components/user-add/user-edit.js +25 -4
  47. package/core/models/users/users.js +9 -1
  48. package/core/modules/dashboard/components/dashboard-card/menu-dashboard-card.js +1 -1
  49. package/core/modules/reporting/components/reporting-dashboard/README.md +316 -0
  50. package/core/modules/reporting/components/reporting-dashboard/adavance-search/advance-search.js +174 -0
  51. package/core/modules/reporting/components/reporting-dashboard/adavance-search/advance-search.scss +76 -0
  52. package/core/modules/reporting/components/reporting-dashboard/display-columns/build-display-columns.js +90 -0
  53. package/core/modules/reporting/components/reporting-dashboard/display-columns/build-display-columns.test.js +74 -0
  54. package/core/modules/reporting/components/reporting-dashboard/display-columns/display-cell-renderer.js +448 -0
  55. package/core/modules/reporting/components/reporting-dashboard/display-columns/display-cell-renderer.test.js +199 -0
  56. package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +195 -822
  57. package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.scss +43 -0
  58. package/core/modules/reporting/components/reporting-dashboard/reporting-table.js +517 -0
  59. package/core/modules/steps/action-buttons.js +30 -16
  60. package/core/modules/steps/action-buttons.scss +55 -9
  61. package/core/modules/steps/chat-assistant.js +141 -0
  62. package/core/modules/steps/openai-realtime.js +275 -0
  63. package/core/modules/steps/readme.md +167 -0
  64. package/core/modules/steps/steps.js +1286 -60
  65. package/core/modules/steps/steps.scss +703 -86
  66. package/core/modules/steps/timeline.js +21 -19
  67. package/core/modules/steps/voice-navigation.js +709 -0
  68. package/package.json +2 -1
@@ -14,7 +14,7 @@
14
14
  */
15
15
 
16
16
 
17
- import React, { useState, useEffect, useContext } from 'react';
17
+ import React, { useState, useEffect, useContext, useRef } from 'react';
18
18
 
19
19
  import { Timeline, Card, Skeleton, Button, Modal, Typography, Form, Select, message, Tag } from 'antd';
20
20
 
@@ -28,7 +28,7 @@ import TaskStatus from './../task-status/task-status';
28
28
 
29
29
  import DateUtils from '../../../../utils/date/date.utils';
30
30
 
31
- import { ClockCircleOutlined, CopyOutlined, CheckCircleOutlined, LoadingOutlined, EditOutlined, ReloadOutlined } from '@ant-design/icons';
31
+ import { ClockCircleOutlined, CopyOutlined, CheckCircleOutlined, LoadingOutlined, EditOutlined, ReloadOutlined, SoundOutlined, PauseCircleOutlined } from '@ant-design/icons';
32
32
 
33
33
  import { CopyToClipBoard } from '../../../..';
34
34
 
@@ -59,6 +59,340 @@ let stepMaster = {
59
59
 
60
60
  }
61
61
 
62
+ const GEMINI_TTS_MODEL =
63
+ process.env.GEMINI_TTS_MODEL || process.env.REACT_APP_GEMINI_TTS_MODEL || 'gemini-2.5-flash-preview-tts';
64
+ const GEMINI_TTS_VOICE = process.env.GEMINI_TTS_VOICE || process.env.REACT_APP_GEMINI_TTS_VOICE || 'Kore';
65
+ const GEMINI_TTS_API_BASE_URL =
66
+ process.env.GEMINI_API_BASE_URL || process.env.REACT_APP_GEMINI_API_BASE_URL || 'https://generativelanguage.googleapis.com/v1beta';
67
+ const ELEVENLABS_TTS_API_BASE_URL =
68
+ process.env.ELEVENLABS_TTS_API_BASE_URL ||
69
+ process.env.REACT_APP_ELEVENLABS_TTS_API_BASE_URL ||
70
+ 'https://api.elevenlabs.io/v1/text-to-speech';
71
+ const ELEVENLABS_MODEL_ID =
72
+ process.env.ELEVENLABS_MODEL_ID || process.env.REACT_APP_ELEVENLABS_MODEL_ID || 'eleven_multilingual_v2';
73
+ const ELEVENLABS_OUTPUT_FORMAT =
74
+ process.env.ELEVENLABS_OUTPUT_FORMAT || process.env.REACT_APP_ELEVENLABS_OUTPUT_FORMAT || 'mp3_44100_128';
75
+ const DEFAULT_ELEVENLABS_VOICE_ID =
76
+ process.env.ELEVENLABS_VOICE_ID ||
77
+ process.env.ELEVEN_LABS_VOICE_ID ||
78
+ process.env.REACT_APP_ELEVENLABS_VOICE_ID ||
79
+ '21m00Tcm4TlvDq8ikWAM';
80
+
81
+ function getFromStorage(storageKey) {
82
+
83
+ if (typeof window === 'undefined' || !window.localStorage) {
84
+ return null;
85
+ }
86
+
87
+ try {
88
+ return window.localStorage.getItem(storageKey);
89
+ } catch (error) {
90
+ return null;
91
+ }
92
+ }
93
+
94
+ function getGeminiApiKey() {
95
+
96
+ if (process.env.GEMINI_API_KEY) {
97
+ return process.env.GEMINI_API_KEY;
98
+ }
99
+
100
+ if (process.env.REACT_APP_GEMINI_API_KEY) {
101
+ return process.env.REACT_APP_GEMINI_API_KEY;
102
+ }
103
+
104
+ if (typeof window !== 'undefined') {
105
+ try {
106
+ if (window.localStorage) {
107
+ return window.localStorage.getItem('gemini_api_key');
108
+ }
109
+ } catch (error) {
110
+ return null;
111
+ }
112
+ }
113
+
114
+ return null;
115
+ }
116
+
117
+ function getElevenLabsApiKey() {
118
+ return (
119
+ process.env.ELEVEN_LABS_KEY ||
120
+ process.env.ELEVENLABS_API_KEY ||
121
+ process.env.REACT_APP_ELEVEN_LABS_KEY ||
122
+ process.env.REACT_APP_ELEVENLABS_API_KEY ||
123
+ getFromStorage('eleven_labs_key') ||
124
+ getFromStorage('elevenlabs_api_key') ||
125
+ getFromStorage('ELEVEN_LABS_KEY') ||
126
+ getFromStorage('REACT_APP_ELEVEN_LABS_KEY') ||
127
+ getFromStorage('REACT_APP_ELEVENLABS_API_KEY')
128
+ );
129
+ }
130
+
131
+ function getStepNarration({ step, step_transactions }) {
132
+
133
+ if (!step) {
134
+ return 'Step details are not available.';
135
+ }
136
+
137
+ const chunks = [];
138
+
139
+ chunks.push(`Step ${step.name || 'Unnamed step'}.`);
140
+
141
+ if (step.description) {
142
+ chunks.push(step.description);
143
+ }
144
+
145
+ const currentState = step.current_state || 'pending';
146
+
147
+ chunks.push(`Current status is ${currentState}.`);
148
+
149
+ if (step.roles && step.roles.length) {
150
+ const roleNames = step.roles.map((role) => role && role.name).filter(Boolean);
151
+
152
+ if (roleNames.length) {
153
+ chunks.push(`Pending with ${roleNames.join(', ')}.`);
154
+ }
155
+ }
156
+
157
+ if (step_transactions && step_transactions.start_time) {
158
+ const startTime = DateUtils.displayFirestoreTime(step_transactions.start_time);
159
+
160
+ if (startTime) {
161
+ chunks.push(`Started at ${startTime}.`);
162
+ }
163
+ }
164
+
165
+ if (step_transactions && step_transactions.completed && step_transactions.end_time) {
166
+ const endTime = DateUtils.displayFirestoreTime(step_transactions.end_time);
167
+
168
+ if (endTime) {
169
+ chunks.push(`Completed at ${endTime}.`);
170
+ }
171
+ }
172
+
173
+ return chunks.join(' ');
174
+ }
175
+
176
+ function extractGeminiAudio(payload) {
177
+ const candidates = payload && payload.candidates ? payload.candidates : [];
178
+
179
+ for (const candidate of candidates) {
180
+ const parts = candidate && candidate.content && candidate.content.parts ? candidate.content.parts : [];
181
+
182
+ for (const part of parts) {
183
+ const inlineData = part.inlineData || part.inline_data || part.audio;
184
+
185
+ if (inlineData && inlineData.data) {
186
+ return {
187
+ mimeType: inlineData.mimeType || inlineData.mime_type || 'audio/wav',
188
+ data: inlineData.data
189
+ };
190
+ }
191
+ }
192
+ }
193
+
194
+ return null;
195
+ }
196
+
197
+ async function synthesizeGeminiAudio(text) {
198
+
199
+ const apiKey = getGeminiApiKey();
200
+
201
+ if (!apiKey) {
202
+ throw new Error('Gemini API key is missing');
203
+ }
204
+
205
+ const endpoint = `${GEMINI_TTS_API_BASE_URL}/models/${GEMINI_TTS_MODEL}:generateContent?key=${apiKey}`;
206
+
207
+ const response = await fetch(endpoint, {
208
+ method: 'POST',
209
+ headers: {
210
+ 'Content-Type': 'application/json'
211
+ },
212
+ body: JSON.stringify({
213
+ contents: [{
214
+ role: 'user',
215
+ parts: [{ text }]
216
+ }],
217
+ generationConfig: {
218
+ responseModalities: ['AUDIO'],
219
+ speechConfig: {
220
+ voiceConfig: {
221
+ prebuiltVoiceConfig: {
222
+ voiceName: GEMINI_TTS_VOICE
223
+ }
224
+ }
225
+ }
226
+ }
227
+ })
228
+ });
229
+
230
+ if (!response.ok) {
231
+ throw new Error(`Gemini TTS request failed with status ${response.status}`);
232
+ }
233
+
234
+ const payload = await response.json();
235
+
236
+ const audio = extractGeminiAudio(payload);
237
+
238
+ if (!audio || !audio.data) {
239
+ throw new Error('Gemini did not return audio data');
240
+ }
241
+
242
+ return `data:${audio.mimeType};base64,${audio.data}`;
243
+ }
244
+
245
+ async function synthesizeElevenLabsAudio(text) {
246
+
247
+ const apiKey = getElevenLabsApiKey();
248
+
249
+ if (!apiKey) {
250
+ throw new Error('ElevenLabs API key is missing');
251
+ }
252
+
253
+ const endpoint = `${ELEVENLABS_TTS_API_BASE_URL}/${encodeURIComponent(DEFAULT_ELEVENLABS_VOICE_ID)}/stream?output_format=${encodeURIComponent(
254
+ ELEVENLABS_OUTPUT_FORMAT
255
+ )}`;
256
+
257
+ const response = await fetch(endpoint, {
258
+ method: 'POST',
259
+ headers: {
260
+ 'Content-Type': 'application/json',
261
+ Accept: 'audio/mpeg',
262
+ 'xi-api-key': apiKey
263
+ },
264
+ body: JSON.stringify({
265
+ text,
266
+ model_id: ELEVENLABS_MODEL_ID
267
+ })
268
+ });
269
+
270
+ if (!response.ok) {
271
+ throw new Error(`ElevenLabs TTS request failed with status ${response.status}`);
272
+ }
273
+
274
+ return response.blob();
275
+ }
276
+
277
+ function playAudioDataUri(dataUri, audioReference) {
278
+ return new Promise((resolve, reject) => {
279
+ const audio = new Audio(dataUri);
280
+
281
+ audioReference.current = audio;
282
+
283
+ const clean = () => {
284
+ if (audioReference.current === audio) {
285
+ audioReference.current = null;
286
+ }
287
+ };
288
+
289
+ audio.onended = () => {
290
+ clean();
291
+ resolve();
292
+ };
293
+
294
+ audio.onpause = () => {
295
+ clean();
296
+ resolve();
297
+ };
298
+
299
+ audio.onerror = () => {
300
+ clean();
301
+ reject(new Error('Audio playback failed'));
302
+ };
303
+
304
+ audio.play().catch((error) => {
305
+ clean();
306
+ reject(error);
307
+ });
308
+ });
309
+ }
310
+
311
+ function playAudioBlob(audioBlob, audioReference, audioUrlReference) {
312
+ return new Promise((resolve, reject) => {
313
+ if (typeof window === 'undefined' || !window.Audio || !window.URL) {
314
+ reject(new Error('Audio playback is not available'));
315
+ return;
316
+ }
317
+
318
+ if (audioUrlReference.current) {
319
+ window.URL.revokeObjectURL(audioUrlReference.current);
320
+ audioUrlReference.current = null;
321
+ }
322
+
323
+ const audioUrl = window.URL.createObjectURL(audioBlob);
324
+ const audio = new Audio(audioUrl);
325
+
326
+ audioReference.current = audio;
327
+ audioUrlReference.current = audioUrl;
328
+
329
+ const clean = () => {
330
+ if (audioReference.current === audio) {
331
+ audioReference.current = null;
332
+ }
333
+
334
+ if (audioUrlReference.current === audioUrl) {
335
+ window.URL.revokeObjectURL(audioUrl);
336
+ audioUrlReference.current = null;
337
+ }
338
+ };
339
+
340
+ audio.onended = () => {
341
+ clean();
342
+ resolve();
343
+ };
344
+
345
+ audio.onpause = () => {
346
+ clean();
347
+ resolve();
348
+ };
349
+
350
+ audio.onerror = () => {
351
+ clean();
352
+ reject(new Error('Audio playback failed'));
353
+ };
354
+
355
+ audio.play().catch((error) => {
356
+ clean();
357
+ reject(error);
358
+ });
359
+ });
360
+ }
361
+
362
+ function speakWithBrowser(text, speechReference) {
363
+ return new Promise((resolve, reject) => {
364
+ if (typeof window === 'undefined' || !window.speechSynthesis || !window.SpeechSynthesisUtterance) {
365
+ reject(new Error('Speech synthesis is not available'));
366
+ return;
367
+ }
368
+
369
+ const utterance = new window.SpeechSynthesisUtterance(text);
370
+
371
+ utterance.lang = process.env.REACT_APP_TTS_LANG || 'en-US';
372
+
373
+ speechReference.current = utterance;
374
+
375
+ utterance.onend = () => {
376
+ if (speechReference.current === utterance) {
377
+ speechReference.current = null;
378
+ }
379
+
380
+ resolve();
381
+ };
382
+
383
+ utterance.onerror = () => {
384
+ if (speechReference.current === utterance) {
385
+ speechReference.current = null;
386
+ }
387
+
388
+ reject(new Error('Browser narration failed'));
389
+ };
390
+
391
+ window.speechSynthesis.cancel();
392
+ window.speechSynthesis.speak(utterance);
393
+ });
394
+ }
395
+
62
396
  /**
63
397
  *
64
398
  */
@@ -257,8 +591,125 @@ function StepTimelineItem({ id, color, Icon, step, step_transactions, callback }
257
591
 
258
592
  const [loading, setLoading] = useState(false);
259
593
 
594
+ const [narrating, setNarrating] = useState(false);
595
+
260
596
  const { user = { locations: [] } } = useContext(GlobalContext);
261
597
 
598
+ const audioReference = useRef(null);
599
+
600
+ const audioUrlReference = useRef(null);
601
+
602
+ const speechReference = useRef(null);
603
+
604
+ const narrationSessionReference = useRef(0);
605
+
606
+ const fallbackNoticeShownReference = useRef(false);
607
+
608
+ useEffect(() => {
609
+ return () => {
610
+ stopNarration();
611
+ }
612
+ }, [])
613
+
614
+ /**
615
+ * Stop active narration audio
616
+ */
617
+ function stopNarration() {
618
+ narrationSessionReference.current += 1;
619
+
620
+ if (audioReference.current) {
621
+ audioReference.current.pause();
622
+ audioReference.current.src = '';
623
+ audioReference.current = null;
624
+ }
625
+
626
+ if (audioUrlReference.current && typeof window !== 'undefined' && window.URL) {
627
+ window.URL.revokeObjectURL(audioUrlReference.current);
628
+ audioUrlReference.current = null;
629
+ }
630
+
631
+ if (typeof window !== 'undefined' && window.speechSynthesis) {
632
+ window.speechSynthesis.cancel();
633
+ }
634
+
635
+ speechReference.current = null;
636
+ setNarrating(false);
637
+ }
638
+
639
+ /**
640
+ * Narrate the current step with ElevenLabs/Gemini TTS only (no browser fallback).
641
+ */
642
+ async function narrateStep() {
643
+ const narration = getStepNarration({ step, step_transactions });
644
+
645
+ if (!narration) {
646
+ message.warning('Narration text is not available for this step.');
647
+ return;
648
+ }
649
+
650
+ stopNarration();
651
+
652
+ const sessionId = narrationSessionReference.current;
653
+ const hasElevenLabsKey = Boolean(getElevenLabsApiKey());
654
+
655
+ setNarrating(true);
656
+
657
+ try {
658
+ let aiNarrationComplete = false;
659
+ let aiNarrationError = null;
660
+
661
+ if (hasElevenLabsKey) {
662
+ try {
663
+ const audioBlob = await synthesizeElevenLabsAudio(narration);
664
+
665
+ if (sessionId !== narrationSessionReference.current) {
666
+ return;
667
+ }
668
+
669
+ await playAudioBlob(audioBlob, audioReference, audioUrlReference);
670
+ aiNarrationComplete = true;
671
+ } catch (elevenLabsError) {
672
+ aiNarrationError = elevenLabsError;
673
+ }
674
+ }
675
+
676
+ if (!aiNarrationComplete) {
677
+ try {
678
+ const dataUri = await synthesizeGeminiAudio(narration);
679
+
680
+ if (sessionId !== narrationSessionReference.current) {
681
+ return;
682
+ }
683
+
684
+ await playAudioDataUri(dataUri, audioReference);
685
+ aiNarrationComplete = true;
686
+ } catch (geminiError) {
687
+ aiNarrationError = geminiError;
688
+ }
689
+ }
690
+
691
+ if (!aiNarrationComplete) {
692
+ throw aiNarrationError || new Error('AI narration unavailable');
693
+ }
694
+
695
+ } catch (error) {
696
+ if (sessionId !== narrationSessionReference.current) {
697
+ return;
698
+ }
699
+
700
+ if (!fallbackNoticeShownReference.current) {
701
+ message.warning(`${hasElevenLabsKey ? 'ElevenLabs/Gemini' : 'Gemini'} narration unavailable.`);
702
+ fallbackNoticeShownReference.current = true;
703
+ }
704
+
705
+ message.error(error?.message || 'Unable to play narration for this step.');
706
+ } finally {
707
+ if (sessionId === narrationSessionReference.current) {
708
+ setNarrating(false);
709
+ }
710
+ }
711
+ }
712
+
262
713
  /**
263
714
  * Function to open editModal for Step
264
715
  *
@@ -347,6 +798,21 @@ function StepTimelineItem({ id, color, Icon, step, step_transactions, callback }
347
798
  {/* Actions for a step */}
348
799
  <div className="actions">
349
800
 
801
+ <Button size={'small'} onClick={() => {
802
+ if (narrating) {
803
+ stopNarration();
804
+ return;
805
+ }
806
+
807
+ narrateStep();
808
+ }}>
809
+
810
+ {narrating ? <PauseCircleOutlined /> : <SoundOutlined />}
811
+
812
+ {narrating ? 'Stop Narration' : 'Narrate'}
813
+
814
+ </Button>
815
+
350
816
  {user.isAdmin && <>
351
817
 
352
818
  <CopyToClipBoard record={step} id={step.id} />
@@ -599,4 +1065,4 @@ function RevertProcessTransaction({ id, process = [], callback }) {
599
1065
  </Form>
600
1066
  </>)
601
1067
 
602
- }
1068
+ }
@@ -42,6 +42,10 @@
42
42
  }
43
43
 
44
44
  .actions {
45
+ display: flex;
46
+ gap: 6px;
47
+ align-items: center;
48
+ flex-wrap: wrap;
45
49
  }
46
50
  }
47
51
 
@@ -10,6 +10,8 @@
10
10
  import React from 'react';
11
11
  // Import XLSX library to handle Excel file creation
12
12
  import * as XLSX from 'xlsx';
13
+ // import * as XLSX from 'xlsx-js-style';
14
+ // import * as XLSX from 'xlsx-js-style';
13
15
  // Import saveAs from file-saver to trigger file download in browser
14
16
  import { saveAs } from 'file-saver';
15
17
  import { Button } from 'antd';
@@ -30,7 +32,27 @@ export const ExportReactCSV = ({ csvData, headers, fileName,title }) => {
30
32
  // Extract label names for the header row
31
33
  const headerLabels = headers.map((h) => h.label);
32
34
  // Map data rows according to the headers' key order
33
- const rows = csvData.map((row) => headers.map((h) => row[h.key]));
35
+ const rows = csvData.map((row) =>
36
+ headers.map((h, hIndex) => {
37
+ let value = row[h.key];
38
+ // If it's a summary row, return a cell object with bold styling
39
+ if (row.isSummaryRow) {
40
+ // Remove the index value (typically the first column) for the summary row
41
+ if (hIndex === 0) value = "";
42
+
43
+ return {
44
+ v: value,
45
+ s: {
46
+ font: { bold: true },
47
+ // "Thick" visual indicator via border
48
+ // Visual indicator via border
49
+ border: { bottom: { style: "thick", color: { rgb: "000000" } } }
50
+ }
51
+ };
52
+ }
53
+ return value;
54
+ })
55
+ );
34
56
  // Create a worksheet from an array of arrays (header + rows)
35
57
  const data = [[title || "Report"], [], headerLabels, ...rows];
36
58
  // worksheet = XLSX.utils.aoa_to_sheet([headerLabels, ...rows]);
@@ -44,7 +66,11 @@ export const ExportReactCSV = ({ csvData, headers, fileName,title }) => {
44
66
  // Append the worksheet to the workbook with the name 'Sheet1'
45
67
  XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
46
68
  // Write workbook to a buffer as an array
47
- const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
69
+ const excelBuffer = XLSX.write(workbook, {
70
+ bookType: 'xlsx',
71
+ type: 'array',
72
+ cellStyles: true, // Required to export styles
73
+ });
48
74
  // Create a Blob object from the buffer with correct MIME type
49
75
  const blob = new Blob([excelBuffer], {
50
76
  type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
@@ -39,7 +39,7 @@ function ChangePassword({ history }) {
39
39
 
40
40
  const [loading, setLoading] = useState(false);
41
41
 
42
- console.log(user);
42
+
43
43
 
44
44
  const onFinish = (values) => {
45
45
 
@@ -55,34 +55,27 @@ function ChangePassword({ history }) {
55
55
  confirm_password: values.conpassword
56
56
  }
57
57
 
58
- ApiUtils.post({
59
- url: `users/change-password`,
60
- formBody,
61
- hideError: true
62
- }).then((result) => {
63
-
64
- var msg = Object.values(result)
65
-
66
- if (msg[0] === 'INCORRECT PASSWORD') {
67
- //If current Password is entered wrong
68
- message.error('Incorrect Password')
69
- setLoading(false);
70
- return false
71
- }
72
- else {
58
+ ApiUtils.post({
59
+ url: `users/change-password`,
60
+ headers: {
61
+ db_ptr: 'nuraho'
62
+ },
63
+ formBody,
64
+ hideError: true
65
+ })
66
+ .then((result) => {
73
67
 
74
68
  setLoading(false);
75
69
 
76
70
  history.goBack();
77
71
 
78
- // Update successful.
79
- message.success('Your password has been updated!')
80
- }
81
-
82
- }).catch(function (error) {
83
-
84
- // An error happened.
85
- message.error(error.result || error.message)
72
+ // Update successful.
73
+ message.success(result.result || 'Your password has been updated!');
74
+
75
+ }).catch(function (error) {
76
+
77
+ // An error happened.
78
+ message.warning(error.result || error.message);
86
79
 
87
80
  setLoading(false);
88
81