Skip to content

Commit 3967524

Browse files
authored
Merge pull request nus-cs2103-AY2021S1#72 from TCQian/Refactor-Email-To-RepoURL-In-Project
Refactors email to repoUrl in project
2 parents a53cd81 + 5904040 commit 3967524

37 files changed

+333
-361
lines changed

docs/AboutUs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ We are a team based in the [School of Computing, National University of Singapor
77

88
[[Visit our homepage](https://ay2021s1-cs2103t-w10-3.github.io/tp/)]
99

10-
You can reach us at the email `seer[at]comp.nus.edu.sg`
10+
You can reach us at the repoUrl `seer[at]comp.nus.edu.sg`
1111

1212
## Project team
1313

docs/DeveloperGuide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Use case ends.
328328
**MSS:**
329329

330330
1. Team leader create a new team member profile.
331-
2. TMTS asks for the details of the team member such as projectName, deadline, email and projectDescription.
331+
2. TMTS asks for the details of the team member such as projectName, deadline, repoUrl and projectDescription.
332332
3. Team leader keys in the details.
333333
4. TMTS stores the team member's profile into the data file.
334334

@@ -353,7 +353,7 @@ Use case ends.
353353
1. Team leader chooses to edit a team member's profile.
354354
2. PTS asks for the projectName of the team member whose profile is to be edited.
355355
3. Team leader keys in the projectName of the team member.
356-
4. TMTS asks for the new information of team member such as projectName, deadline, email and projectDescription.
356+
4. TMTS asks for the new information of team member such as projectName, deadline and repoUrladdress and projectDescription..
357357
5. Team leader keys in the details.
358358
6. TMTS stores the team member's profile into the data file.
359359

docs/UserGuide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ Adds a new teammate to a project
188188
Format: `new NAME p/PHONE_NUMBER e/EMAIL`
189189
- `NAME` refers to the projectName of the teammate
190190
- `PHONE_NUMBER` refers to the teammate's contact number
191-
- `EMAIL` refers to the teammate's email
191+
- `EMAIL` refers to the teammate's repoUrl
192192

193-
Example: `new Lucas p/94311421 e/[email protected]` Instantiates teammate Lucas with the specified contact number and email
193+
Example: `new Lucas p/94311421 e/[email protected]` Instantiates teammate Lucas with the specified contact number and repoUrl
194194

195195
#### Add existing teammates of other projects to participate in this project `involves `
196196
Involves an existing teammate in other projects to the current project

docs/tutorials/RemovingFields.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private Label projectDescription;
7575
...
7676
<Label fx:id="deadline" styleClass="cell_small_label" text="\$deadline" />
7777
<Label fx:id="projectDescription" styleClass="cell_small_label" text="\$projectDescription" />
78-
<Label fx:id="email" styleClass="cell_small_label" text="\$email" />
78+
<Label fx:id="repoUrl" styleClass="cell_small_label" text="\$repoUrl" />
7979
...
8080
```
8181

@@ -94,7 +94,7 @@ In `src/test/data/`, data meant for testing purposes are stored. While keeping t
9494
"projects": [ {
9595
"projectName": "Project with invalid projectName field: Ha!ns Mu@ster",
9696
"deadline": "21-03-2020 00:00:00",
97-
"email": "[email protected]",
97+
"repoUrl": "[email protected]",
9898
"projectDescription": "4th street"
9999
} ]
100100
}

src/main/java/seedu/address/logic/commands/AddCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import static java.util.Objects.requireNonNull;
44
import static seedu.address.logic.parser.CliSyntax.PREFIX_DEADLINE;
5-
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL;
65
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_DESCRIPTION;
76
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_NAME;
87
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_TAG;
8+
import static seedu.address.logic.parser.CliSyntax.PREFIX_REPOURL;
99
import static seedu.address.logic.parser.CliSyntax.PREFIX_TASK;
1010

1111
import seedu.address.logic.commands.exceptions.CommandException;
@@ -23,14 +23,14 @@ public class AddCommand extends Command {
2323
+ "Parameters: "
2424
+ PREFIX_PROJECT_NAME + "PROJECT NAME "
2525
+ PREFIX_DEADLINE + "DEADLINE "
26-
+ PREFIX_EMAIL + "EMAIL "
26+
+ PREFIX_REPOURL + "REPOURL "
2727
+ PREFIX_PROJECT_DESCRIPTION + "PROJECT DESCRIPTION "
2828
+ "[" + PREFIX_PROJECT_TAG + "TAG]...\n"
2929
+ "[" + PREFIX_TASK + "TASK]...\n"
3030
+ "Example: " + COMMAND_WORD + " "
3131
+ PREFIX_PROJECT_NAME + "The Blair project "
3232
+ PREFIX_DEADLINE + "29-02-2020 00:00:00"
33-
+ PREFIX_EMAIL + "johnd@example.com "
33+
+ PREFIX_REPOURL + "http://github.com/a/b.git "
3434
+ PREFIX_PROJECT_DESCRIPTION + "Coding in Greenwich "
3535
+ PREFIX_PROJECT_TAG + "challenging "
3636
+ PREFIX_PROJECT_TAG + "WFH"

src/main/java/seedu/address/logic/commands/EditCommand.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import static java.util.Objects.requireNonNull;
44
import static seedu.address.logic.parser.CliSyntax.PREFIX_DEADLINE;
5-
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL;
65
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_DESCRIPTION;
76
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_NAME;
87
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_TAG;
8+
import static seedu.address.logic.parser.CliSyntax.PREFIX_REPOURL;
99
import static seedu.address.logic.parser.CliSyntax.PREFIX_TASK;
1010
import static seedu.address.model.Model.PREDICATE_SHOW_ALL_PROJECTS;
1111

@@ -22,10 +22,10 @@
2222
import seedu.address.logic.commands.exceptions.CommandException;
2323
import seedu.address.model.Model;
2424
import seedu.address.model.project.Deadline;
25-
import seedu.address.model.project.Email;
2625
import seedu.address.model.project.Project;
2726
import seedu.address.model.project.ProjectDescription;
2827
import seedu.address.model.project.ProjectName;
28+
import seedu.address.model.project.RepoUrl;
2929
import seedu.address.model.tag.ProjectTag;
3030
import seedu.address.model.task.Task;
3131
/**
@@ -41,13 +41,13 @@ public class EditCommand extends Command {
4141
+ "Parameters: INDEX (must be a positive integer) "
4242
+ "[" + PREFIX_PROJECT_NAME + "PROJECTNAME] "
4343
+ "[" + PREFIX_DEADLINE + "DEADLINE] "
44-
+ "[" + PREFIX_EMAIL + "EMAIL] "
44+
+ "[" + PREFIX_REPOURL + "REPOURL] "
4545
+ "[" + PREFIX_PROJECT_DESCRIPTION + "PROJECTDESCRIPTION] "
4646
+ "[" + PREFIX_PROJECT_TAG + "PROJECT TAG]...\n"
4747
+ "[" + PREFIX_TASK + "TASK]...\n"
4848
+ "Example: " + COMMAND_WORD + " 1 "
4949
+ PREFIX_DEADLINE + "29-02-2020 00:00:00 "
50-
+ PREFIX_EMAIL + "johndoe@example.com";
50+
+ PREFIX_REPOURL + "https://github.com/a/a.git";
5151

5252
public static final String MESSAGE_EDIT_PROJECT_SUCCESS = "Edited Project: %1$s";
5353
public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided.";
@@ -98,14 +98,14 @@ private static Project createEditedProject(Project projectToEdit, EditProjectDes
9898

9999
ProjectName updatedProjectName = editProjectDescriptor.getProjectName().orElse(projectToEdit.getProjectName());
100100
Deadline updatedDeadline = editProjectDescriptor.getDeadline().orElse(projectToEdit.getDeadline());
101-
Email updatedEmail = editProjectDescriptor.getEmail().orElse(projectToEdit.getEmail());
101+
RepoUrl updatedRepoUrl = editProjectDescriptor.getRepoUrl().orElse(projectToEdit.getRepoUrl());
102102
ProjectDescription updatedProjectDescription = editProjectDescriptor.getProjectDescription()
103103
.orElse(projectToEdit.getProjectDescription());
104104
Set<ProjectTag> updatedProjectTags = editProjectDescriptor.getProjectTags().orElse(
105105
projectToEdit.getProjectTags());
106106
Set<Task> updatedTasks = editProjectDescriptor.getTasks().orElse(projectToEdit.getTasks());
107107

108-
return new Project(updatedProjectName, updatedDeadline, updatedEmail, updatedProjectDescription,
108+
return new Project(updatedProjectName, updatedDeadline, updatedRepoUrl, updatedProjectDescription,
109109
updatedProjectTags, new HashMap<>(), updatedTasks);
110110
}
111111

@@ -134,7 +134,7 @@ public boolean equals(Object other) {
134134
public static class EditProjectDescriptor {
135135
private ProjectName projectName;
136136
private Deadline deadline;
137-
private Email email;
137+
private RepoUrl repoUrl;
138138
private ProjectDescription projectDescription;
139139
private Set<ProjectTag> projectTags;
140140
private Set<Task> tasks;
@@ -148,7 +148,7 @@ public EditProjectDescriptor() {}
148148
public EditProjectDescriptor(EditProjectDescriptor toCopy) {
149149
setProjectName(toCopy.projectName);
150150
setDeadline(toCopy.deadline);
151-
setEmail(toCopy.email);
151+
setRepoUrl(toCopy.repoUrl);
152152
setProjectDescription(toCopy.projectDescription);
153153
setTags(toCopy.projectTags);
154154
setTasks(toCopy.tasks);
@@ -158,7 +158,7 @@ public EditProjectDescriptor(EditProjectDescriptor toCopy) {
158158
* Returns true if at least one field is edited.
159159
*/
160160
public boolean isAnyFieldEdited() {
161-
return CollectionUtil.isAnyNonNull(projectName, deadline, email, projectDescription, projectTags, tasks);
161+
return CollectionUtil.isAnyNonNull(projectName, deadline, repoUrl, projectDescription, projectTags, tasks);
162162
}
163163

164164
public void setProjectName(ProjectName projectName) {
@@ -177,12 +177,12 @@ public Optional<Deadline> getDeadline() {
177177
return Optional.ofNullable(deadline);
178178
}
179179

180-
public void setEmail(Email email) {
181-
this.email = email;
180+
public void setRepoUrl(RepoUrl repoUrl) {
181+
this.repoUrl = repoUrl;
182182
}
183183

184-
public Optional<Email> getEmail() {
185-
return Optional.ofNullable(email);
184+
public Optional<RepoUrl> getRepoUrl() {
185+
return Optional.ofNullable(repoUrl);
186186
}
187187

188188
public void setProjectDescription(ProjectDescription projectDescription) {
@@ -244,7 +244,7 @@ public boolean equals(Object other) {
244244

245245
return getProjectName().equals(e.getProjectName())
246246
&& getDeadline().equals(e.getDeadline())
247-
&& getEmail().equals(e.getEmail())
247+
&& getRepoUrl().equals(e.getRepoUrl())
248248
&& getProjectDescription().equals(e.getProjectDescription())
249249
&& getProjectTags().equals(e.getProjectTags())
250250
&& getTasks().equals(e.getTasks());

src/main/java/seedu/address/logic/parser/AddCommandParser.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
44
import static seedu.address.logic.parser.CliSyntax.PREFIX_DEADLINE;
5-
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL;
65
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_DESCRIPTION;
76
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_NAME;
87
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_TAG;
8+
import static seedu.address.logic.parser.CliSyntax.PREFIX_REPOURL;
99
import static seedu.address.logic.parser.CliSyntax.PREFIX_TASK;
1010

1111
import java.util.HashMap;
@@ -15,10 +15,10 @@
1515
import seedu.address.logic.commands.AddCommand;
1616
import seedu.address.logic.parser.exceptions.ParseException;
1717
import seedu.address.model.project.Deadline;
18-
import seedu.address.model.project.Email;
1918
import seedu.address.model.project.Project;
2019
import seedu.address.model.project.ProjectDescription;
2120
import seedu.address.model.project.ProjectName;
21+
import seedu.address.model.project.RepoUrl;
2222
import seedu.address.model.tag.ProjectTag;
2323
import seedu.address.model.task.Task;
2424

@@ -34,24 +34,24 @@ public class AddCommandParser implements Parser<AddCommand> {
3434
*/
3535
public AddCommand parse(String args) throws ParseException {
3636
ArgumentMultimap argMultimap =
37-
ArgumentTokenizer.tokenize(args, PREFIX_PROJECT_NAME, PREFIX_DEADLINE, PREFIX_EMAIL,
37+
ArgumentTokenizer.tokenize(args, PREFIX_PROJECT_NAME, PREFIX_DEADLINE, PREFIX_REPOURL,
3838
PREFIX_PROJECT_DESCRIPTION, PREFIX_PROJECT_TAG, PREFIX_TASK);
3939

4040
if (!arePrefixesPresent(argMultimap, PREFIX_PROJECT_NAME,
41-
PREFIX_PROJECT_DESCRIPTION, PREFIX_DEADLINE, PREFIX_EMAIL)
41+
PREFIX_PROJECT_DESCRIPTION, PREFIX_DEADLINE, PREFIX_REPOURL)
4242
|| !argMultimap.getPreamble().isEmpty()) {
4343
throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE));
4444
}
4545

4646
ProjectName projectName = ParserUtil.parseProjectName(argMultimap.getValue(PREFIX_PROJECT_NAME).get());
4747
Deadline deadline = ParserUtil.parseDeadline(argMultimap.getValue(PREFIX_DEADLINE).get());
48-
Email email = ParserUtil.parseEmail(argMultimap.getValue(PREFIX_EMAIL).get());
48+
RepoUrl repoUrl = ParserUtil.parseRepoUrl(argMultimap.getValue(PREFIX_REPOURL).get());
4949
ProjectDescription projectDescription = ParserUtil.projectDescription(argMultimap.getValue(
5050
PREFIX_PROJECT_DESCRIPTION).get());
5151
Set<ProjectTag> projectTagList = ParserUtil.parseTags(argMultimap.getAllValues(PREFIX_PROJECT_TAG));
5252
Set<Task> taskList = ParserUtil.parseTasks(argMultimap.getAllValues(PREFIX_TASK));
5353

54-
Project project = new Project(projectName, deadline, email, projectDescription, projectTagList,
54+
Project project = new Project(projectName, deadline, repoUrl, projectDescription, projectTagList,
5555
new HashMap<>(), taskList);
5656

5757
return new AddCommand(project);

src/main/java/seedu/address/logic/parser/CliSyntax.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class CliSyntax {
88
/* Prefix definitions */
99
public static final Prefix PREFIX_PROJECT_NAME = new Prefix("n/");
1010
public static final Prefix PREFIX_DEADLINE = new Prefix("dl/");
11-
public static final Prefix PREFIX_EMAIL = new Prefix("e/");
11+
public static final Prefix PREFIX_REPOURL = new Prefix("ru/");
1212
public static final Prefix PREFIX_PROJECT_DESCRIPTION = new Prefix("d/");
1313
public static final Prefix PREFIX_PROJECT_TAG = new Prefix("tg/");
1414
public static final Prefix PREFIX_TASK = new Prefix("tk/");

src/main/java/seedu/address/logic/parser/EditCommandParser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import static java.util.Objects.requireNonNull;
44
import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
55
import static seedu.address.logic.parser.CliSyntax.PREFIX_DEADLINE;
6-
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL;
76
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_DESCRIPTION;
87
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_NAME;
98
import static seedu.address.logic.parser.CliSyntax.PREFIX_PROJECT_TAG;
9+
import static seedu.address.logic.parser.CliSyntax.PREFIX_REPOURL;
1010
import static seedu.address.logic.parser.CliSyntax.PREFIX_TASK;
1111

1212
import java.util.Collection;
@@ -34,7 +34,7 @@ public class EditCommandParser implements Parser<EditCommand> {
3434
public EditCommand parse(String args) throws ParseException {
3535
requireNonNull(args);
3636
ArgumentMultimap argMultimap =
37-
ArgumentTokenizer.tokenize(args, PREFIX_PROJECT_NAME, PREFIX_DEADLINE, PREFIX_EMAIL,
37+
ArgumentTokenizer.tokenize(args, PREFIX_PROJECT_NAME, PREFIX_DEADLINE, PREFIX_REPOURL,
3838
PREFIX_PROJECT_DESCRIPTION, PREFIX_PROJECT_TAG, PREFIX_TASK);
3939

4040
Index index;
@@ -53,8 +53,8 @@ public EditCommand parse(String args) throws ParseException {
5353
if (argMultimap.getValue(PREFIX_DEADLINE).isPresent()) {
5454
editProjectDescriptor.setDeadline(ParserUtil.parseDeadline(argMultimap.getValue(PREFIX_DEADLINE).get()));
5555
}
56-
if (argMultimap.getValue(PREFIX_EMAIL).isPresent()) {
57-
editProjectDescriptor.setEmail(ParserUtil.parseEmail(argMultimap.getValue(PREFIX_EMAIL).get()));
56+
if (argMultimap.getValue(PREFIX_REPOURL).isPresent()) {
57+
editProjectDescriptor.setRepoUrl(ParserUtil.parseRepoUrl(argMultimap.getValue(PREFIX_REPOURL).get()));
5858
}
5959
if (argMultimap.getValue(PREFIX_PROJECT_DESCRIPTION).isPresent()) {
6060
editProjectDescriptor.setProjectDescription(ParserUtil.projectDescription(argMultimap

src/main/java/seedu/address/logic/parser/ParserUtil.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
import seedu.address.commons.util.StringUtil;
1111
import seedu.address.logic.parser.exceptions.ParseException;
1212
import seedu.address.model.project.Deadline;
13-
import seedu.address.model.project.Email;
1413
import seedu.address.model.project.ProjectDescription;
1514
import seedu.address.model.project.ProjectName;
15+
import seedu.address.model.project.RepoUrl;
1616
import seedu.address.model.tag.ProjectTag;
1717
import seedu.address.model.task.Task;
1818

@@ -82,18 +82,18 @@ public static ProjectDescription projectDescription(String projectDescription) t
8282
}
8383

8484
/**
85-
* Parses a {@code String email} into an {@code Email}.
85+
* Parses a {@code String repoUrl} into an {@code RepoUrl}.
8686
* Leading and trailing whitespaces will be trimmed.
8787
*
88-
* @throws ParseException if the given {@code email} is invalid.
88+
* @throws ParseException if the given {@code repoUrl} is invalid.
8989
*/
90-
public static Email parseEmail(String email) throws ParseException {
91-
requireNonNull(email);
92-
String trimmedEmail = email.trim();
93-
if (!Email.isValidEmail(trimmedEmail)) {
94-
throw new ParseException(Email.MESSAGE_CONSTRAINTS);
90+
public static RepoUrl parseRepoUrl(String repoUrl) throws ParseException {
91+
requireNonNull(repoUrl);
92+
String trimmedRepoUrl = repoUrl.trim();
93+
if (!RepoUrl.isValidRepoUrl(trimmedRepoUrl)) {
94+
throw new ParseException(RepoUrl.MESSAGE_CONSTRAINTS);
9595
}
96-
return new Email(trimmedEmail);
96+
return new RepoUrl(trimmedRepoUrl);
9797
}
9898

9999
/**

src/main/java/seedu/address/model/project/Email.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)