Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weihan-plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wei Han
weihan-plugin
Commits
227d7a6d
Commit
227d7a6d
authored
Jan 29, 2026
by
Wei Han
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
side menu code update
parent
1323f31a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
86 additions
and
14 deletions
+86
-14
DashboardViewController.mm
...k/QmsPluginFramework/Dashboard/DashboardViewController.mm
+2
-1
DrawerViewController.mm
...amework/QmsPluginFramework/Drawer/DrawerViewController.mm
+0
-1
ManageAccountViewController.h
...k/QmsPluginFramework/Drawer/ManageAccountViewController.h
+13
-0
ManageAccountViewController.mm
.../QmsPluginFramework/Drawer/ManageAccountViewController.mm
+0
-0
NotificationViewController.mm
...k/QmsPluginFramework/Drawer/NotificationViewController.mm
+62
-9
ProfileViewController.mm
...mework/QmsPluginFramework/Drawer/ProfileViewController.mm
+0
-0
SurveyViewController.h
...ramework/QmsPluginFramework/Survey/SurveyViewController.h
+3
-0
SurveyViewController.mm
...amework/QmsPluginFramework/Survey/SurveyViewController.mm
+3
-0
OfflineSyncManager.mm
...uginFramework/Utilities/OfflineSync/OfflineSyncManager.mm
+3
-3
No files found.
framework/QmsPluginFramework/QmsPluginFramework/Dashboard/DashboardViewController.mm
View file @
227d7a6d
...
...
@@ -73,7 +73,6 @@
//[[OfflineSyncManager shared] clearOfflineQueue];
[[NSNotificationCenter defaultCenter] postNotificationName:@"ShowHiddenButtonNotification" object:@(YES)];
}
- (void)viewWillAppear:(BOOL)animated {
...
...
@@ -82,11 +81,13 @@
NSLog(@"Dashboard loaded, refreshing data");
[self refreshDashboardContent];
self.navigationController.navigationBarHidden = YES;
[[NSNotificationCenter defaultCenter] postNotificationName:@"ShowHiddenButtonNotification" object:@(YES)];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.navigationController.navigationBarHidden = YES;
[[NSNotificationCenter defaultCenter] postNotificationName:@"ShowHiddenButtonNotification" object:@(NO)];
}
#pragma mark - Refresh Logic
...
...
framework/QmsPluginFramework/QmsPluginFramework/Drawer/DrawerViewController.mm
View file @
227d7a6d
...
...
@@ -146,7 +146,6 @@ static NSString * const ProfileDidUpdateNotification = @"ProfileDidUpdateNotific
- (void)loadDefaultsIfNeeded {
if (!self.profileName) self.profileName = @"Guest User";
if (!self.profileEmail) self.profileEmail = @"guest@example.com";
if (!self.profileImageURL) self.profileImageURL = nil;
self.nameLabel.text = self.profileName;
self.emailLabel.text = self.profileEmail;
...
...
framework/QmsPluginFramework/QmsPluginFramework/Drawer/ManageAccountViewController.h
0 → 100644
View file @
227d7a6d
// ManageAccountViewController.h
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface
ManageAccountViewController
:
UIViewController
@property
(
nonatomic
,
strong
)
NSArray
<
NSDictionary
*>
*
accounts
;
@end
NS_ASSUME_NONNULL_END
framework/QmsPluginFramework/QmsPluginFramework/Drawer/ManageAccountViewController.mm
0 → 100644
View file @
227d7a6d
This diff is collapsed.
Click to expand it.
framework/QmsPluginFramework/QmsPluginFramework/Drawer/NotificationViewController.mm
View file @
227d7a6d
...
...
@@ -7,6 +7,7 @@
#import "APIConfig.h"
#import "AppointmentDetailsViewController.h"
#import "DashboardViewController.h"
#import "IssueDetailViewController.h"
static char kNotificationKey;
...
...
@@ -418,6 +419,8 @@ static char kNotificationKey;
NSString *notificationType = item[@"type"];
NSDictionary *strData = item;
self.oldUnitId = [APIConfig drawingPlanId];
NSString *projectName = item[@"project_name"];
NSString *projectCode = item[@"draw_plan_name"];
NSString *unitID = @"";
if (strData[@"draw_plan_id"]) {
...
...
@@ -461,7 +464,7 @@ static char kNotificationKey;
issueID = strData[@"issue_id"];
}
[self openIssueWithUnit:unitID issueID:issueID];
[self openIssueWithUnit:unitID issueID:issueID
projectName:projectName projectCode:projectCode
];
}
...
...
@@ -470,6 +473,7 @@ static char kNotificationKey;
NSLog(@"➡️ Open Appointment | unit=%@ appt=%@", unitID, appointmentID);
[APIClient requestDashboardInfo:^(BOOL success, NSDictionary * _Nullable data, NSError * _Nonnull error) {
if (!success || !data) {
[APIConfig setDrawingPlanId:self.oldUnitId];
return;
}
...
...
@@ -479,6 +483,7 @@ static char kNotificationKey;
appointment == [NSNull null] ||
![appointment isKindOfClass:[NSArray class]] ||
appointmentID.length == 0) {
[APIConfig setDrawingPlanId:self.oldUnitId];
return;
}
...
...
@@ -500,12 +505,14 @@ static char kNotificationKey;
}
if (!matchedAppointment) {
// No match found
NSLog(@"❌ No matching appointment found");
[APIConfig setDrawingPlanId:self.oldUnitId];
return;
}
// 👉 Navigate to Appointment Details
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"navigating to appointment details");
AppointmentDetailsViewController *vc = [[AppointmentDetailsViewController alloc] init];
vc.modalPresentationStyle = UIModalPresentationFullScreen;
vc.appointmentData = matchedAppointment;
...
...
@@ -520,14 +527,17 @@ static char kNotificationKey;
NSArray *projects = self.projectList;
if (!projects || projects.count == 0) {
NSLog(@"❌ Project list empty");
[APIConfig setDrawingPlanId:self.oldUnitId];
return;
}
for (NSDictionary *project in projects) {
if (![project isKindOfClass:[NSDictionary class]]) continue;
NSString *projectIDStr = [NSString stringWithFormat:@"%@", projectID];
NSString *projID = [NSString stringWithFormat:@"%@", project[@"id"]];
if (![projID isEqualToString:projectID]) continue;
if (![projID isEqualToString:projectIDStr]) continue;
NSArray *units = project[@"unit"];
if (![units isKindOfClass:[NSArray class]]) break;
...
...
@@ -535,8 +545,10 @@ static char kNotificationKey;
for (NSDictionary *unit in units) {
if (![unit isKindOfClass:[NSDictionary class]]) continue;
NSString *uID = [NSString stringWithFormat:@"%@", unit[@"id"]];
if (![uID isEqualToString:unitID]) continue;
NSString *uID = [NSString stringWithFormat:@"%@", unit[@"id"]];
NSString *unitIDStr = [NSString stringWithFormat:@"%@", unitID];
if (![uID isEqualToString:unitIDStr]) continue;
NSLog(@"uID: %@", uID);
NSLog(@"✅ Found project %@ and unit %@", projectID, unitID);
...
...
@@ -556,12 +568,53 @@ static char kNotificationKey;
}
}
NSLog(@"❌ No matching project/unit found");
[APIConfig setDrawingPlanId:self.oldUnitId];
}
- (void)openIssueWithUnit:(NSString *)unitID issueID:(NSString *)issueID {
NSLog(@"➡️ Open Issue | unit=%@ issue=%@", unitID, issueID);
// TODO: push IssueDetailViewController
- (void)openIssueWithUnit:(NSString *)unitID issueID:(NSString *)issueID projectName:(NSString *)projectName projectCode:(NSString *)projectCode {
NSLog(@"➡️ Open Issue | unit=%@ issue=%@", unitID, issueID);
[APIClient requestIssues:^(BOOL success, NSDictionary * _Nullable data, NSError * _Nonnull error) {
if (!success || !data) {
[APIConfig setDrawingPlanId:self.oldUnitId];
return;
};
NSArray *issues = data[@"Data"];
if (!issues || ![issues isKindOfClass:[NSArray class]]) {
[APIConfig setDrawingPlanId:self.oldUnitId];
return;
}
NSDictionary *matchedIssue = nil;
for (NSDictionary *issue in issues) {
if (![issue isKindOfClass:[NSDictionary class]]) continue;
NSString *iID = [NSString stringWithFormat:@"%@", issue[@"id"]];
NSString *issueIDStr = [NSString stringWithFormat:@"%@", issueID];
if ([iID isEqualToString:issueIDStr]) {
matchedIssue = issue;
break;
}
}
if (!matchedIssue) {
[APIConfig setDrawingPlanId:self.oldUnitId];
NSLog(@"❌ No matching issue found");
return;
}
// 2️⃣ Navigate to Issue Detail
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"➡️ Navigating to IssueDetailViewController");
IssueDetailViewController *vc = [[IssueDetailViewController alloc] init];
vc.modalPresentationStyle = UIModalPresentationFullScreen;
vc.issueData = matchedIssue;
vc.projectCode = projectCode;
vc.projectName = projectName;
[self presentViewController:vc animated:YES completion:nil];
});
}];
}
@end
framework/QmsPluginFramework/QmsPluginFramework/Drawer/ProfileViewController.mm
View file @
227d7a6d
This diff is collapsed.
Click to expand it.
framework/QmsPluginFramework/QmsPluginFramework/Survey/SurveyViewController.h
0 → 100644
View file @
227d7a6d
// SurveyViewController.h
framework/QmsPluginFramework/QmsPluginFramework/Survey/SurveyViewController.mm
0 → 100644
View file @
227d7a6d
// SurveyViewController.mm
framework/QmsPluginFramework/QmsPluginFramework/Utilities/OfflineSync/OfflineSyncManager.mm
View file @
227d7a6d
...
...
@@ -797,14 +797,14 @@ static NSString * const kSyncSelectedUnitsKey = @"SYNC_SELECTEDUNITS";
} next:next];
}];
// Task 9 — requestAnnouncement
// Task 9 — request
Client
Announcement
[tasks addObject:^(void (^next)(void)) {
[self safeSequentialTask:@"task9" block:^(void (^safeNext)(void), void (^logSuccess)(BOOL)) {
NSLog(@"🚀 Starting Task 9");
[APIClient requestAnnouncement:^(BOOL success, NSDictionary *res, NSError *err) {
[APIClient request
Client
Announcement:^(BOOL success, NSDictionary *res, NSError *err) {
NSString *logText = [NSString stringWithFormat:
@"\n🚀 Task 9 — requestAnnouncement\nTime: %@\nError: %@\nResponse: %@\n",
@"\n🚀 Task 9 — request
Client
Announcement\nTime: %@\nError: %@\nResponse: %@\n",
[NSDate date], err, res];
[self appendOfflineLog:logText];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment