@convep_mobilogy/react-native-qms-plugin 1.5.2 → 1.6.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.
@@ -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.21.2"
78
+ implementation "com.convep.qms:qms-plugin:1.23.0"
79
79
 
80
80
  implementation 'androidx.appcompat:appcompat:1.6.1'
81
81
 
@@ -109,9 +109,9 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
109
109
  _dashboardVC = [QmsPluginUI makeViewController];
110
110
 
111
111
  [parentVC addChildViewController:_dashboardVC];
112
- _dashboardVC.view.frame = parentVC.view.bounds;
112
+ _dashboardVC.view.frame = self.bounds;
113
113
  _dashboardVC.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
114
- [parentVC.view addSubview:_dashboardVC.view];
114
+ [self addSubview:_dashboardVC.view];
115
115
  [_dashboardVC didMoveToParentViewController:parentVC];
116
116
  _didSetupVC = YES;
117
117
 
@@ -123,6 +123,13 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
123
123
  }
124
124
  }
125
125
 
126
+ - (void)layoutSubviews {
127
+ [super layoutSubviews];
128
+ if (_dashboardVC && _dashboardVC.view.superview == self) {
129
+ _dashboardVC.view.frame = self.bounds;
130
+ }
131
+ }
132
+
126
133
  - (void)handleDashboardClose:(NSNotification *)note {
127
134
  // 1️⃣ Notify JS
128
135
  if (self.onClose) {
@@ -266,6 +273,19 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
266
273
  return [value description];
267
274
  }
268
275
 
276
+ - (NSNumber *)numberFromPayload:(NSDictionary *)payload key:(NSString *)key {
277
+ NSString *value = [self stringFromPayload:payload key:key];
278
+ if (value.length == 0) return nil;
279
+
280
+ NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
281
+ formatter.numberStyle = NSNumberFormatterDecimalStyle;
282
+ NSNumber *number = [formatter numberFromString:value];
283
+ if (number) return number;
284
+
285
+ long long fallback = value.longLongValue;
286
+ return fallback > 0 ? @(fallback) : nil;
287
+ }
288
+
269
289
  - (BOOL)isIssueType:(NSString *)type {
270
290
  static NSSet<NSString *> *types;
271
291
  static dispatch_once_t onceToken;
@@ -332,29 +352,32 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
332
352
  - (void)presentDeepLinkVC:(UIViewController *)destinationVC {
333
353
  if (!destinationVC) return;
334
354
 
335
- // Find the topmost presented VC to present from.
336
355
  UIViewController *presenter = self.dashboardVC;
337
356
  while (presenter.presentedViewController) {
338
357
  presenter = presenter.presentedViewController;
339
358
  }
340
359
 
341
- // Use the same slide-modal style the rest of the app uses.
360
+ // Wrap in nav controller so push-based deep links work correctly
361
+ UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:destinationVC];
362
+ navVC.navigationBarHidden = YES; // hide if the VC has its own custom header
363
+
342
364
  Class delegateClass = NSClassFromString(@"QmsSlideModalTransitionDelegate");
343
365
  if (delegateClass && [delegateClass respondsToSelector:NSSelectorFromString(@"shared")]) {
344
366
  @try {
345
367
  id delegate = [delegateClass performSelector:NSSelectorFromString(@"shared")];
346
- destinationVC.modalPresentationStyle = UIModalPresentationCustom;
347
- destinationVC.transitioningDelegate = delegate;
368
+ navVC.modalPresentationStyle = UIModalPresentationCustom;
369
+ navVC.transitioningDelegate = delegate;
348
370
  } @catch (__unused NSException *e) {
349
- destinationVC.modalPresentationStyle = UIModalPresentationFullScreen;
371
+ navVC.modalPresentationStyle = UIModalPresentationFullScreen;
350
372
  }
351
373
  } else {
352
- destinationVC.modalPresentationStyle = UIModalPresentationFullScreen;
374
+ navVC.modalPresentationStyle = UIModalPresentationFullScreen;
353
375
  }
354
376
 
355
- [presenter presentViewController:destinationVC animated:YES completion:nil];
377
+ [presenter presentViewController:navVC animated:YES completion:nil];
356
378
  }
357
379
 
380
+
358
381
  /// Sets the standard project context properties on a VC using values from the
359
382
  /// notification payload. Covers the common projectCode/projectName/projectId
360
383
  /// naming used by AppointmentViewMoreViewController and IssuesViewController.
@@ -383,8 +406,30 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
383
406
  [self presentDeepLinkVC:vc];
384
407
  }
