| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f339848 commit bffe241
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -167,6 +167,16 @@ - (void)goToVCWithItem:(HtmlMediaItem *)clickedItem activity:(ProjectActivity *) | |||
| 167 | 167 | }else{ | |
| 168 | 168 | linkPath = proAct.wiki_path; | |
| 169 | 169 | } | |
| 170 | + }else if ([target_type isEqualToString:@"BranchMember"]){ | ||
| 171 | + if ([@[@"add", @"remove"] containsObject:proAct.action]) { | ||
| 172 | + linkPath = [NSString stringWithFormat:@"/u/%@", proAct.target_user.global_key]; | ||
| 173 | + }else{//deny_push/allow_push | ||
| 174 | + ProjectViewController *vc = [ProjectViewController codeVCWithCodeRef:proAct.ref_name andProject:project]; | ||
| 175 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 176 | + } | ||
| 177 | + }else if ([target_type isEqualToString:@"ProtectedBranch"]){ | ||
| 178 | + ProjectViewController *vc = [ProjectViewController codeVCWithCodeRef:proAct.ref_name andProject:project]; | ||
| 179 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 170 | 180 | }else{ | |
| 171 | 181 | if ([target_type isEqualToString:@"Project"]){//转让项目之类的 | |
| 172 | 182 | // }else if ([target_type isEqualToString:@"MergeRequestComment"]){//过期类型,已用CommitLineNote替代 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -551,6 +551,16 @@ - (void)goToVCWithItem:(HtmlMediaItem *)clickedItem activity:(ProjectActivity *) | |||
| 551 | 551 | }else{ | |
| 552 | 552 | linkPath = proAct.wiki_path; | |
| 553 | 553 | } | |
| 554 | + }else if ([target_type isEqualToString:@"BranchMember"]){ | ||
| 555 | + if ([@[@"add", @"remove"] containsObject:proAct.action]) { | ||
| 556 | + linkPath = [NSString stringWithFormat:@"/u/%@", proAct.target_user.global_key]; | ||
| 557 | + }else{//deny_push/allow_push | ||
| 558 | + ProjectViewController *vc = [ProjectViewController codeVCWithCodeRef:proAct.ref_name andProject:project]; | ||
| 559 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 560 | + } | ||
| 561 | + }else if ([target_type isEqualToString:@"ProtectedBranch"]){ | ||
| 562 | + ProjectViewController *vc = [ProjectViewController codeVCWithCodeRef:proAct.ref_name andProject:project]; | ||
| 563 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 554 | 564 | }else{ | |
| 555 | 565 | if ([target_type isEqualToString:@"Project"]){//转让项目之类的 | |
| 556 | 566 | // }else if ([target_type isEqualToString:@"MergeRequestComment"]){//过期类型,已用CommitLineNote替代 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | @interface ProjectActivity : NSObject | |
| 22 | 22 | @property (readwrite, nonatomic, strong) NSNumber *id; | |
| 23 | - @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, *version, *wiki_title, *wiki_path, *old_name; | ||
| 23 | + @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, *version, *wiki_title, *wiki_path, *old_name, *ref_name; | ||
| 24 | 24 | @property (readwrite, nonatomic, strong) User *user, *target_user, *watcher; | |
| 25 | 25 | @property (readwrite, nonatomic, strong) NSDate *created_at; | |
| 26 | 26 | @property (readwrite, nonatomic, strong) Task *origin_task, *task; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -138,6 +138,15 @@ - (NSMutableString *)actionStr{ | |||
| 138 | 138 | if ([_action isEqualToString:@"comment"]) { | |
| 139 | 139 | [_actionStr appendFormat:@"「%@」", _project_topic.parent.title]; | |
| 140 | 140 | } | |
| 141 | + }else if ([_target_type isEqualToString:@"BranchMember"]){ | ||
| 142 | + if ([@[@"add", @"remove"] containsObject:_action]) { | ||
| 143 | + [_actionStr appendString:@"分支管理员"]; | ||
| 144 | + }else{//deny_push/allow_push | ||
| 145 | + [self addActionUser:self.target_user]; | ||
| 146 | + [_actionStr appendString:@"直接 Push 保护分支"]; | ||
| 147 | + } | ||
| 148 | + }else if ([_target_type isEqualToString:@"ProtectedBranch"]){ | ||
| 149 | + // enable_protected_branch/allow_force_push/disable_protected_branch | ||
| 141 | 150 | }else if ([_target_type isEqualToString:@"ProjectFile"]){ | |
| 142 | 151 | if ([_action isEqualToString:@"rename"]) { | |
| 143 | 152 | [_actionStr appendString:@"修改了文件名称"]; | |
@@ -259,6 +268,14 @@ - (NSMutableString *)contentStr{ | |||
| 259 | 268 | [_contentStr appendFormat:@"%@", _wiki_title]; | |
| 260 | 269 | }else if ([_target_type isEqualToString:@"ProjectTweet"]){ | |
| 261 | 270 | [_contentStr saveAppendString:_content]; | |
| 271 | + }else if ([_target_type isEqualToString:@"BranchMember"]){ | ||
| 272 | + if ([@[@"add", @"remove"] containsObject:_action]) { | ||
| 273 | + [_contentStr saveAppendString:self.target_user.name]; | ||
| 274 | + }else{//deny_push/allow_push | ||
| 275 | + [_contentStr saveAppendString:self.ref_name]; | ||
| 276 | + } | ||
| 277 | + }else if ([_target_type isEqualToString:@"ProtectedBranch"]){ | ||
| 278 | + [_contentStr saveAppendString:self.ref_name]; | ||
| 262 | 279 | }else{ | |
| 263 | 280 | [_contentStr appendString:@"**未知**"]; | |
| 264 | 281 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments