@convep_mobilogy/react-native-qms-plugin 0.14.0 → 1.1.0
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/android/build.gradle +1 -1
- package/ios/QmsPlugin/QmsDashboardViewManager.mm +51 -2
- package/ios/QmsPlugin/UIViewController+QmsAnalytics.m +45 -3
- package/ios/QmsPluginFramework.xcframework/Info.plist +5 -5
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/Assets.car +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/QmsPluginFramework +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/_CodeSignature/CodeResources +8 -8
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/bm.json +3 -3
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/cn.json +1 -1
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/en.json +7 -7
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/Assets.car +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/QmsPluginFramework +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/_CodeSignature/CodeResources +8 -8
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/bm.json +3 -3
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/cn.json +1 -1
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/en.json +7 -7
- package/lib/module/QmsDashboardView.android.js +12 -1
- package/lib/module/QmsDashboardView.android.js.map +1 -1
- package/lib/module/QmsDashboardView.ios.js +8 -2
- package/lib/module/QmsDashboardView.ios.js.map +1 -1
- package/lib/module/analyticsUtils.js +51 -0
- package/lib/module/analyticsUtils.js.map +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/QmsDashboardView.android.d.ts.map +1 -1
- package/lib/typescript/src/QmsDashboardView.ios.d.ts.map +1 -1
- package/lib/typescript/src/QmsDashboardView.types.d.ts +14 -0
- package/lib/typescript/src/QmsDashboardView.types.d.ts.map +1 -1
- package/lib/typescript/src/analyticsUtils.d.ts +45 -0
- package/lib/typescript/src/analyticsUtils.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/QmsDashboardView.android.tsx +25 -2
- package/src/QmsDashboardView.ios.tsx +17 -3
- package/src/QmsDashboardView.types.ts +17 -0
- package/src/analyticsUtils.ts +86 -0
- package/src/index.tsx +4 -1
package/android/build.gradle
CHANGED
|
@@ -75,7 +75,7 @@ dependencies {
|
|
|
75
75
|
implementation "com.facebook.react:react-android"
|
|
76
76
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
77
|
implementation 'com.facebook.react:react-native:+'
|
|
78
|
-
implementation "com.convep.qms:qms-plugin:1.
|
|
78
|
+
implementation "com.convep.qms:qms-plugin:1.19.0"
|
|
79
79
|
|
|
80
80
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
81
81
|
|
|
@@ -27,6 +27,7 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
|
|
|
27
27
|
|
|
28
28
|
@property (nonatomic, copy) RCTDirectEventBlock onClose;
|
|
29
29
|
@property (nonatomic, copy) RCTDirectEventBlock onLogout;
|
|
30
|
+
@property (nonatomic, copy) RCTDirectEventBlock onActiveAccountChange;
|
|
30
31
|
@property (nonatomic, copy) RCTDirectEventBlock onAnalyticsScreen;
|
|
31
32
|
@property (nonatomic, copy) RCTDirectEventBlock onAnalyticsEvent;
|
|
32
33
|
@end
|
|
@@ -84,6 +85,10 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
|
|
|
84
85
|
selector:@selector(handleDashboardLogout:)
|
|
85
86
|
name:@"QmsDashboardDidLogoutNotification"
|
|
86
87
|
object:nil];
|
|
88
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
89
|
+
selector:@selector(handleActiveAccountChange:)
|
|
90
|
+
name:@"QmsActiveAccountDidChangeNotification"
|
|
91
|
+
object:nil];
|
|
87
92
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
88
93
|
selector:@selector(handleRoutePayloadNotification:)
|
|
89
94
|
name:kQmsRoutePayloadNotification
|
|
@@ -145,6 +150,12 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
|
|
|
145
150
|
}
|
|
146
151
|
}
|
|
147
152
|
|
|
153
|
+
- (void)handleActiveAccountChange:(NSNotification *)note {
|
|
154
|
+
if (self.onActiveAccountChange) {
|
|
155
|
+
self.onActiveAccountChange(note.userInfo ?: @{});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
148
159
|
- (void)cleanupDashboard {
|
|
149
160
|
if (!_dashboardVC) return;
|
|
150
161
|
|
|
@@ -540,12 +551,40 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
|
|
|
540
551
|
return base;
|
|
541
552
|
}
|
|
542
553
|
|
|
554
|
+
- (NSAttributedString *)attributedStringByApplyingFontFamily:(NSString *)fontFamily
|
|
555
|
+
toAttributedString:(NSAttributedString *)attributedText
|
|
556
|
+
fallbackFont:(UIFont *)fallbackFont {
|
|
557
|
+
if (fontFamily.length == 0 || attributedText.length == 0) return attributedText;
|
|
558
|
+
|
|
559
|
+
NSMutableAttributedString *updatedAttributedText = [attributedText mutableCopy];
|
|
560
|
+
NSRange fullRange = NSMakeRange(0, attributedText.length);
|
|
561
|
+
|
|
562
|
+
[updatedAttributedText enumerateAttribute:NSFontAttributeName
|
|
563
|
+
inRange:fullRange
|
|
564
|
+
options:0
|
|
565
|
+
usingBlock:^(id value, NSRange range, BOOL *stop) {
|
|
566
|
+
UIFont *sourceFont = [value isKindOfClass:[UIFont class]] ? value : fallbackFont;
|
|
567
|
+
UIFont *updatedFont = [self fontByPreservingStyleFromFont:sourceFont];
|
|
568
|
+
if (updatedFont) {
|
|
569
|
+
[updatedAttributedText addAttribute:NSFontAttributeName value:updatedFont range:range];
|
|
570
|
+
}
|
|
571
|
+
}];
|
|
572
|
+
|
|
573
|
+
return updatedAttributedText;
|
|
574
|
+
}
|
|
575
|
+
|
|
543
576
|
- (void)applyFontFamilyRecursivelyOnView:(UIView *)view {
|
|
544
577
|
if (!view) return;
|
|
545
578
|
|
|
546
579
|
if ([view isKindOfClass:[UILabel class]]) {
|
|
547
580
|
UILabel *label = (UILabel *)view;
|
|
548
|
-
label.
|
|
581
|
+
if (label.attributedText.length > 0) {
|
|
582
|
+
label.attributedText = [self attributedStringByApplyingFontFamily:_fontFamily
|
|
583
|
+
toAttributedString:label.attributedText
|
|
584
|
+
fallbackFont:label.font];
|
|
585
|
+
} else {
|
|
586
|
+
label.font = [self fontByPreservingStyleFromFont:label.font];
|
|
587
|
+
}
|
|
549
588
|
} else if ([view isKindOfClass:[UIButton class]]) {
|
|
550
589
|
UIButton *button = (UIButton *)view;
|
|
551
590
|
if (button.titleLabel) {
|
|
@@ -599,6 +638,7 @@ RCT_EXPORT_VIEW_PROPERTY(fontFamily, NSString)
|
|
|
599
638
|
RCT_EXPORT_VIEW_PROPERTY(isOrigin, BOOL)
|
|
600
639
|
RCT_EXPORT_VIEW_PROPERTY(payload, NSDictionary)
|
|
601
640
|
RCT_EXPORT_VIEW_PROPERTY(onLogout, RCTDirectEventBlock)
|
|
641
|
+
RCT_EXPORT_VIEW_PROPERTY(onActiveAccountChange, RCTDirectEventBlock)
|
|
602
642
|
RCT_EXPORT_VIEW_PROPERTY(onAnalyticsScreen, RCTDirectEventBlock)
|
|
603
643
|
RCT_EXPORT_VIEW_PROPERTY(onAnalyticsEvent, RCTDirectEventBlock)
|
|
604
644
|
|
|
@@ -642,6 +682,10 @@ RCT_EXPORT_MODULE();
|
|
|
642
682
|
selector:@selector(handleDashboardLogout:)
|
|
643
683
|
name:@"QmsDashboardDidLogoutNotification"
|
|
644
684
|
object:nil];
|
|
685
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
686
|
+
selector:@selector(handleActiveAccountChangeEmitter:)
|
|
687
|
+
name:@"QmsActiveAccountDidChangeNotification"
|
|
688
|
+
object:nil];
|
|
645
689
|
}
|
|
646
690
|
return self;
|
|
647
691
|
}
|
|
@@ -650,6 +694,7 @@ RCT_EXPORT_MODULE();
|
|
|
650
694
|
return @[
|
|
651
695
|
@"onClose",
|
|
652
696
|
@"onLogout",
|
|
697
|
+
@"onActiveAccountChange",
|
|
653
698
|
@"onAnalyticsScreen",
|
|
654
699
|
@"onAnalyticsEvent",
|
|
655
700
|
@"QmsSdkOnAnalyticsScreen",
|
|
@@ -676,8 +721,12 @@ RCT_EXPORT_MODULE();
|
|
|
676
721
|
[self sendEventWithName:@"onLogout" body:note.userInfo];
|
|
677
722
|
}
|
|
678
723
|
|
|
724
|
+
- (void)handleActiveAccountChangeEmitter:(NSNotification *)note {
|
|
725
|
+
[self sendEventWithName:@"onActiveAccountChange" body:note.userInfo];
|
|
726
|
+
}
|
|
727
|
+
|
|
679
728
|
- (void)dealloc {
|
|
680
729
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
681
730
|
}
|
|
682
731
|
|
|
683
|
-
@end
|
|
732
|
+
@end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
//UIViewController+QmsAnalytics.m
|
|
2
|
+
|
|
1
3
|
#import <Foundation/Foundation.h>
|
|
2
4
|
#import <UIKit/UIKit.h>
|
|
3
5
|
#import <objc/runtime.h>
|
|
@@ -228,7 +230,9 @@ static void qms_swizzleInstanceMethod(Class cls, SEL originalSelector, SEL swizz
|
|
|
228
230
|
|
|
229
231
|
- (void)qms_applyPrimaryRecursively:(UIView *)view themeColor:(UIColor *)themeColor {
|
|
230
232
|
if (!view || !themeColor) return;
|
|
231
|
-
|
|
233
|
+
BOOL skipSemanticStatusPill = (view.tag == 500 &&
|
|
234
|
+
[NSStringFromClass([self class]) isEqualToString:@"AppointmentDetailsViewController"]);
|
|
235
|
+
if (!skipSemanticStatusPill && [self qms_isDefaultPrimaryColor:view.backgroundColor]) {
|
|
232
236
|
view.backgroundColor = themeColor;
|
|
233
237
|
}
|
|
234
238
|
for (UIView *subview in view.subviews) {
|
|
@@ -373,12 +377,42 @@ static void qms_swizzleInstanceMethod(Class cls, SEL originalSelector, SEL swizz
|
|
|
373
377
|
return result ?: [UIFont systemFontOfSize:sourceFont.pointSize];
|
|
374
378
|
}
|
|
375
379
|
|
|
380
|
+
- (NSAttributedString *)qms_attributedStringByTransformingFontsInAttributedString:(NSAttributedString *)attributedText
|
|
381
|
+
fallbackFont:(UIFont *)fallbackFont
|
|
382
|
+
resolver:(UIFont *(^)(UIFont *sourceFont))resolver {
|
|
383
|
+
if (attributedText.length == 0 || resolver == nil) return attributedText;
|
|
384
|
+
|
|
385
|
+
NSMutableAttributedString *mutable = [attributedText mutableCopy];
|
|
386
|
+
NSRange fullRange = NSMakeRange(0, attributedText.length);
|
|
387
|
+
|
|
388
|
+
[mutable enumerateAttribute:NSFontAttributeName
|
|
389
|
+
inRange:fullRange
|
|
390
|
+
options:0
|
|
391
|
+
usingBlock:^(id value, NSRange range, BOOL *stop) {
|
|
392
|
+
UIFont *sourceFont = [value isKindOfClass:[UIFont class]] ? value : fallbackFont;
|
|
393
|
+
UIFont *updatedFont = resolver(sourceFont);
|
|
394
|
+
if (updatedFont) {
|
|
395
|
+
[mutable addAttribute:NSFontAttributeName value:updatedFont range:range];
|
|
396
|
+
}
|
|
397
|
+
}];
|
|
398
|
+
|
|
399
|
+
return mutable;
|
|
400
|
+
}
|
|
401
|
+
|
|
376
402
|
- (void)qms_applyFontRecursively:(UIView *)view fontFamily:(NSString *)fontFamily {
|
|
377
403
|
if (!view || fontFamily.length == 0) return;
|
|
378
404
|
|
|
379
405
|
if ([view isKindOfClass:[UILabel class]]) {
|
|
380
406
|
UILabel *label = (UILabel *)view;
|
|
381
|
-
label.
|
|
407
|
+
if (label.attributedText.length > 0) {
|
|
408
|
+
label.attributedText = [self qms_attributedStringByTransformingFontsInAttributedString:label.attributedText
|
|
409
|
+
fallbackFont:label.font
|
|
410
|
+
resolver:^UIFont *(UIFont *sourceFont) {
|
|
411
|
+
return [self qms_fontByPreservingStyleFromFont:sourceFont fontFamily:fontFamily];
|
|
412
|
+
}];
|
|
413
|
+
} else {
|
|
414
|
+
label.font = [self qms_fontByPreservingStyleFromFont:label.font fontFamily:fontFamily];
|
|
415
|
+
}
|
|
382
416
|
} else if ([view isKindOfClass:[UIButton class]]) {
|
|
383
417
|
UIButton *button = (UIButton *)view;
|
|
384
418
|
if (button.titleLabel) {
|
|
@@ -402,7 +436,15 @@ static void qms_swizzleInstanceMethod(Class cls, SEL originalSelector, SEL swizz
|
|
|
402
436
|
|
|
403
437
|
if ([view isKindOfClass:[UILabel class]]) {
|
|
404
438
|
UILabel *label = (UILabel *)view;
|
|
405
|
-
label.
|
|
439
|
+
if (label.attributedText.length > 0) {
|
|
440
|
+
label.attributedText = [self qms_attributedStringByTransformingFontsInAttributedString:label.attributedText
|
|
441
|
+
fallbackFont:label.font
|
|
442
|
+
resolver:^UIFont *(UIFont *sourceFont) {
|
|
443
|
+
return [self qms_systemFontByPreservingStyleFromFont:sourceFont];
|
|
444
|
+
}];
|
|
445
|
+
} else {
|
|
446
|
+
label.font = [self qms_systemFontByPreservingStyleFromFont:label.font];
|
|
447
|
+
}
|
|
406
448
|
} else if ([view isKindOfClass:[UIButton class]]) {
|
|
407
449
|
UIButton *button = (UIButton *)view;
|
|
408
450
|
if (button.titleLabel) {
|
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
<key>BinaryPath</key>
|
|
9
9
|
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
|
|
10
10
|
<key>LibraryIdentifier</key>
|
|
11
|
-
<string>ios-
|
|
11
|
+
<string>ios-arm64</string>
|
|
12
12
|
<key>LibraryPath</key>
|
|
13
13
|
<string>QmsPluginFramework.framework</string>
|
|
14
14
|
<key>SupportedArchitectures</key>
|
|
15
15
|
<array>
|
|
16
16
|
<string>arm64</string>
|
|
17
|
-
<string>x86_64</string>
|
|
18
17
|
</array>
|
|
19
18
|
<key>SupportedPlatform</key>
|
|
20
19
|
<string>ios</string>
|
|
21
|
-
<key>SupportedPlatformVariant</key>
|
|
22
|
-
<string>simulator</string>
|
|
23
20
|
</dict>
|
|
24
21
|
<dict>
|
|
25
22
|
<key>BinaryPath</key>
|
|
26
23
|
<string>QmsPluginFramework.framework/QmsPluginFramework</string>
|
|
27
24
|
<key>LibraryIdentifier</key>
|
|
28
|
-
<string>ios-
|
|
25
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
29
26
|
<key>LibraryPath</key>
|
|
30
27
|
<string>QmsPluginFramework.framework</string>
|
|
31
28
|
<key>SupportedArchitectures</key>
|
|
32
29
|
<array>
|
|
33
30
|
<string>arm64</string>
|
|
31
|
+
<string>x86_64</string>
|
|
34
32
|
</array>
|
|
35
33
|
<key>SupportedPlatform</key>
|
|
36
34
|
<string>ios</string>
|
|
35
|
+
<key>SupportedPlatformVariant</key>
|
|
36
|
+
<string>simulator</string>
|
|
37
37
|
</dict>
|
|
38
38
|
</array>
|
|
39
39
|
<key>CFBundlePackageType</key>
|
package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/Assets.car
CHANGED
|
Binary file
|
package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/QmsPluginFramework
CHANGED
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<dict>
|
|
7
7
|
<key>Assets.car</key>
|
|
8
8
|
<data>
|
|
9
|
-
|
|
9
|
+
OFNSvB3amYHYvcSdVpA4/9zqjGI=
|
|
10
10
|
</data>
|
|
11
11
|
<key>Headers/QmsPlugin.h</key>
|
|
12
12
|
<data>
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
</data>
|
|
39
39
|
<key>bm.json</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
J8m1xUyQbIm7FjEl6dgNTLhSBVU=
|
|
42
42
|
</data>
|
|
43
43
|
<key>cn.json</key>
|
|
44
44
|
<data>
|
|
45
|
-
|
|
45
|
+
6uy8Rq4wc/w3jMt5TwQTjNmTrIw=
|
|
46
46
|
</data>
|
|
47
47
|
<key>en.json</key>
|
|
48
48
|
<data>
|
|
49
|
-
|
|
49
|
+
4Tqlnsl9cvRAJ3mMAQNj1MokMPA=
|
|
50
50
|
</data>
|
|
51
51
|
</dict>
|
|
52
52
|
<key>files2</key>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<dict>
|
|
56
56
|
<key>hash2</key>
|
|
57
57
|
<data>
|
|
58
|
-
|
|
58
|
+
gi1+dFKH/mzhWhHXI7FnH1u9DFI1VBn0+nH5FFy2cQk=
|
|
59
59
|
</data>
|
|
60
60
|
</dict>
|
|
61
61
|
<key>Headers/QmsPlugin.h</key>
|
|
@@ -104,21 +104,21 @@
|
|
|
104
104
|
<dict>
|
|
105
105
|
<key>hash2</key>
|
|
106
106
|
<data>
|
|
107
|
-
|
|
107
|
+
GHvVL5a8K6Qm7Qfl7mj96elXhpNILq+pe3Z0Id6+x0g=
|
|
108
108
|
</data>
|
|
109
109
|
</dict>
|
|
110
110
|
<key>cn.json</key>
|
|
111
111
|
<dict>
|
|
112
112
|
<key>hash2</key>
|
|
113
113
|
<data>
|
|
114
|
-
|
|
114
|
+
2Pm//bhYsIm3nGwtPMMnVVBq8NjE3D8jcfSyp2imekQ=
|
|
115
115
|
</data>
|
|
116
116
|
</dict>
|
|
117
117
|
<key>en.json</key>
|
|
118
118
|
<dict>
|
|
119
119
|
<key>hash2</key>
|
|
120
120
|
<data>
|
|
121
|
-
|
|
121
|
+
3gHzwkpXeTuAPWs/zdPLAma6GZdL51xbjVc4VR+WSrk=
|
|
122
122
|
</data>
|
|
123
123
|
</dict>
|
|
124
124
|
</dict>
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"BY_CATEGORY": "Mengikut Kategori",
|
|
238
238
|
"BY_CONTRACTOR": "Mengikut Kontraktor",
|
|
239
239
|
"DESELECT_ALL": "Nyahpilih Semua",
|
|
240
|
-
"SELECT_ALL": "Pilih Semua",
|
|
240
|
+
"SELECT_ALL": "Pilih Semua Status",
|
|
241
241
|
"SEARCH_LABEL1": "Isu Carian",
|
|
242
242
|
"REJECTED": "Ditolak",
|
|
243
243
|
"TAKE_PHOTO": "Ambil gambar",
|
|
@@ -280,7 +280,7 @@
|
|
|
280
280
|
"ADD_ITEM": "Tambah Item",
|
|
281
281
|
"SUBMITTED_BY": "Dihantar Oleh",
|
|
282
282
|
"RECEIVED_BY": "Diterima Oleh",
|
|
283
|
-
"CLICK_HERE": "
|
|
283
|
+
"CLICK_HERE": "Tandatangan di Sini",
|
|
284
284
|
"EMPTY_FIELD": "Sila isi ruangan yang diperlukan sebelum menghantar.",
|
|
285
285
|
"DETAILS": "Butiran",
|
|
286
286
|
"UNIT_NO": "No. Unit",
|
|
@@ -720,7 +720,7 @@
|
|
|
720
720
|
"WITHDRAW_ISSUE_SUMMARY": "Ringkasan Penarikan Isu",
|
|
721
721
|
"WITHDRAW_ISSUE_MESSAGE": "Adakah anda pasti mahu menarik balik isu ini?",
|
|
722
722
|
"WITHDRAW_ISSUE_SUCCESS_LABEL": "Isu berjaya ditarik balik",
|
|
723
|
-
"ISSUES_SELECTED": "Isu
|
|
723
|
+
"ISSUES_SELECTED": "Isu",
|
|
724
724
|
"ENTER_REMARKS_HERE": "Masukkan ulasan di sini...",
|
|
725
725
|
"WITHDRAWING": "Menarik Balik",
|
|
726
726
|
"WITHDRAW_ALERT_MESSAGE": "Sahkan untuk menarik balik isu?",
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"ADD_ITEM": "Add Item",
|
|
276
276
|
"SUBMITTED_BY": "Submitted By",
|
|
277
277
|
"RECEIVED_BY": "Received By",
|
|
278
|
-
"CLICK_HERE": "
|
|
278
|
+
"CLICK_HERE": "Sign Here",
|
|
279
279
|
"EMPTY_FIELD": "Please fill up the required fields before submitting.",
|
|
280
280
|
"DETAILS": "Details",
|
|
281
281
|
"UNIT_NO": "Unit No.",
|
|
@@ -447,7 +447,7 @@
|
|
|
447
447
|
"REJECTS": "Reject",
|
|
448
448
|
"PHOTO_UPLOAD": "Photo Upload",
|
|
449
449
|
"STORAGE_PERMISSION_MESSAGE": "Storage permission required to access this function",
|
|
450
|
-
"SELECT_ISSUE": "
|
|
450
|
+
"SELECT_ISSUE": "Select Issue",
|
|
451
451
|
"VIEW_SUMMARY": "View Summary",
|
|
452
452
|
"SIGN_OFF_": "Sign Off",
|
|
453
453
|
"CANCEL_POA_MESSAGE": "Cancel pending owner acceptance sign off?",
|
|
@@ -623,7 +623,7 @@
|
|
|
623
623
|
"UPLOADED_COUNT": "Uploaded Count",
|
|
624
624
|
"REASON_FAILED_TO_SUBMIT": "Reason Failed to Submit",
|
|
625
625
|
"MAX_UNITS_ALERT_MESSAGE": "You have selected the maximum amount of units. Please remove a unit before adding a new one.",
|
|
626
|
-
"UNITS_SELECTED": "
|
|
626
|
+
"UNITS_SELECTED": "Unit(s) Selected",
|
|
627
627
|
"OFFLINE_UNIT": "Offline Unit",
|
|
628
628
|
"ADD_UNIT": "Add Unit",
|
|
629
629
|
"NO_DATA": "There is no data\nat this moment.",
|
|
@@ -721,7 +721,7 @@
|
|
|
721
721
|
"WITHDRAW_ISSUE_SUMMARY": "Withdraw Issue Summary",
|
|
722
722
|
"WITHDRAW_ISSUE_MESSAGE": "Are you sure you want to withdraw this issue?",
|
|
723
723
|
"WITHDRAW_ISSUE_SUCCESS_LABEL": "Issue withdraw successfully",
|
|
724
|
-
"ISSUES_SELECTED": "Issue(s)
|
|
724
|
+
"ISSUES_SELECTED": "Issue(s)",
|
|
725
725
|
"ENTER_REMARKS_HERE": "Enter remarks here...",
|
|
726
726
|
"WITHDRAWING": "Withdrawing",
|
|
727
727
|
"WITHDRAW_ALERT_MESSAGE": "Confirm to withdraw issue?",
|
|
@@ -755,7 +755,7 @@
|
|
|
755
755
|
"COPY_LINK": "Copy Link",
|
|
756
756
|
"SHARE": " Share",
|
|
757
757
|
"LINK_ACCESS": "Link Access",
|
|
758
|
-
"CHANGE_LINK_NAME": "Change
|
|
758
|
+
"CHANGE_LINK_NAME": "Change Link Name",
|
|
759
759
|
"DELETE_LINK": "Delete Link",
|
|
760
760
|
"SHARE_LINKURL": "Share 3rd Party Link URL",
|
|
761
761
|
"SELECT_OPTION_TO_SHARE": "Select an option to share",
|
|
@@ -775,8 +775,8 @@
|
|
|
775
775
|
"TUTORIAL_LINKSUB2": "The link created and shared by you will allow your authorised person to view the submitted issues.",
|
|
776
776
|
"TUTORIAL_LINKTITLE3": "Change link access at your convenience",
|
|
777
777
|
"TUTORIAL_LINKSUB3": "Toggle to switch link access when you no longer need the authorised person’s assistance.",
|
|
778
|
-
"HANDOVER_SURVEY": "
|
|
778
|
+
"HANDOVER_SURVEY": "Customer Satisfaction Survey",
|
|
779
779
|
"EMPTY_SURVEY": "Please fill up the required fields in this survey before submitting.",
|
|
780
780
|
"CONFIRM_SUBMIT_SURVEY": "Confirm to submit survey ?",
|
|
781
|
-
"ALERT_MESSAGE_ISSUE_SURVEY": "Please complete the survey before submitting an issue."
|
|
781
|
+
"ALERT_MESSAGE_ISSUE_SURVEY": "Please complete the customer satisfaction survey before submitting an issue."
|
|
782
782
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<dict>
|
|
7
7
|
<key>Assets.car</key>
|
|
8
8
|
<data>
|
|
9
|
-
|
|
9
|
+
OFNSvB3amYHYvcSdVpA4/9zqjGI=
|
|
10
10
|
</data>
|
|
11
11
|
<key>Headers/QmsPlugin.h</key>
|
|
12
12
|
<data>
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
</data>
|
|
39
39
|
<key>bm.json</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
J8m1xUyQbIm7FjEl6dgNTLhSBVU=
|
|
42
42
|
</data>
|
|
43
43
|
<key>cn.json</key>
|
|
44
44
|
<data>
|
|
45
|
-
|
|
45
|
+
6uy8Rq4wc/w3jMt5TwQTjNmTrIw=
|
|
46
46
|
</data>
|
|
47
47
|
<key>en.json</key>
|
|
48
48
|
<data>
|
|
49
|
-
|
|
49
|
+
4Tqlnsl9cvRAJ3mMAQNj1MokMPA=
|
|
50
50
|
</data>
|
|
51
51
|
</dict>
|
|
52
52
|
<key>files2</key>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<dict>
|
|
56
56
|
<key>hash2</key>
|
|
57
57
|
<data>
|
|
58
|
-
|
|
58
|
+
gi1+dFKH/mzhWhHXI7FnH1u9DFI1VBn0+nH5FFy2cQk=
|
|
59
59
|
</data>
|
|
60
60
|
</dict>
|
|
61
61
|
<key>Headers/QmsPlugin.h</key>
|
|
@@ -104,21 +104,21 @@
|
|
|
104
104
|
<dict>
|
|
105
105
|
<key>hash2</key>
|
|
106
106
|
<data>
|
|
107
|
-
|
|
107
|
+
GHvVL5a8K6Qm7Qfl7mj96elXhpNILq+pe3Z0Id6+x0g=
|
|
108
108
|
</data>
|
|
109
109
|
</dict>
|
|
110
110
|
<key>cn.json</key>
|
|
111
111
|
<dict>
|
|
112
112
|
<key>hash2</key>
|
|
113
113
|
<data>
|
|
114
|
-
|
|
114
|
+
2Pm//bhYsIm3nGwtPMMnVVBq8NjE3D8jcfSyp2imekQ=
|
|
115
115
|
</data>
|
|
116
116
|
</dict>
|
|
117
117
|
<key>en.json</key>
|
|
118
118
|
<dict>
|
|
119
119
|
<key>hash2</key>
|
|
120
120
|
<data>
|
|
121
|
-
|
|
121
|
+
3gHzwkpXeTuAPWs/zdPLAma6GZdL51xbjVc4VR+WSrk=
|
|
122
122
|
</data>
|
|
123
123
|
</dict>
|
|
124
124
|
</dict>
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"BY_CATEGORY": "Mengikut Kategori",
|
|
238
238
|
"BY_CONTRACTOR": "Mengikut Kontraktor",
|
|
239
239
|
"DESELECT_ALL": "Nyahpilih Semua",
|
|
240
|
-
"SELECT_ALL": "Pilih Semua",
|
|
240
|
+
"SELECT_ALL": "Pilih Semua Status",
|
|
241
241
|
"SEARCH_LABEL1": "Isu Carian",
|
|
242
242
|
"REJECTED": "Ditolak",
|
|
243
243
|
"TAKE_PHOTO": "Ambil gambar",
|
|
@@ -280,7 +280,7 @@
|
|
|
280
280
|
"ADD_ITEM": "Tambah Item",
|
|
281
281
|
"SUBMITTED_BY": "Dihantar Oleh",
|
|
282
282
|
"RECEIVED_BY": "Diterima Oleh",
|
|
283
|
-
"CLICK_HERE": "
|
|
283
|
+
"CLICK_HERE": "Tandatangan di Sini",
|
|
284
284
|
"EMPTY_FIELD": "Sila isi ruangan yang diperlukan sebelum menghantar.",
|
|
285
285
|
"DETAILS": "Butiran",
|
|
286
286
|
"UNIT_NO": "No. Unit",
|
|
@@ -720,7 +720,7 @@
|
|
|
720
720
|
"WITHDRAW_ISSUE_SUMMARY": "Ringkasan Penarikan Isu",
|
|
721
721
|
"WITHDRAW_ISSUE_MESSAGE": "Adakah anda pasti mahu menarik balik isu ini?",
|
|
722
722
|
"WITHDRAW_ISSUE_SUCCESS_LABEL": "Isu berjaya ditarik balik",
|
|
723
|
-
"ISSUES_SELECTED": "Isu
|
|
723
|
+
"ISSUES_SELECTED": "Isu",
|
|
724
724
|
"ENTER_REMARKS_HERE": "Masukkan ulasan di sini...",
|
|
725
725
|
"WITHDRAWING": "Menarik Balik",
|
|
726
726
|
"WITHDRAW_ALERT_MESSAGE": "Sahkan untuk menarik balik isu?",
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"ADD_ITEM": "Add Item",
|
|
276
276
|
"SUBMITTED_BY": "Submitted By",
|
|
277
277
|
"RECEIVED_BY": "Received By",
|
|
278
|
-
"CLICK_HERE": "
|
|
278
|
+
"CLICK_HERE": "Sign Here",
|
|
279
279
|
"EMPTY_FIELD": "Please fill up the required fields before submitting.",
|
|
280
280
|
"DETAILS": "Details",
|
|
281
281
|
"UNIT_NO": "Unit No.",
|
|
@@ -447,7 +447,7 @@
|
|
|
447
447
|
"REJECTS": "Reject",
|
|
448
448
|
"PHOTO_UPLOAD": "Photo Upload",
|
|
449
449
|
"STORAGE_PERMISSION_MESSAGE": "Storage permission required to access this function",
|
|
450
|
-
"SELECT_ISSUE": "
|
|
450
|
+
"SELECT_ISSUE": "Select Issue",
|
|
451
451
|
"VIEW_SUMMARY": "View Summary",
|
|
452
452
|
"SIGN_OFF_": "Sign Off",
|
|
453
453
|
"CANCEL_POA_MESSAGE": "Cancel pending owner acceptance sign off?",
|
|
@@ -623,7 +623,7 @@
|
|
|
623
623
|
"UPLOADED_COUNT": "Uploaded Count",
|
|
624
624
|
"REASON_FAILED_TO_SUBMIT": "Reason Failed to Submit",
|
|
625
625
|
"MAX_UNITS_ALERT_MESSAGE": "You have selected the maximum amount of units. Please remove a unit before adding a new one.",
|
|
626
|
-
"UNITS_SELECTED": "
|
|
626
|
+
"UNITS_SELECTED": "Unit(s) Selected",
|
|
627
627
|
"OFFLINE_UNIT": "Offline Unit",
|
|
628
628
|
"ADD_UNIT": "Add Unit",
|
|
629
629
|
"NO_DATA": "There is no data\nat this moment.",
|
|
@@ -721,7 +721,7 @@
|
|
|
721
721
|
"WITHDRAW_ISSUE_SUMMARY": "Withdraw Issue Summary",
|
|
722
722
|
"WITHDRAW_ISSUE_MESSAGE": "Are you sure you want to withdraw this issue?",
|
|
723
723
|
"WITHDRAW_ISSUE_SUCCESS_LABEL": "Issue withdraw successfully",
|
|
724
|
-
"ISSUES_SELECTED": "Issue(s)
|
|
724
|
+
"ISSUES_SELECTED": "Issue(s)",
|
|
725
725
|
"ENTER_REMARKS_HERE": "Enter remarks here...",
|
|
726
726
|
"WITHDRAWING": "Withdrawing",
|
|
727
727
|
"WITHDRAW_ALERT_MESSAGE": "Confirm to withdraw issue?",
|
|
@@ -755,7 +755,7 @@
|
|
|
755
755
|
"COPY_LINK": "Copy Link",
|
|
756
756
|
"SHARE": " Share",
|
|
757
757
|
"LINK_ACCESS": "Link Access",
|
|
758
|
-
"CHANGE_LINK_NAME": "Change
|
|
758
|
+
"CHANGE_LINK_NAME": "Change Link Name",
|
|
759
759
|
"DELETE_LINK": "Delete Link",
|
|
760
760
|
"SHARE_LINKURL": "Share 3rd Party Link URL",
|
|
761
761
|
"SELECT_OPTION_TO_SHARE": "Select an option to share",
|
|
@@ -775,8 +775,8 @@
|
|
|
775
775
|
"TUTORIAL_LINKSUB2": "The link created and shared by you will allow your authorised person to view the submitted issues.",
|
|
776
776
|
"TUTORIAL_LINKTITLE3": "Change link access at your convenience",
|
|
777
777
|
"TUTORIAL_LINKSUB3": "Toggle to switch link access when you no longer need the authorised person’s assistance.",
|
|
778
|
-
"HANDOVER_SURVEY": "
|
|
778
|
+
"HANDOVER_SURVEY": "Customer Satisfaction Survey",
|
|
779
779
|
"EMPTY_SURVEY": "Please fill up the required fields in this survey before submitting.",
|
|
780
780
|
"CONFIRM_SUBMIT_SURVEY": "Confirm to submit survey ?",
|
|
781
|
-
"ALERT_MESSAGE_ISSUE_SURVEY": "Please complete the survey before submitting an issue."
|
|
781
|
+
"ALERT_MESSAGE_ISSUE_SURVEY": "Please complete the customer satisfaction survey before submitting an issue."
|
|
782
782
|
}
|
|
@@ -10,8 +10,10 @@ export const QmsDashboardView = ({
|
|
|
10
10
|
style,
|
|
11
11
|
onClose,
|
|
12
12
|
onLogout,
|
|
13
|
+
onActiveAccountChange,
|
|
13
14
|
onAnalyticsScreen,
|
|
14
15
|
onAnalyticsEvent,
|
|
16
|
+
onLocate,
|
|
15
17
|
clientID,
|
|
16
18
|
clientCode,
|
|
17
19
|
ClientID,
|
|
@@ -89,6 +91,11 @@ export const QmsDashboardView = ({
|
|
|
89
91
|
const subscription = DeviceEventEmitter.addListener('QmsSdkOnLogout', () => onLogout());
|
|
90
92
|
return () => subscription.remove();
|
|
91
93
|
}, [onLogout]);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (!onActiveAccountChange) return;
|
|
96
|
+
const subscription = DeviceEventEmitter.addListener('QmsSdkOnActiveAccountChange', payload => onActiveAccountChange(payload ?? {}));
|
|
97
|
+
return () => subscription.remove();
|
|
98
|
+
}, [onActiveAccountChange]);
|
|
92
99
|
useEffect(() => {
|
|
93
100
|
if (!onAnalyticsScreen) return;
|
|
94
101
|
const subscription = DeviceEventEmitter.addListener('QmsSdkOnAnalyticsScreen', event => onAnalyticsScreen(event?.screenName, event?.screenClass));
|
|
@@ -99,7 +106,11 @@ export const QmsDashboardView = ({
|
|
|
99
106
|
const subscription = DeviceEventEmitter.addListener('QmsSdkOnAnalyticsEvent', event => onAnalyticsEvent(event?.eventName, event?.params ?? null));
|
|
100
107
|
return () => subscription.remove();
|
|
101
108
|
}, [onAnalyticsEvent]);
|
|
102
|
-
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (!onLocate) return;
|
|
111
|
+
const subscription = DeviceEventEmitter.addListener('QmsSdkOnLocate', event => onLocate(event?.lat, event?.lng));
|
|
112
|
+
return () => subscription.remove();
|
|
113
|
+
}, [onLocate]);
|
|
103
114
|
// Android doesn’t need to show native UI as a "view" here,
|
|
104
115
|
// we just render an empty container so JSX stays consistent.
|
|
105
116
|
return /*#__PURE__*/_jsx(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","DeviceEventEmitter","NativeModules","View","jsx","_jsx","QmsModule","QmsDashboardView","style","onClose","onLogout","onAnalyticsScreen","onAnalyticsEvent","clientID","clientCode","ClientID","ClientCode","user_token","token","userToken","autoShow","themeColor","headerThemeColor","headerTextColor","headerIconColor","accentColor","fontFamily","isOrigin","payload","resolvedClientID","resolvedClientCode","resolvedToken","hasPayload","Object","keys","length","showQms","setPrimaryColor","resolvedHeaderColor","setHeaderTextColor","resolvedHeaderIconColor","setHeaderIconColor","setAccentColor","setFontFamily","showQmsWithPayload","subscription","addListener","remove","event","screenName","screenClass","eventName","params"],"sourceRoot":"../../src","sources":["QmsDashboardView.android.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,kBAAkB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["React","useEffect","DeviceEventEmitter","NativeModules","View","jsx","_jsx","QmsModule","QmsDashboardView","style","onClose","onLogout","onActiveAccountChange","onAnalyticsScreen","onAnalyticsEvent","onLocate","clientID","clientCode","ClientID","ClientCode","user_token","token","userToken","autoShow","themeColor","headerThemeColor","headerTextColor","headerIconColor","accentColor","fontFamily","isOrigin","payload","resolvedClientID","resolvedClientCode","resolvedToken","hasPayload","Object","keys","length","showQms","setPrimaryColor","resolvedHeaderColor","setHeaderTextColor","resolvedHeaderIconColor","setHeaderIconColor","setAccentColor","setFontFamily","showQmsWithPayload","subscription","addListener","remove","event","screenName","screenClass","eventName","params","lat","lng"],"sourceRoot":"../../src","sources":["QmsDashboardView.android.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,kBAAkB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMvE,MAAM;EAAEC;AAAU,CAAC,GAAGJ,aAqBrB;AAED,OAAO,MAAMK,gBAAiD,GAAGA,CAAC;EAChEC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,qBAAqB;EACrBC,iBAAiB;EACjBC,gBAAgB;EAChBC,QAAQ;EACRC,QAAQ;EACRC,UAAU;EACVC,QAAQ;EACRC,UAAU;EACVC,UAAU;EACVC,K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AAC+C,WAAW,CACjD,wBAAwB,EACvBE,KAAgE,IAC/DrC,gBAAgB,CAACqC,KAAK,EAAEG,SAAS,EAAEH,KAAK,EAAEI,MAAM,IAAI,IAAI,CAC5D,CAAC;IACD,OAAO,MAAMP,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC,CAAC,EAAE,CAACpC,gBAAgB,CAAC,CAAC;EACtBb,SAAS,CAAC,MAAM;IACd,IAAI,CAACc,QAAQ,EAAE;IACf,MAAMiC,YAAY,GAAG9C,kBAAkB,CAAC+C,WAAW,CACjD,gBAAgB,EACfE,KAAsC,IACrCpC,QAAQ,CAACoC,KAAK,EAAEK,GAAG,EAAEL,KAAK,EAAEM,GAAG,CACnC,CAAC;IACD,OAAO,MAAMT,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC,CAAC,EAAE,CAACnC,QAAQ,CAAC,CAAC;EACd;EACA;EACA,oBAAOT,IAAA,CAACF,IAAI;IAACK,KAAK,EAAEA;EAAM,CAAE,CAAC;AAC/B,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
// QmsDashboardView.ios.tsx
|
|
4
|
+
|
|
3
5
|
import React, { useEffect } from 'react';
|
|
4
6
|
import { DeviceEventEmitter, NativeEventEmitter, NativeModules, requireNativeComponent } from 'react-native';
|
|
5
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -9,6 +11,7 @@ export const QmsDashboardView = props => {
|
|
|
9
11
|
const {
|
|
10
12
|
onClose,
|
|
11
13
|
onLogout,
|
|
14
|
+
onActiveAccountChange,
|
|
12
15
|
onAnalyticsScreen,
|
|
13
16
|
onAnalyticsEvent,
|
|
14
17
|
clientID,
|
|
@@ -43,7 +46,7 @@ export const QmsDashboardView = props => {
|
|
|
43
46
|
module?.setFontFamily?.(fontFamily ?? '');
|
|
44
47
|
}, [themeColor, resolvedHeaderColor, resolvedHeaderIconColor, accentColor, fontFamily]);
|
|
45
48
|
useEffect(() => {
|
|
46
|
-
if (!onClose && !onLogout) return;
|
|
49
|
+
if (!onClose && !onLogout && !onActiveAccountChange) return;
|
|
47
50
|
const nativeEmitterModule = NativeModules.QmsDashboardEmitter;
|
|
48
51
|
if (!nativeEmitterModule) return;
|
|
49
52
|
const emitter = new NativeEventEmitter(nativeEmitterModule);
|
|
@@ -54,8 +57,11 @@ export const QmsDashboardView = props => {
|
|
|
54
57
|
if (onLogout) {
|
|
55
58
|
subscriptions.push(emitter.addListener('onLogout', onLogout));
|
|
56
59
|
}
|
|
60
|
+
if (onActiveAccountChange) {
|
|
61
|
+
subscriptions.push(emitter.addListener('onActiveAccountChange', raw => onActiveAccountChange(raw ?? {})));
|
|
62
|
+
}
|
|
57
63
|
return () => subscriptions.forEach(sub => sub.remove());
|
|
58
|
-
}, [onClose, onLogout]);
|
|
64
|
+
}, [onClose, onLogout, onActiveAccountChange]);
|
|
59
65
|
useEffect(() => {
|
|
60
66
|
if (!onAnalyticsScreen) return;
|
|
61
67
|
const subscription = DeviceEventEmitter.addListener('QmsSdkOnAnalyticsScreen', payload => onAnalyticsScreen(payload?.screenName, payload?.screenClass));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","DeviceEventEmitter","NativeEventEmitter","NativeModules","requireNativeComponent","jsx","_jsx","NativeQmsDashboardView","QmsDashboardView","props","onClose","onLogout","onAnalyticsScreen","onAnalyticsEvent","clientID","clientCode","ClientID","ClientCode","user_token","userToken","token","isOrigin","themeColor","headerThemeColor","headerTextColor","headerIconColor","accentColor","fontFamily","payload","rest","resolvedClientID","resolvedClientCode","resolvedToken","resolvedHeaderColor","resolvedHeaderIconColor","module","QmsModule","setPrimaryColor","setHeaderTextColor","setHeaderIconColor","setAccentColor","setFontFamily","nativeEmitterModule","QmsDashboardEmitter","emitter","subscriptions","push","addListener","forEach","sub","remove","subscription","screenName","screenClass","eventName","params"],"sourceRoot":"../../src","sources":["QmsDashboardView.ios.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,kBAAkB,EAClBC,kBAAkB,EAClBC,aAAa,EACbC,sBAAsB,QACjB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"names":["React","useEffect","DeviceEventEmitter","NativeEventEmitter","NativeModules","requireNativeComponent","jsx","_jsx","NativeQmsDashboardView","QmsDashboardView","props","onClose","onLogout","onActiveAccountChange","onAnalyticsScreen","onAnalyticsEvent","clientID","clientCode","ClientID","ClientCode","user_token","userToken","token","isOrigin","themeColor","headerThemeColor","headerTextColor","headerIconColor","accentColor","fontFamily","payload","rest","resolvedClientID","resolvedClientCode","resolvedToken","resolvedHeaderColor","resolvedHeaderIconColor","module","QmsModule","setPrimaryColor","setHeaderTextColor","setHeaderIconColor","setAccentColor","setFontFamily","nativeEmitterModule","QmsDashboardEmitter","emitter","subscriptions","push","addListener","raw","forEach","sub","remove","subscription","screenName","screenClass","eventName","params"],"sourceRoot":"../../src","sources":["QmsDashboardView.ios.tsx"],"mappings":";;AAAA;;AAEA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,kBAAkB,EAClBC,kBAAkB,EAClBC,aAAa,EACbC,sBAAsB,QACjB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMtB;AACA,MAAMC,sBAAsB,GAC1BH,sBAAsB,CAAwB,kBAAkB,CAAC;AAEnE,OAAO,MAAMI,gBAAiD,GAAIC,KAAK,IAAK;EAC1E,MAAM;IACJC,OAAO;IACPC,QAAQ;IACRC,qBAAqB;IACrBC,iBAAiB;IACjBC,gBAAgB;IAChBC,QAAQ;IACRC,UAAU;IACVC,QAAQ;IACRC,UAAU;IACVC,UAAU;IACVC,SAAS;IACTC,KAAK;IACLC,QAAQ,GAAG,KAAK;IAChB;IACAC,UAAU;IACVC,gBAAgB;IAChBC,eAAe;IACfC,eAAe;IACfC,WAAW;IACXC,UAAU,GA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AC/Bb,UAAU,EAAEc,aAAc;IAC1BX,QAAQ,EAAEA,QAAS;IACnBC,UAAU,EAAEA,UAAW;IACvBE,eAAe,EAAES,mBAAoB;IACrCR,eAAe,EAAES,uBAAwB;IACzCR,WAAW,EAAEA,WAAY;IACzBC,UAAU,EAAEA,UAAW;IACvBC,OAAO,EAAEA,OAAO,IAAI;EAAK,CAC1B,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Converts a raw event name from the native SDK into a Firebase-safe event name.
|
|
5
|
+
*
|
|
6
|
+
* Firebase rules:
|
|
7
|
+
* - Only letters, digits, and underscores
|
|
8
|
+
* - Must begin with a letter
|
|
9
|
+
* - Max 40 characters
|
|
10
|
+
*
|
|
11
|
+
* e.g. "POA Sign Off" → "poa_sign_off"
|
|
12
|
+
* "Unit Overview" → "unit_overview"
|
|
13
|
+
* "ScreenAt" → "screenat"
|
|
14
|
+
*/
|
|
15
|
+
export function toFirebaseEventName(raw) {
|
|
16
|
+
if (!raw) return '';
|
|
17
|
+
return raw.trim().toLowerCase().replace(/[^a-z0-9]+/g, '_') // replace any non-alphanumeric run with _
|
|
18
|
+
.replace(/^_+|_+$/g, '') // strip leading/trailing underscores
|
|
19
|
+
.slice(0, 40); // Firebase max 40 chars
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Structured analytics event types
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Flattens a structured QmsEventParams into Firebase-compatible key-value params.
|
|
28
|
+
* Firebase logEvent only supports flat string/number values.
|
|
29
|
+
*
|
|
30
|
+
* Usage with @react-native-firebase/analytics:
|
|
31
|
+
* analytics().logEvent(
|
|
32
|
+
* toFirebaseEventName(eventName),
|
|
33
|
+
* toFirebaseParams(params as QmsEventParams)
|
|
34
|
+
* );
|
|
35
|
+
*/
|
|
36
|
+
export function toFirebaseParams(params) {
|
|
37
|
+
return {
|
|
38
|
+
user_name: params.user?.name ?? '',
|
|
39
|
+
user_email: params.user?.email ?? '',
|
|
40
|
+
unit_project: params.unit?.project ?? '',
|
|
41
|
+
unit_no: params.unit?.unit_no ?? '',
|
|
42
|
+
lot_no: params.unit?.lot_no ?? '',
|
|
43
|
+
action_name: params.action?.name ?? '',
|
|
44
|
+
action_type: params.action?.type ?? '',
|
|
45
|
+
action_clicked: params.action?.clicked ?? '',
|
|
46
|
+
action_from: params.action?.from ?? '',
|
|
47
|
+
action_to: params.action?.to ?? '',
|
|
48
|
+
created_at: params.created_at ?? ''
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=analyticsUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toFirebaseEventName","raw","trim","toLowerCase","replace","slice","toFirebaseParams","params","user_name","user","name","user_email","email","unit_project","unit","project","unit_no","lot_no","action_name","action","action_type","type","action_clicked","clicked","action_from","from","action_to","to","created_at"],"sourceRoot":"../../src","sources":["analyticsUtils.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAmBA,CAACC,GAA8B,EAAU;EAC1E,IAAI,CAACA,GAAG,EAAE,OAAO,EAAE;EAEnB,OAAOA,GAAG,CACPC,IAAI,CAAC,CAAC,CACNC,WAAW,CAAC,CAAC,CACbC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;EAAA,CAC5BA,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAK;EAAA,CAC5BC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAe;AACjC;;AAEA;AACA;AACA;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC9BC,MAAsB,EACE;EACxB,OAAO;IACLC,SAAS,EAAOD,MAAM,CAACE,IAAI,EAAEC,IAAI,IAAQ,EAAE;IAC3CC,UAAU,EAAMJ,MAAM,CAACE,IAAI,EAAEG,KAAK,IAAO,EAAE;IAC3CC,YAAY,EAAIN,MAAM,CAACO,IAAI,EAAEC,OAAO,IAAK,EAAE;IAC3CC,OAAO,EAAST,MAAM,CAACO,IAAI,EAAEE,OAAO,IAAK,EAAE;IAC3CC,MAAM,EAAUV,MAAM,CAACO,IAAI,EAAEG,MAAM,IAAM,EAAE;IAC3CC,WAAW,EAAKX,MAAM,CAACY,MAAM,EAAET,IAAI,IAAM,EAAE;IAC3CU,WAAW,EAAKb,MAAM,CAACY,MAAM,EAAEE,IAAI,IAAM,EAAE;IAC3CC,cAAc,EAAEf,MAAM,CAACY,MAAM,EAAEI,OAAO,IAAI,EAAE;IAC5CC,WAAW,EAAKjB,MAAM,CAACY,MAAM,EAAEM,IAAI,IAAM,EAAE;IAC3CC,SAAS,EAAOnB,MAAM,CAACY,MAAM,EAAEQ,EAAE,IAAQ,EAAE;IAC3CC,UAAU,EAAMrB,MAAM,CAACqB,UAAU,IAAQ;EAC3C,CAAC;AACH","ignoreList":[]}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["QmsDashboardView","QmsPlugin"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,uBAAoB;
|
|
1
|
+
{"version":3,"names":["QmsDashboardView","QmsPlugin"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,uBAAoB;AAKrD,SAASC,SAAS,QAAQ,gBAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QmsDashboardView.android.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.android.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"QmsDashboardView.android.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.android.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAyBlC,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA0K5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QmsDashboardView.ios.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.ios.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QmsDashboardView.ios.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAMlC,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAkH5D,CAAC"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
/** Payload from native when the xcframework active session identity changes (switch account, logout with fallback, etc.). */
|
|
3
|
+
export type QmsActiveAccountPayload = {
|
|
4
|
+
hasActiveAccount?: boolean;
|
|
5
|
+
storedAccountCount?: number;
|
|
6
|
+
clientID?: string;
|
|
7
|
+
clientCode?: string;
|
|
8
|
+
userToken?: string;
|
|
9
|
+
userName?: string;
|
|
10
|
+
company?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
};
|
|
2
13
|
export type QmsDashboardViewProps = {
|
|
3
14
|
style?: StyleProp<ViewStyle>;
|
|
4
15
|
onClose?: (event?: unknown) => void;
|
|
5
16
|
onLogout?: (event?: unknown) => void;
|
|
17
|
+
/** Called when native multi-account state changes; persist with {@link QmsActiveAccountPayload} for RN login storage. */
|
|
18
|
+
onActiveAccountChange?: (payload: QmsActiveAccountPayload) => void;
|
|
6
19
|
onAnalyticsScreen?: (screenName?: string, screenClass?: string) => void;
|
|
7
20
|
onAnalyticsEvent?: (eventName?: string, params?: Record<string, unknown> | null) => void;
|
|
21
|
+
onLocate?: (lat?: string, lng?: string) => void;
|
|
8
22
|
/**
|
|
9
23
|
* Preferred camelCase props. Uppercase variants are kept for backwards compatibility
|
|
10
24
|
* with the native iOS view manager prop names.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QmsDashboardView.types.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QmsDashboardView.types.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,6HAA6H;AAC7H,MAAM,MAAM,uBAAuB,GAAG;IACpC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,yHAAyH;IACzH,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACnE,iBAAiB,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,gBAAgB,CAAC,EAAE,CACjB,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,KACpC,IAAI,CAAC;IACV,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC1C,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a raw event name from the native SDK into a Firebase-safe event name.
|
|
3
|
+
*
|
|
4
|
+
* Firebase rules:
|
|
5
|
+
* - Only letters, digits, and underscores
|
|
6
|
+
* - Must begin with a letter
|
|
7
|
+
* - Max 40 characters
|
|
8
|
+
*
|
|
9
|
+
* e.g. "POA Sign Off" → "poa_sign_off"
|
|
10
|
+
* "Unit Overview" → "unit_overview"
|
|
11
|
+
* "ScreenAt" → "screenat"
|
|
12
|
+
*/
|
|
13
|
+
export declare function toFirebaseEventName(raw: string | undefined | null): string;
|
|
14
|
+
export type QmsActionType = 'navigation' | 'view' | 'select' | 'submit' | 'edit' | 'update' | 'delete' | 'back' | 'refresh' | 'create';
|
|
15
|
+
export type QmsEventParams = {
|
|
16
|
+
user: {
|
|
17
|
+
name: string;
|
|
18
|
+
email: string;
|
|
19
|
+
};
|
|
20
|
+
unit: {
|
|
21
|
+
project: string;
|
|
22
|
+
unit_no: string;
|
|
23
|
+
lot_no: string;
|
|
24
|
+
};
|
|
25
|
+
action: {
|
|
26
|
+
name: string;
|
|
27
|
+
type: QmsActionType;
|
|
28
|
+
clicked: string;
|
|
29
|
+
from: string;
|
|
30
|
+
to: string;
|
|
31
|
+
};
|
|
32
|
+
created_at: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Flattens a structured QmsEventParams into Firebase-compatible key-value params.
|
|
36
|
+
* Firebase logEvent only supports flat string/number values.
|
|
37
|
+
*
|
|
38
|
+
* Usage with @react-native-firebase/analytics:
|
|
39
|
+
* analytics().logEvent(
|
|
40
|
+
* toFirebaseEventName(eventName),
|
|
41
|
+
* toFirebaseParams(params as QmsEventParams)
|
|
42
|
+
* );
|
|
43
|
+
*/
|
|
44
|
+
export declare function toFirebaseParams(params: QmsEventParams): Record<string, string>;
|
|
45
|
+
//# sourceMappingURL=analyticsUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyticsUtils.d.ts","sourceRoot":"","sources":["../../../src/analyticsUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAS1E;AAMD,MAAM,MAAM,aAAa,GACrB,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,SAAS,GACT,QAAQ,CAAC;AAEb,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,aAAa,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,cAAc,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAcxB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { QmsDashboardView } from './QmsDashboardView';
|
|
2
|
-
export type { QmsDashboardViewProps } from './QmsDashboardView.types';
|
|
2
|
+
export type { QmsActiveAccountPayload, QmsDashboardViewProps, } from './QmsDashboardView.types';
|
|
3
3
|
export { QmsPlugin } from './QmsPlugin';
|
|
4
4
|
export type { InAppNotificationPayload } from './QmsPlugin';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { DeviceEventEmitter, NativeModules, View } from 'react-native';
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
QmsActiveAccountPayload,
|
|
5
|
+
QmsDashboardViewProps,
|
|
6
|
+
} from './QmsDashboardView.types';
|
|
4
7
|
|
|
5
8
|
const { QmsModule } = NativeModules as {
|
|
6
9
|
QmsModule?: {
|
|
@@ -29,8 +32,10 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = ({
|
|
|
29
32
|
style,
|
|
30
33
|
onClose,
|
|
31
34
|
onLogout,
|
|
35
|
+
onActiveAccountChange,
|
|
32
36
|
onAnalyticsScreen,
|
|
33
37
|
onAnalyticsEvent,
|
|
38
|
+
onLocate,
|
|
34
39
|
clientID,
|
|
35
40
|
clientCode,
|
|
36
41
|
ClientID,
|
|
@@ -152,6 +157,16 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = ({
|
|
|
152
157
|
return () => subscription.remove();
|
|
153
158
|
}, [onLogout]);
|
|
154
159
|
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
if (!onActiveAccountChange) return;
|
|
162
|
+
const subscription = DeviceEventEmitter.addListener(
|
|
163
|
+
'QmsSdkOnActiveAccountChange',
|
|
164
|
+
(payload?: QmsActiveAccountPayload) =>
|
|
165
|
+
onActiveAccountChange(payload ?? {})
|
|
166
|
+
);
|
|
167
|
+
return () => subscription.remove();
|
|
168
|
+
}, [onActiveAccountChange]);
|
|
169
|
+
|
|
155
170
|
useEffect(() => {
|
|
156
171
|
if (!onAnalyticsScreen) return;
|
|
157
172
|
const subscription = DeviceEventEmitter.addListener(
|
|
@@ -171,7 +186,15 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = ({
|
|
|
171
186
|
);
|
|
172
187
|
return () => subscription.remove();
|
|
173
188
|
}, [onAnalyticsEvent]);
|
|
174
|
-
|
|
189
|
+
useEffect(() => {
|
|
190
|
+
if (!onLocate) return;
|
|
191
|
+
const subscription = DeviceEventEmitter.addListener(
|
|
192
|
+
'QmsSdkOnLocate',
|
|
193
|
+
(event?: { lat?: string; lng?: string }) =>
|
|
194
|
+
onLocate(event?.lat, event?.lng)
|
|
195
|
+
);
|
|
196
|
+
return () => subscription.remove();
|
|
197
|
+
}, [onLocate]);
|
|
175
198
|
// Android doesn’t need to show native UI as a "view" here,
|
|
176
199
|
// we just render an empty container so JSX stays consistent.
|
|
177
200
|
return <View style={style} />;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// QmsDashboardView.ios.tsx
|
|
2
|
+
|
|
1
3
|
import React, { useEffect } from 'react';
|
|
2
4
|
import {
|
|
3
5
|
DeviceEventEmitter,
|
|
@@ -5,7 +7,10 @@ import {
|
|
|
5
7
|
NativeModules,
|
|
6
8
|
requireNativeComponent,
|
|
7
9
|
} from 'react-native';
|
|
8
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
QmsActiveAccountPayload,
|
|
12
|
+
QmsDashboardViewProps,
|
|
13
|
+
} from './QmsDashboardView.types';
|
|
9
14
|
|
|
10
15
|
// Make sure your iOS native view manager is exported as "QmsDashboardView"
|
|
11
16
|
const NativeQmsDashboardView =
|
|
@@ -15,6 +20,7 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
|
|
|
15
20
|
const {
|
|
16
21
|
onClose,
|
|
17
22
|
onLogout,
|
|
23
|
+
onActiveAccountChange,
|
|
18
24
|
onAnalyticsScreen,
|
|
19
25
|
onAnalyticsEvent,
|
|
20
26
|
clientID,
|
|
@@ -67,7 +73,7 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
|
|
|
67
73
|
]);
|
|
68
74
|
|
|
69
75
|
useEffect(() => {
|
|
70
|
-
if (!onClose && !onLogout) return;
|
|
76
|
+
if (!onClose && !onLogout && !onActiveAccountChange) return;
|
|
71
77
|
const nativeEmitterModule = NativeModules.QmsDashboardEmitter;
|
|
72
78
|
if (!nativeEmitterModule) return;
|
|
73
79
|
const emitter = new NativeEventEmitter(nativeEmitterModule);
|
|
@@ -78,8 +84,16 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
|
|
|
78
84
|
if (onLogout) {
|
|
79
85
|
subscriptions.push(emitter.addListener('onLogout', onLogout));
|
|
80
86
|
}
|
|
87
|
+
if (onActiveAccountChange) {
|
|
88
|
+
subscriptions.push(
|
|
89
|
+
emitter.addListener(
|
|
90
|
+
'onActiveAccountChange',
|
|
91
|
+
(raw?: QmsActiveAccountPayload) => onActiveAccountChange(raw ?? {})
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
}
|
|
81
95
|
return () => subscriptions.forEach((sub) => sub.remove());
|
|
82
|
-
}, [onClose, onLogout]);
|
|
96
|
+
}, [onClose, onLogout, onActiveAccountChange]);
|
|
83
97
|
|
|
84
98
|
useEffect(() => {
|
|
85
99
|
if (!onAnalyticsScreen) return;
|
|
@@ -1,14 +1,31 @@
|
|
|
1
|
+
// QmsDashboardView.types.ts
|
|
2
|
+
|
|
1
3
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
4
|
|
|
5
|
+
/** Payload from native when the xcframework active session identity changes (switch account, logout with fallback, etc.). */
|
|
6
|
+
export type QmsActiveAccountPayload = {
|
|
7
|
+
hasActiveAccount?: boolean;
|
|
8
|
+
storedAccountCount?: number;
|
|
9
|
+
clientID?: string;
|
|
10
|
+
clientCode?: string;
|
|
11
|
+
userToken?: string;
|
|
12
|
+
userName?: string;
|
|
13
|
+
company?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
3
17
|
export type QmsDashboardViewProps = {
|
|
4
18
|
style?: StyleProp<ViewStyle>;
|
|
5
19
|
onClose?: (event?: unknown) => void;
|
|
6
20
|
onLogout?: (event?: unknown) => void;
|
|
21
|
+
/** Called when native multi-account state changes; persist with {@link QmsActiveAccountPayload} for RN login storage. */
|
|
22
|
+
onActiveAccountChange?: (payload: QmsActiveAccountPayload) => void;
|
|
7
23
|
onAnalyticsScreen?: (screenName?: string, screenClass?: string) => void;
|
|
8
24
|
onAnalyticsEvent?: (
|
|
9
25
|
eventName?: string,
|
|
10
26
|
params?: Record<string, unknown> | null
|
|
11
27
|
) => void;
|
|
28
|
+
onLocate?: (lat?: string, lng?: string) => void;
|
|
12
29
|
/**
|
|
13
30
|
* Preferred camelCase props. Uppercase variants are kept for backwards compatibility
|
|
14
31
|
* with the native iOS view manager prop names.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a raw event name from the native SDK into a Firebase-safe event name.
|
|
3
|
+
*
|
|
4
|
+
* Firebase rules:
|
|
5
|
+
* - Only letters, digits, and underscores
|
|
6
|
+
* - Must begin with a letter
|
|
7
|
+
* - Max 40 characters
|
|
8
|
+
*
|
|
9
|
+
* e.g. "POA Sign Off" → "poa_sign_off"
|
|
10
|
+
* "Unit Overview" → "unit_overview"
|
|
11
|
+
* "ScreenAt" → "screenat"
|
|
12
|
+
*/
|
|
13
|
+
export function toFirebaseEventName(raw: string | undefined | null): string {
|
|
14
|
+
if (!raw) return '';
|
|
15
|
+
|
|
16
|
+
return raw
|
|
17
|
+
.trim()
|
|
18
|
+
.toLowerCase()
|
|
19
|
+
.replace(/[^a-z0-9]+/g, '_') // replace any non-alphanumeric run with _
|
|
20
|
+
.replace(/^_+|_+$/g, '') // strip leading/trailing underscores
|
|
21
|
+
.slice(0, 40); // Firebase max 40 chars
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Structured analytics event types
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
export type QmsActionType =
|
|
29
|
+
| 'navigation'
|
|
30
|
+
| 'view'
|
|
31
|
+
| 'select'
|
|
32
|
+
| 'submit'
|
|
33
|
+
| 'edit'
|
|
34
|
+
| 'update'
|
|
35
|
+
| 'delete'
|
|
36
|
+
| 'back'
|
|
37
|
+
| 'refresh'
|
|
38
|
+
| 'create';
|
|
39
|
+
|
|
40
|
+
export type QmsEventParams = {
|
|
41
|
+
user: {
|
|
42
|
+
name: string;
|
|
43
|
+
email: string;
|
|
44
|
+
};
|
|
45
|
+
unit: {
|
|
46
|
+
project: string;
|
|
47
|
+
unit_no: string;
|
|
48
|
+
lot_no: string;
|
|
49
|
+
};
|
|
50
|
+
action: {
|
|
51
|
+
name: string;
|
|
52
|
+
type: QmsActionType;
|
|
53
|
+
clicked: string;
|
|
54
|
+
from: string;
|
|
55
|
+
to: string;
|
|
56
|
+
};
|
|
57
|
+
created_at: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Flattens a structured QmsEventParams into Firebase-compatible key-value params.
|
|
62
|
+
* Firebase logEvent only supports flat string/number values.
|
|
63
|
+
*
|
|
64
|
+
* Usage with @react-native-firebase/analytics:
|
|
65
|
+
* analytics().logEvent(
|
|
66
|
+
* toFirebaseEventName(eventName),
|
|
67
|
+
* toFirebaseParams(params as QmsEventParams)
|
|
68
|
+
* );
|
|
69
|
+
*/
|
|
70
|
+
export function toFirebaseParams(
|
|
71
|
+
params: QmsEventParams
|
|
72
|
+
): Record<string, string> {
|
|
73
|
+
return {
|
|
74
|
+
user_name: params.user?.name ?? '',
|
|
75
|
+
user_email: params.user?.email ?? '',
|
|
76
|
+
unit_project: params.unit?.project ?? '',
|
|
77
|
+
unit_no: params.unit?.unit_no ?? '',
|
|
78
|
+
lot_no: params.unit?.lot_no ?? '',
|
|
79
|
+
action_name: params.action?.name ?? '',
|
|
80
|
+
action_type: params.action?.type ?? '',
|
|
81
|
+
action_clicked: params.action?.clicked ?? '',
|
|
82
|
+
action_from: params.action?.from ?? '',
|
|
83
|
+
action_to: params.action?.to ?? '',
|
|
84
|
+
created_at: params.created_at ?? '',
|
|
85
|
+
};
|
|
86
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export { QmsDashboardView } from './QmsDashboardView';
|
|
2
|
-
export type {
|
|
2
|
+
export type {
|
|
3
|
+
QmsActiveAccountPayload,
|
|
4
|
+
QmsDashboardViewProps,
|
|
5
|
+
} from './QmsDashboardView.types';
|
|
3
6
|
export { QmsPlugin } from './QmsPlugin';
|
|
4
7
|
export type { InAppNotificationPayload } from './QmsPlugin';
|