385
408
 
386
- - (void)presentAppointmentViewControllerWithPayload:(NSDictionary *)payload title:(NSString *)title {
387
- Class cls = NSClassFromString(@"AppointmentViewMoreViewController");
409
+ - (void)presentIssueDetailViewControllerWithPayload:(NSDictionary *)payload title:(NSString *)title {
410
+ Class cls = NSClassFromString(@"IssueDetailViewController");
411
+ if (!cls) return;
412
+ UIViewController *vc = [[cls alloc] init];
413
+ if (!vc) return;
414
+
415
+ NSNumber *issueId = [self numberFromPayload:payload key:@"issue_id"];
416
+ NSString *projName = [self projectNameFromTitle:title];
417
+ if (!issueId) {
418
+ NSLog(@"🧭 new_info payload missing issue_id; cannot route to IssueDetailViewController");
419
+ return;
420
+ }
421
+
422
+ @try {
423
+ [vc setValue:issueId forKey:@"issueId"];
424
+ if (projName.length > 0) [vc setValue:projName forKey:@"projectName"];
425
+ [vc setValue:@"notification" forKey:@"navFrom"];
426
+ } @catch (__unused NSException *e) {}
427
+
428
+ [self presentDeepLinkVC:vc];
429
+ }
430
+
431
+ - (void)presentAppointmentDetailsViewControllerWithPayload:(NSDictionary *)payload title:(NSString *)title {
432
+ Class cls = NSClassFromString(@"AppointmentDetailsViewController");
388
433
  if (!cls) return;
389
434
  UIViewController *vc = [[cls alloc] init];
390
435
  if (!vc) return;
@@ -392,8 +437,8 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
392
437
  [self presentDeepLinkVC:vc];
393
438
  }
394
439
 
395
- - (void)presentGeneralInfoViewControllerWithPayload:(NSDictionary *)payload title:(NSString *)title {
396
- Class cls = NSClassFromString(@"GeneralInfoViewController");
440
+ - (void)presentDashboardViewControllerWithPayload:(NSDictionary *)payload title:(NSString *)title {
441
+ Class cls = NSClassFromString(@"DashboardViewController");
397
442
  if (!cls) return;
398
443
  UIViewController *vc = [[cls alloc] init];
399
444
  if (!vc) return;
@@ -424,14 +469,14 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
424
469
  title ?: @"");
425
470
 
426
471
  if ([self isIssueType:type]) {
427
- NSLog(@"🧭 routing issue type IssuesViewController");
428
- [self presentIssuesViewControllerWithPayload:payload title:title ?: @""];
472
+ NSLog(@"🧭 routing new_infoIssueDetailViewController");
473
+ [self presentIssueDetailViewControllerWithPayload:payload title:title ?: @""];
429
474
  } else if ([self isAppointmentType:type]) {
430
- NSLog(@"🧭 routing appointment type → AppointmentViewMoreViewController");
431
- [self presentAppointmentViewControllerWithPayload:payload title:title ?: @""];
475
+ NSLog(@"🧭 routing appointment type → AppointmentDetailsViewController");
476
+ [self presentAppointmentDetailsViewControllerWithPayload:payload title:title ?: @""];
432
477
  } else if ([type isEqualToString:@"clearance_letter"]) {
433
478
  NSLog(@"🧭 routing clearance_letter → GeneralInfoViewController");
434
- [self presentGeneralInfoViewControllerWithPayload:payload title:title ?: @""];
479
+ [self presentDashboardViewControllerWithPayload:payload title:title ?: @""];
435
480
  } else {
436
481
  NSLog(@"🧭 no route matched for type=%@", type ?: @"");
437
482
  }
@@ -797,4 +842,4 @@ RCT_EXPORT_MODULE();
797
842
  [[NSNotificationCenter defaultCenter] removeObserver:self];
798
843
  }
799
844
 
800
- @end
845
+ @end
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Assets.car</key>
8
8
  <data>
9
- RLxSWa0SdCdD0UzRC2O8Uk6OB/4=
9
+ fjJF2g7Dr6PYcAtKjkhFisFZtwo=
10
10
  </data>
11
11
  <key>Headers/QmsPlugin.h</key>
12
12
  <data>
@@ -46,7 +46,7 @@
46
46
  </data>
47
47
  <key>en.json</key>
48
48
  <data>
49
- 8lH3SDtm/3TmbvOKSzsNztM/1Hs=
49
+ qus9dWyIVEzCyX/BmtDr3Fo8osU=
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
- emgEEFMqkC3XNrYBtiEnm7l+pKxXSbDTPsyCOIVLYqY=
58
+ ruOPkgStvsoXTtWqWY1ZAjNWMXEpbI/trZfA6nErsP8=
59
59
  </data>
60
60
  </dict>
61
61
  <key>Headers/QmsPlugin.h</key>
@@ -118,7 +118,7 @@
118
118
  <dict>
119
119
  <key>hash2</key>
120
120
  <data>
121
- HHusKog1Vl1eVBBRxfMPpI3NHOSkBp0B+ue5N0Xvmxo=
121
+ HBxOIFOudwBFbzTdYQxnKKQfMlQQFxxbLkHdBmvOLDY=
122
122
  </data>
123
123
  </dict>
124
124
  </dict>
@@ -619,7 +619,7 @@
619
619
  "FTL_ALERT_MESSAGE": "Please change your password to continue.",
620
620
  "SYNC_ALERT_MESSAGE": "You have some pending items that need to be synchronized.\nSync now?",
621
621
  "SYNC_AGAIN": "Sync Again",
622
- "UPLOADED_ON": "Uploaded On",
622
+ "UPLOADED_ON": "Uploaded on",
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.",
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Assets.car</key>
8
8
  <data>
9
- RLxSWa0SdCdD0UzRC2O8Uk6OB/4=
9
+ fjJF2g7Dr6PYcAtKjkhFisFZtwo=
10
10
  </data>
11
11
  <key>Headers/QmsPlugin.h</key>
12
12
  <data>
@@ -46,7 +46,7 @@
46
46
  </data>
47
47
  <key>en.json</key>
48
48
  <data>
49
- 8lH3SDtm/3TmbvOKSzsNztM/1Hs=
49
+ qus9dWyIVEzCyX/BmtDr3Fo8osU=
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
- emgEEFMqkC3XNrYBtiEnm7l+pKxXSbDTPsyCOIVLYqY=
58
+ ruOPkgStvsoXTtWqWY1ZAjNWMXEpbI/trZfA6nErsP8=
59
59
  </data>
60
60
  </dict>
61
61
  <key>Headers/QmsPlugin.h</key>
@@ -118,7 +118,7 @@
118
118
  <dict>
119
119
  <key>hash2</key>
120
120
  <data>
121
- HHusKog1Vl1eVBBRxfMPpI3NHOSkBp0B+ue5N0Xvmxo=
121
+ HBxOIFOudwBFbzTdYQxnKKQfMlQQFxxbLkHdBmvOLDY=
122
122
  </data>
123
123
  </dict>
124
124
  </dict>
@@ -619,7 +619,7 @@
619
619
  "FTL_ALERT_MESSAGE": "Please change your password to continue.",
620
620
  "SYNC_ALERT_MESSAGE": "You have some pending items that need to be synchronized.\nSync now?",
621
621
  "SYNC_AGAIN": "Sync Again",
622
- "UPLOADED_ON": "Uploaded On",
622
+ "UPLOADED_ON": "Uploaded on",
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.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convep_mobilogy/react-native-qms-plugin",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "To handle defect managment",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",