| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8d02774 commit f6f490f
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -124,7 +124,7 @@ | |||
| 124 | 124 | 4E53EB5A1AFB090E0034FE1C /* nav_page_unselected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E53EB581AFB090E0034FE1C /* nav_page_unselected@2x.png */; }; | |
| 125 | 125 | 4E59E1D31A5E6B34004DAEEC /* TaskDescriptionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E59E1D21A5E6B34004DAEEC /* TaskDescriptionViewController.m */; }; | |
| 126 | 126 | 4E5A66951B268D160007A0AD /* UIView+PressMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E5A66941B268D160007A0AD /* UIView+PressMenu.m */; }; | |
| 127 | - 4E5A66971B269AA20007A0AD /* diff.html in Resources */ = {isa = PBXBuildFile; fileRef = 4E5A66961B269AA20007A0AD /* diff.html */; }; | ||
| 127 | + 4E5A66991B26EB210007A0AD /* diff.html in Resources */ = {isa = PBXBuildFile; fileRef = 4E5A66981B26EB210007A0AD /* diff.html */; }; | ||
| 128 | 128 | 4E5C06E81AC2B34800F427C5 /* tipIcon_BranchMember@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4E5C06E71AC2B34800F427C5 /* tipIcon_BranchMember@2x.png */; }; | |
| 129 | 129 | 4E5C06EB1AC4009100F427C5 /* CannotLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E5C06EA1AC4009100F427C5 /* CannotLoginViewController.m */; }; | |
| 130 | 130 | 4E5C06EE1AC4405300F427C5 /* PasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E5C06ED1AC4405300F427C5 /* PasswordViewController.m */; }; | |
@@ -879,7 +879,7 @@ | |||
| 879 | 879 | 4E59E1D21A5E6B34004DAEEC /* TaskDescriptionViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskDescriptionViewController.m; sourceTree = "<group>"; }; | |
| 880 | 880 | 4E5A66931B268D160007A0AD /* UIView+PressMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+PressMenu.h"; sourceTree = "<group>"; }; | |
| 881 | 881 | 4E5A66941B268D160007A0AD /* UIView+PressMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+PressMenu.m"; sourceTree = "<group>"; }; | |
| 882 | - 4E5A66961B269AA20007A0AD /* diff.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = diff.html; sourceTree = "<group>"; }; | ||
| 882 | + 4E5A66981B26EB210007A0AD /* diff.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = diff.html; sourceTree = "<group>"; }; | ||
| 883 | 883 | 4E5C06E71AC2B34800F427C5 /* tipIcon_BranchMember@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "tipIcon_BranchMember@2x.png"; sourceTree = "<group>"; }; | |
| 884 | 884 | 4E5C06E91AC4009100F427C5 /* CannotLoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CannotLoginViewController.h; sourceTree = "<group>"; }; | |
| 885 | 885 | 4E5C06EA1AC4009100F427C5 /* CannotLoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CannotLoginViewController.m; sourceTree = "<group>"; }; | |
@@ -3094,7 +3094,7 @@ | |||
| 3094 | 3094 | children = ( | |
| 3095 | 3095 | 4EE083DD1ADB739300CA342E /* modules */, | |
| 3096 | 3096 | 4EE083DB1ADB736800CA342E /* service_terms.html */, | |
| 3097 | - 4E5A66961B269AA20007A0AD /* diff.html */, | ||
| 3097 | + 4E5A66981B26EB210007A0AD /* diff.html */, | ||
| 3098 | 3098 | 8E1C3DF519E7F4CA00EF3032 /* address.json */, | |
| 3099 | 3099 | ); | |
| 3100 | 3100 | path = Resources; | |
@@ -3831,7 +3831,7 @@ | |||
| 3831 | 3831 | B9A00D7F1ACA3A05008BA008 /* ProjectSetting.storyboard in Resources */, | |
| 3832 | 3832 | 8EA6D19219E240C40076D59C /* timeline_icon_unread@2x.png in Resources */, | |
| 3833 | 3833 | 4E217F141A70EDC700F6DF88 /* SVWebViewControllerActivitySafari-iPad@2x.png in Resources */, | |
| 3834 | - 4E5A66971B269AA20007A0AD /* diff.html in Resources */, | ||
| 3834 | + 4E5A66991B26EB210007A0AD /* diff.html in Resources */, | ||
| 3835 | 3835 | 4EF91F641B00B62B0021C951 /* icon_not_locationed@2x.png in Resources */, | |
| 3836 | 3836 | 8EA6D19119E240C40076D59C /* timeline_icon_read@2x.png in Resources */, | |
| 3837 | 3837 | 8E97CEB21A0C7E26006F9AD7 /* coding_emoji_27@2x.png in Resources */, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,5 +13,5 @@ | |||
| 13 | 13 | @interface MRPRDetailViewController : BaseViewController | |
| 14 | 14 | @property (strong, nonatomic) MRPR *curMRPR; | |
| 15 | 15 | @property (strong, nonatomic) Project *curProject; | |
| 16 | - | ||
| 16 | + + (MRPRDetailViewController *)vcWithPath:(NSString *)path; | ||
| 17 | 17 | @end | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,6 +42,25 @@ @interface MRPRDetailViewController ()<UITableViewDataSource, UITableViewDelegat | |||
| 42 | 42 | @end | |
| 43 | 43 | ||
| 44 | 44 | @implementation MRPRDetailViewController | |
| 45 | + | ||
| 46 | + + (MRPRDetailViewController *)vcWithPath:(NSString *)path{ | ||
| 47 | + | ||
| 48 | + NSArray *pathComponents = [path componentsSeparatedByString:@"/"]; | ||
| 49 | + if (pathComponents.count != 8) { | ||
| 50 | + return nil; | ||
| 51 | + } | ||
| 52 | + MRPRDetailViewController *vc = [MRPRDetailViewController new]; | ||
| 53 | + | ||
| 54 | + vc.curMRPR = [MRPR new]; | ||
| 55 | + vc.curMRPR.path = path; | ||
| 56 | + vc.curMRPR.iid = [NSNumber numberWithInteger:[(NSString *)pathComponents.lastObject integerValue]]; | ||
| 57 | + | ||
| 58 | + vc.curProject = [Project new]; | ||
| 59 | + vc.curProject.owner_user_name = vc.curMRPR.des_owner_name; | ||
| 60 | + vc.curProject.name = vc.curMRPR.des_project_name; | ||
| 61 | + | ||
| 62 | + return vc; | ||
| 63 | + } | ||
| 45 | 64 | - (void)viewDidLoad{ | |
| 46 | 65 | [super viewDidLoad]; | |
| 47 | 66 | self.title = [NSString stringWithFormat:@"#%@", _curMRPR.iid.stringValue]; | |
@@ -378,7 +397,7 @@ - (void)goToAddCommentVCToUser:(NSString *)userName{ | |||
| 378 | 397 | vc.curProject = _curProject; | |
| 379 | 398 | vc.requestPath = [NSString stringWithFormat:@"api/user/%@/project/%@/git/line_notes", _curMRPR.des_owner_name, _curMRPR.des_project_name]; | |
| 380 | 399 | vc.requestParams = [@{ | |
| 381 | - @"noteable_type" : @"MergeRequestBean", | ||
| 400 | + @"noteable_type" : [self.curMRPRInfo.mrpr isMR]? @"MergeRequestBean" : @"PullRequestBean", | ||
| 382 | 401 | @"noteable_id" : _curMRPRInfo.mrpr.id, | |
| 383 | 402 | } mutableCopy]; | |
| 384 | 403 | vc.contentStr = userName.length > 0? [NSString stringWithFormat:@"@%@ ", userName]: nil; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,5 @@ | |||
| 13 | 13 | @interface ProjectCommitsViewController : BaseViewController | |
| 14 | 14 | @property (strong, nonatomic) Project *curProject; | |
| 15 | 15 | @property (strong, nonatomic) Commits *curCommits; | |
| 16 | - @property (strong, nonatomic) NSString *ref, *path; | ||
| 17 | 16 | ||
| 18 | 17 | @end | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,10 @@ | |||
| 13 | 13 | #import "FileListViewController.h" | |
| 14 | 14 | #import "FileViewController.h" | |
| 15 | 15 | ||
| 16 | + #import "ProjectCommitsViewController.h" | ||
| 17 | + #import "MRPRDetailViewController.h" | ||
| 18 | + #import "NProjectViewController.h" | ||
| 19 | + | ||
| 16 | 20 | @interface ProjectMemberActivityListViewController () | |
| 17 | 21 | ||
| 18 | 22 | @end | |
@@ -145,13 +149,59 @@ - (void)goToVCWithItem:(HtmlMediaItem *)clickedItem activity:(ProjectActivity *) | |||
| 145 | 149 | vc.curUser = [User userWithGlobalKey:user.global_key]; | |
| 146 | 150 | [self.navigationController pushViewController:vc animated:YES]; | |
| 147 | 151 | } | |
| 152 | + | ||
| 153 | + | ||
| 154 | + }else if ([target_type isEqualToString:@"Depot"]) { | ||
| 155 | + if ([proAct.action_msg isEqualToString:@"删除了"]) { | ||
| 156 | + [self showHudTipStr:@"删除了,不能看了~"]; | ||
| 157 | + }else if ([proAct.action isEqualToString:@"fork"]) { | ||
| 158 | + NSArray *nameComponents = [proAct.depot.name componentsSeparatedByString:@"/"]; | ||
| 159 | + if (nameComponents.count == 2) { | ||
| 160 | + NProjectViewController *vc = [NProjectViewController new]; | ||
| 161 | + vc.myProject = [Project new]; | ||
| 162 | + vc.myProject.owner_user_name = nameComponents[0]; | ||
| 163 | + vc.myProject.name = nameComponents[1]; | ||
| 164 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 165 | + }else{ | ||
| 166 | + [self showHudTipStr:@"没找到 Fork 到哪里去了~"]; | ||
| 167 | + } | ||
| 168 | + }else{ | ||
| 169 | + NSString *ref = proAct.ref? proAct.ref : @"master"; | ||
| 170 | + ProjectCommitsViewController *vc = [ProjectCommitsViewController new]; | ||
| 171 | + vc.curProject = project; | ||
| 172 | + vc.curCommits = [Commits commitsWithRef:ref Path:@""]; | ||
| 173 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 174 | + } | ||
| 175 | + }else if ([target_type isEqualToString:@"PullRequestBean"] || | ||
| 176 | + [target_type isEqualToString:@"MergeRequestBean"] || | ||
| 177 | + [target_type isEqualToString:@"CommitLineNote"]){ | ||
| 178 | + NSString *request_path; | ||
| 179 | + if ([target_type isEqualToString:@"PullRequestBean"]){ | ||
| 180 | + request_path = proAct.pull_request_path; | ||
| 181 | + }else if ([target_type isEqualToString:@"MergeRequestBean"]){ | ||
| 182 | + request_path = proAct.merge_request_path; | ||
| 183 | + }else if ([target_type isEqualToString:@"CommitLineNote"]){ | ||
| 184 | + request_path = proAct.line_note.noteable_url; | ||
| 185 | + } | ||
| 186 | + MRPRDetailViewController *vc = [MRPRDetailViewController vcWithPath:request_path]; | ||
| 187 | + if (vc) { | ||
| 188 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 189 | + }else{ | ||
| 190 | + [self showHudTipStr:@"RequestBean 没找到~"]; | ||
| 191 | + } | ||
| 148 | 192 | }else{ | |
| 149 | - [self showHudTipStr:@"还不能查看详细信息呢~"]; | ||
| 150 | - DebugLog(@"暂时不解析啊:%@--%@", proAct.user.name, proAct.action_msg); | ||
| 193 | + if ([target_type isEqualToString:@"Project"]){//这是什么鬼。。遗留的 type 吧 | ||
| 194 | + [self showHudTipStr:@"还不能查看详细信息呢~"]; | ||
| 195 | + // }else if ([target_type isEqualToString:@"MergeRequestComment"]){//过期类型,已用CommitLineNote替代 | ||
| 196 | + // }else if ([target_type isEqualToString:@"PullRequestComment"]){//过期类型,已用CommitLineNote替代 | ||
| 197 | + // }else if ([target_type isEqualToString:@"ProjectStar"]){//不用解析 | ||
| 198 | + // }else if ([target_type isEqualToString:@"ProjectWatcher"]){//不用解析 | ||
| 199 | + }else if ([target_type isEqualToString:@"QcTask"]){//还不能解析 | ||
| 200 | + [self showHudTipStr:@"还不能查看详细信息呢~"]; | ||
| 201 | + } | ||
| 151 | 202 | } | |
| 152 | 203 | }else{//cell上面第一个Label | |
| 153 | 204 | [self goToUserInfo:[User userWithGlobalKey:[clickedItem.href substringFromIndex:3]]]; | |
| 154 | 205 | } | |
| 155 | 206 | } | |
| 156 | - | ||
| 157 | 207 | @end | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,10 @@ | |||
| 30 | 30 | #import "FileViewController.h" | |
| 31 | 31 | #import "ProjectCommitsViewController.h" | |
| 32 | 32 | ||
| 33 | + #import "ProjectCommitsViewController.h" | ||
| 34 | + #import "MRPRDetailViewController.h" | ||
| 35 | + #import "NProjectViewController.h" | ||
| 36 | + | ||
| 33 | 37 | @interface ProjectViewController () | |
| 34 | 38 | ||
| 35 | 39 | @property (nonatomic, strong) NSMutableDictionary *projectContentDict; | |
@@ -400,9 +404,56 @@ - (void)goToVCWithItem:(HtmlMediaItem *)clickedItem activity:(ProjectActivity *) | |||
| 400 | 404 | vc.curUser = [User userWithGlobalKey:user.global_key]; | |
| 401 | 405 | [self.navigationController pushViewController:vc animated:YES]; | |
| 402 | 406 | } | |
| 407 | + | ||
| 408 | + | ||
| 409 | + }else if ([target_type isEqualToString:@"Depot"]) { | ||
| 410 | + if ([proAct.action_msg isEqualToString:@"删除了"]) { | ||
| 411 | + [self showHudTipStr:@"删除了,不能看了~"]; | ||
| 412 | + }else if ([proAct.action isEqualToString:@"fork"]) { | ||
| 413 | + NSArray *nameComponents = [proAct.depot.name componentsSeparatedByString:@"/"]; | ||
| 414 | + if (nameComponents.count == 2) { | ||
| 415 | + NProjectViewController *vc = [NProjectViewController new]; | ||
| 416 | + vc.myProject = [Project new]; | ||
| 417 | + vc.myProject.owner_user_name = nameComponents[0]; | ||
| 418 | + vc.myProject.name = nameComponents[1]; | ||
| 419 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 420 | + }else{ | ||
| 421 | + [self showHudTipStr:@"没找到 Fork 到哪里去了~"]; | ||
| 422 | + } | ||
| 423 | + }else{ | ||
| 424 | + NSString *ref = proAct.ref? proAct.ref : @"master"; | ||
| 425 | + ProjectCommitsViewController *vc = [ProjectCommitsViewController new]; | ||
| 426 | + vc.curProject = project; | ||
| 427 | + vc.curCommits = [Commits commitsWithRef:ref Path:@""]; | ||
| 428 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 429 | + } | ||
| 430 | + }else if ([target_type isEqualToString:@"PullRequestBean"] || | ||
| 431 | + [target_type isEqualToString:@"MergeRequestBean"] || | ||
| 432 | + [target_type isEqualToString:@"CommitLineNote"]){ | ||
| 433 | + NSString *request_path; | ||
| 434 | + if ([target_type isEqualToString:@"PullRequestBean"]){ | ||
| 435 | + request_path = proAct.pull_request_path; | ||
| 436 | + }else if ([target_type isEqualToString:@"MergeRequestBean"]){ | ||
| 437 | + request_path = proAct.merge_request_path; | ||
| 438 | + }else if ([target_type isEqualToString:@"CommitLineNote"]){ | ||
| 439 | + request_path = proAct.line_note.noteable_url; | ||
| 440 | + } | ||
| 441 | + MRPRDetailViewController *vc = [MRPRDetailViewController vcWithPath:request_path]; | ||
| 442 | + if (vc) { | ||
| 443 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 444 | + }else{ | ||
| 445 | + [self showHudTipStr:@"RequestBean 没找到~"]; | ||
| 446 | + } | ||
| 403 | 447 | }else{ | |
| 404 | - [self showHudTipStr:@"还不能查看详细信息呢~"]; | ||
| 405 | - DebugLog(@"暂时不解析啊:%@--%@", proAct.user.name, proAct.action_msg); | ||
| 448 | + if ([target_type isEqualToString:@"Project"]){//这是什么鬼。。遗留的 type 吧 | ||
| 449 | + [self showHudTipStr:@"还不能查看详细信息呢~"]; | ||
| 450 | + // }else if ([target_type isEqualToString:@"MergeRequestComment"]){//过期类型,已用CommitLineNote替代 | ||
| 451 | + // }else if ([target_type isEqualToString:@"PullRequestComment"]){//过期类型,已用CommitLineNote替代 | ||
| 452 | + // }else if ([target_type isEqualToString:@"ProjectStar"]){//不用解析 | ||
| 453 | + // }else if ([target_type isEqualToString:@"ProjectWatcher"]){//不用解析 | ||
| 454 | + }else if ([target_type isEqualToString:@"QcTask"]){//还不能解析 | ||
| 455 | + [self showHudTipStr:@"还不能查看详细信息呢~"]; | ||
| 456 | + } | ||
| 406 | 457 | } | |
| 407 | 458 | }else{//cell上面第一个Label | |
| 408 | 459 | [self goToUserInfo:[User userWithGlobalKey:[clickedItem.href substringFromIndex:3]]]; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | 19 | @interface ProjectActivity : NSObject | |
| 20 | 20 | @property (readwrite, nonatomic, strong) NSNumber *id; | |
| 21 | - @property (readwrite, nonatomic, strong) NSString *target_type, *action, *action_msg, *type, *ref, *ref_type, *ref_path, *pull_request_title, *merge_request_title, *comment_content; | ||
| 21 | + @property (readwrite, nonatomic, strong) NSString *target_type, *action, *action_msg, *type, *ref, *ref_type, *ref_path, *pull_request_title, *merge_request_title, *comment_content, *merge_request_path, *pull_request_path; | ||
| 22 | 22 | @property (readwrite, nonatomic, strong) User *user, *target_user; | |
| 23 | 23 | @property (readwrite, nonatomic, strong) NSDate *created_at; | |
| 24 | 24 | @property (readwrite, nonatomic, strong) Task *origin_task, *task; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments