Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add selection display and visibility toggle logic #214

Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
8ee4d7b
Update codecov coverage repository, gradle and project version
Sep 13, 2021
dc94193
Add profile photo
huizhuansam Sep 20, 2021
027b7ef
Update personal information
huizhuansam Sep 20, 2021
88047d4
Fix CI newline issue
huizhuansam Sep 20, 2021
b2de1f6
Merge pull request #10 from huizhuansam/docs-aboutus
Anonymxtrix Sep 21, 2021
b47a5a0
Add help command documentation
huizhuansam Sep 22, 2021
4d4c7ce
Add add command documentation
huizhuansam Sep 22, 2021
2b1f02b
Merge pull request #1 from AY2122S1-CS2103T-W13-2/master
KishendranVendarKon Sep 22, 2021
899c285
Add profile photo
KishendranVendarKon Sep 22, 2021
957f77b
Update Personal Information
KishendranVendarKon Sep 22, 2021
7716a79
Edit responsibilities
KishendranVendarKon Sep 22, 2021
315559c
Merge pull request #11 from huizhuansam/docs-user-guide
KishendranVendarKon Sep 22, 2021
5908009
Merge pull request #2 from AY2122S1-CS2103T-W13-2/master
KishendranVendarKon Sep 22, 2021
77d6a36
Merge branch 'master' of https://github.com/KishendranVendarKon/tp
KishendranVendarKon Sep 22, 2021
7adefcb
Update role and responsibilities
KishendranVendarKon Sep 22, 2021
df327e7
Merge pull request #13 from KishendranVendarKon/docs-aboutus
huizhuansam Sep 22, 2021
1356681
Merge pull request #3 from AY2122S1-CS2103T-W13-2/master
KishendranVendarKon Sep 22, 2021
8604ca9
Add UG sections: TOC, Quick start, Import
KishendranVendarKon Sep 22, 2021
4c26b4d
Edit hyperlinks
KishendranVendarKon Sep 22, 2021
4363834
Further refine hyperlinks
KishendranVendarKon Sep 22, 2021
c45fec4
Edit quick start guide
KishendranVendarKon Sep 23, 2021
3b01f4e
Merge pull request #14 from KishendranVendarKon/docs-user-guide
huizhuansam Sep 23, 2021
58de568
Add blank line to separate paragraphs
huizhuansam Sep 23, 2021
da89a01
Merge pull request #17 from huizhuansam/docs-fix-formatting
zhoukerrr Sep 23, 2021
c7bd07d
Add UG DG photo
zhoukerrr Sep 27, 2021
d795c5a
Update project title and repo link
huizhuansam Sep 27, 2021
fdbec09
Update scss content to NUSpam
huizhuansam Sep 27, 2021
4716476
Add vscode/eclipse files to .gitignore
Sep 27, 2021
78a728b
Append .settings in .gitignore with / to specify that it is a directory
Sep 27, 2021
3ce70fb
Add Zheng Han's personal information, replace * with - for unordered …
Sep 27, 2021
94dc6e9
Add Deliverables and Deadlines to huizhuan's role
Sep 27, 2021
95a0349
Edit DG
zhoukerrr Sep 27, 2021
a702388
Merge pull request #23 from huizhuansam/update-project-site
zhoukerrr Sep 27, 2021
a4659df
Merge pull request #29 from zhenghanlee/add-AboutMe
zhoukerrr Sep 27, 2021
67d2be5
Merge branch 'AY2122S1-CS2103T-W13-2:master' into master
zhoukerrr Sep 27, 2021
728e7db
Merge branch 'master' into DG
zhoukerrr Sep 27, 2021
67a9ed1
Add profile photo
Anonymxtrix Sep 27, 2021
d3c66b3
Add personal details to AboutUs page
Anonymxtrix Sep 27, 2021
e8511df
Add command format to User Guide
Anonymxtrix Sep 27, 2021
2a4d9d5
Update user guide edit command
Anonymxtrix Sep 27, 2021
3d0f87e
Merge pull request #30 from Zhou-Jiahao-1998/DG
KishendranVendarKon Sep 28, 2021
f92b8f9
Merge pull request #34 from Anonymxtrix/update-about-us
KishendranVendarKon Sep 28, 2021
d58ecaf
Merge pull request #35 from Anonymxtrix/update-user-guide
KishendranVendarKon Sep 28, 2021
f6bd4a8
Format user guide markdown
Sep 28, 2021
c32396b
Update find command in UG
Sep 28, 2021
ae4d7ac
Update find command summary and command label to lower case
Sep 28, 2021
99e56c7
Arrange command in summary in lexicographical order and update new co…
Sep 28, 2021
79d7540
Add example to help summary
Sep 28, 2021
cc6ac02
Update add delete edit commands summary to new syntax
Sep 28, 2021
21cad8a
Merge pull request #36 from zhenghanlee/zhenghan-userguide
Anonymxtrix Sep 28, 2021
5e8d7dc
Fix inconsistencies in user guide
Anonymxtrix Sep 28, 2021
d785c85
Merge pull request #38 from Anonymxtrix/fix-user-guide
solarrabbit99 Sep 28, 2021
81a616e
Update NFR
zhoukerrr Sep 29, 2021
b6f0da8
Add roles
zhoukerrr Sep 29, 2021
6d4ccbb
Add newline at EOF
zhoukerrr Sep 29, 2021
6fc55f7
Update markdown format and CI Status badge for README
Sep 29, 2021
205d76e
Add acknowledgement for AB3 code source
Sep 29, 2021
95a4e8a
Add codecov badge to README
Sep 29, 2021
08d5c07
Merge pull request #40 from Zhou-Jiahao-1998/NFR
zhoukerrr Sep 29, 2021
70d715d
Remove traces of AB3 in README
Sep 29, 2021
af9ff30
Merge branch 'master' into About-Us-Jiahao
zhoukerrr Sep 29, 2021
4b0c559
Change AB3 description to NUSpam for README
Sep 29, 2021
f48fd88
Merge pull request #44 from Zhou-Jiahao-1998/About-Us-Jiahao
huizhuansam Sep 29, 2021
1380b7e
Merge pull request #45 from zhenghanlee/update-readme
KishendranVendarKon Sep 29, 2021
daebe2b
Upgrade gems for docs and add webrick to run docs locally
Oct 6, 2021
f4ceaa5
Add search page for gh page
Oct 6, 2021
d2f442a
Add new line at EOF
Oct 6, 2021
0a7ce3d
Fix trailing whitespaces
Oct 6, 2021
0b63bcd
Extend find command to find with given phone, email or address
Oct 6, 2021
08b7f78
Remove trailing whitespaces in FindCommandParser
Oct 6, 2021
eb65a96
Remove author tags
Oct 6, 2021
6b25a1d
Fix checkstyle for new classes
Oct 6, 2021
a70e0b9
Update tests and add invalid argument handler for FindCommandParser
Oct 6, 2021
dad52ea
Merge pull request #48 from zhenghanlee/docs-local
solarrabbit99 Oct 7, 2021
4a71079
Merge pull request #49 from zhenghanlee/search-page
zhoukerrr Oct 7, 2021
e5aac9d
Merge pull request #51 from zhenghanlee/findcommand-zhenghan
zhoukerrr Oct 7, 2021
ed321ee
Add tags to find
zhoukerrr Oct 7, 2021
95d8c4b
Add portfolio page for huizhuansam
huizhuansam Oct 7, 2021
891761d
Change portfolio link
huizhuansam Oct 7, 2021
8a99ab5
Update Gemfile.lock
huizhuansam Oct 7, 2021
2682067
Fix CI newline
huizhuansam Oct 7, 2021
c4d708a
Update docs app name from AB3 to NUSpam
Anonymxtrix Oct 7, 2021
1e0378a
Add test cases for find tags
zhoukerrr Oct 7, 2021
0af5a04
Update developer guide to NUSpam
Anonymxtrix Oct 7, 2021
8dc2062
Add blank line
zhoukerrr Oct 7, 2021
77b41a4
Add acknowlegements to address book level-3 in docs index.md
Anonymxtrix Oct 7, 2021
01854fa
Relocate logic of combining tag Strings
zhoukerrr Oct 7, 2021
337ee45
Update rules of import function
KishendranVendarKon Oct 7, 2021
f08205b
Merge pull request #56 from Zhou-Jiahao-1998/Find-Tag
zhoukerrr Oct 7, 2021
f1cbea9
Merge pull request #55 from Anonymxtrix/bryan/update-developer-guide
zhoukerrr Oct 7, 2021
8b23bfa
Merge pull request #54 from Anonymxtrix/bryan/update-docs
zhoukerrr Oct 7, 2021
24c07cf
Merge pull request #53 from huizhuansam/docs-fix-portfolio
zhoukerrr Oct 7, 2021
b7d6c34
Add images to UG
KishendranVendarKon Oct 7, 2021
a860cd3
Resize image
KishendranVendarKon Oct 7, 2021
0a93e12
Minor changes
KishendranVendarKon Oct 7, 2021
3d9907e
Add portfolio markdown documents
huizhuansam Oct 7, 2021
86148f1
Update AboutUs
huizhuansam Oct 7, 2021
8b62ac9
Update with requested changes
KishendranVendarKon Oct 7, 2021
aa02221
Merge pull request #59 from huizhuansam/docs-add-portfolios
huizhuansam Oct 7, 2021
a5cd9c2
Merge pull request #58 from KishendranVendarKon/docs-ug-import
zhoukerrr Oct 7, 2021
2c980a1
Add import function
KishendranVendarKon Sep 29, 2021
f63f569
Import command only add person to list if all persons
KishendranVendarKon Sep 29, 2021
512fcf5
Improve code quality
KishendranVendarKon Oct 6, 2021
ad05695
Handle commas in addresses
KishendranVendarKon Oct 6, 2021
93adf2f
Add JUnit tests for Import Command
KishendranVendarKon Oct 6, 2021
3735b9c
Add EOF to test files
KishendranVendarKon Oct 6, 2021
c9d47c2
Remove print statement
KishendranVendarKon Oct 7, 2021
46c9353
Abstract out CsvParser and allow columns to be in any order
KishendranVendarKon Oct 7, 2021
f07bf51
Refactor test cases
KishendranVendarKon Oct 7, 2021
269e5b3
Further abstract import function
KishendranVendarKon Oct 8, 2021
52d383c
Temporarily remove test cases
KishendranVendarKon Oct 8, 2021
b9eb658
Remove import statement from addressBookParserTest
KishendranVendarKon Oct 8, 2021
68fcfbd
Add ability for dependency injection
KishendranVendarKon Oct 11, 2021
9f71fbf
Add minor ammendments
KishendranVendarKon Oct 11, 2021
d33910d
Add Copyable to represent duplicatable classes
Anonymxtrix Oct 11, 2021
fda4c2e
Add History class and Historyable interface
Anonymxtrix Oct 11, 2021
cdcce50
Add listener for up and down key press in input box
Anonymxtrix Oct 11, 2021
71eee45
Add nagivating input history function to UI textfield
Anonymxtrix Oct 11, 2021
2eedae8
Fix bugs with history implementation
Anonymxtrix Oct 11, 2021
a8c7f0c
Fix checkstyle errors
Anonymxtrix Oct 11, 2021
36c656d
Fix CRLF line endings to LF
Anonymxtrix Oct 11, 2021
9bbb707
Add requireNonNull to Snapshot edit method
Anonymxtrix Oct 11, 2021
a8915dc
Add tests for Snapshot and EditedSnapshot
Anonymxtrix Oct 11, 2021
ea168fb
Fix checkstyle problems with SnapshotTest
Anonymxtrix Oct 11, 2021
bd7221f
Add tests for History class
Anonymxtrix Oct 11, 2021
7a590e5
Add find choices
zhoukerrr Oct 12, 2021
c819a02
Merge pull request #50 from KishendranVendarKon/batch-import
zhoukerrr Oct 12, 2021
4e66d26
Merge branch 'master' into Find-result
zhoukerrr Oct 12, 2021
2097449
Merge branch 'master' into Find-result
zhoukerrr Oct 12, 2021
0465583
Make paths OS agnostic
KishendranVendarKon Oct 12, 2021
35caf78
Merge branch 'master' of https://github.com/AY2122S1-CS2103T-W13-2/tp…
KishendranVendarKon Oct 12, 2021
be2518e
Merge branch 'master' into bryan/input-history
Anonymxtrix Oct 12, 2021
cf05a74
Merge pull request #62 from Anonymxtrix/bryan/input-history
zhoukerrr Oct 12, 2021
6fe1d23
Convert from java.swing.JFileChooser to javafx.stage.FileChooser
KishendranVendarKon Oct 12, 2021
030171c
Fix AddCommand usage string
huizhuansam Oct 10, 2021
b6dfd97
Refactor CLI argument prefix
huizhuansam Oct 10, 2021
9400441
Fix EditCommand usage string
huizhuansam Oct 10, 2021
5f80a5a
Fix JavaDocs
huizhuansam Oct 11, 2021
0574e95
Remove whitespace after prefix
huizhuansam Oct 11, 2021
185ea13
Add parser argument sanitation
huizhuansam Oct 11, 2021
9f82c55
Make phone, email, address field optional for Add Command
huizhuansam Oct 11, 2021
88f4573
Make command word case insensitive
huizhuansam Oct 11, 2021
acdae81
Add support for long form prefixes
huizhuansam Oct 11, 2021
c5263ed
Add case insensitive prefix
huizhuansam Oct 11, 2021
6dada1c
Update test cases for address, email, and phone
huizhuansam Oct 12, 2021
ea0d1ea
Fix test cases
huizhuansam Oct 12, 2021
2efded5
Modify tag argument syntax
huizhuansam Oct 12, 2021
58fdbad
Fix code style issue
huizhuansam Oct 12, 2021
8506635
Fix Javadocs
huizhuansam Oct 12, 2021
400bc15
Merge branch 'master' into bryan/input-history-tests
Anonymxtrix Oct 12, 2021
92761ff
Merge pull request #67 from KishendranVendarKon/batch-import
zhoukerrr Oct 12, 2021
c8da9dd
Fix naming convention for methods
huizhuansam Oct 12, 2021
6381301
Merge pull request #60 from huizhuansam/refactor-command-syntax
zhoukerrr Oct 12, 2021
c78d73c
Fix tests based on PR comments
Anonymxtrix Oct 12, 2021
4990058
Merge branch 'master' into bryan/input-history-tests
Anonymxtrix Oct 12, 2021
447719a
Merge pull request #64 from Anonymxtrix/bryan/input-history-tests
zhoukerrr Oct 12, 2021
57168c0
Add input history navigation to user guide
Anonymxtrix Oct 12, 2021
06e703a
Merge pull request #70 from Anonymxtrix/bryan/input-history-documenta…
zhoukerrr Oct 12, 2021
0d997c6
Embed user guide into help page
Oct 12, 2021
8088321
Add EOF line to HelpWindow.fxml
Oct 12, 2021
acdb68d
Merge pull request #71 from zhenghanlee/embed-help
zhoukerrr Oct 12, 2021
73adb5e
Merge pull request #65 from Zhou-Jiahao-1998/Find-result
zhoukerrr Oct 12, 2021
5371da2
Improve find command code quality and throw exception for non-empty p…
Oct 12, 2021
48edf4c
Refractor test cases, temporarily disabled two tests
Oct 12, 2021
3ed89bf
Add CsvParser test
KishendranVendarKon Oct 12, 2021
fb5a03b
Add ImportCommandParser Tests
KishendranVendarKon Oct 13, 2021
65180f1
Merge pull request #72 from zhenghanlee/improve-find
solarrabbit99 Oct 13, 2021
3d03a7c
Refactor user input history logic
Anonymxtrix Oct 15, 2021
305d616
Add test cases for utils.history package
Anonymxtrix Oct 15, 2021
747e2fa
Add tests for ui CommandInput class
Anonymxtrix Oct 15, 2021
0d8333d
Change all line endings from CRLF to LF
Anonymxtrix Oct 15, 2021
e706843
Merge pull request #76 from Anonymxtrix/bryan/refactor-history
zhoukerrr Oct 16, 2021
f367ec8
Add import command test
KishendranVendarKon Oct 18, 2021
3ff2050
Edit importCommandParser to only ensure existence of name column
KishendranVendarKon Oct 13, 2021
e41093a
Merge branch 'master' into temp-2
KishendranVendarKon Oct 18, 2021
0c2323a
Make use of optional instead of null checks
KishendranVendarKon Oct 18, 2021
1a39536
Add handling and test of csv files with blank headers
KishendranVendarKon Oct 19, 2021
9d461d4
Enhance import command's command result
KishendranVendarKon Oct 19, 2021
dc48740
Merge pull request #74 from KishendranVendarKon/import-function-tests
zhoukerrr Oct 19, 2021
1e1ccbb
Add selectedlist to Model and relevant methods
Oct 19, 2021
de67158
Remove .settings folder from git
Oct 19, 2021
7dd07d1
Add selection display and visibility logic
Oct 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/test/java/seedu/address/commons/util/CopyableInt.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package seedu.address.commons.util;

/**
* A utility class that implements the Copyable interface.
*/
public class CopyableInt implements Copyable<CopyableInt> {
public static final CopyableInt COPYABLE_ZERO = new CopyableInt(0);
public static final CopyableInt COPYABLE_ONE = new CopyableInt(1);
public static final CopyableInt COPYABLE_TWO = new CopyableInt(2);
public static final CopyableInt COPYABLE_THREE = new CopyableInt(3);
public static final CopyableInt COPYABLE_FOUR = new CopyableInt(4);

private final int number;

public CopyableInt(int number) {
this.number = number;
}

/**
* Gets the integer that is saved within the instance of CopyableInt.
*
* @return The saved integer.
*/
public int getNumber() {
return number;
}

/**
* Creates a duplicate instance of the CopyableInt.
*
* @return The duplicate instance.
*/
@Override
public CopyableInt copy() {
return new CopyableInt(number);
}
}
66 changes: 66 additions & 0 deletions src/test/java/seedu/address/logic/history/HistoryTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package seedu.address.logic.history;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static seedu.address.commons.util.CopyableInt.COPYABLE_ONE;
import static seedu.address.commons.util.CopyableInt.COPYABLE_THREE;
import static seedu.address.commons.util.CopyableInt.COPYABLE_TWO;
import static seedu.address.commons.util.CopyableInt.COPYABLE_ZERO;

import org.junit.jupiter.api.Test;

import seedu.address.commons.util.CopyableInt;

public class HistoryTest {
private Historyable<CopyableInt> history = new History<>();

protected HistoryTest() {
history.push(COPYABLE_ZERO);
history.push(COPYABLE_ONE);
history.push(COPYABLE_TWO);
}

@Test
void size_success() {
assertEquals(3, history.size());
}

@Test
void go_validInput_success() {
CopyableInt copyableOne = history.go(-1);
assertEquals(COPYABLE_ONE.getNumber(), copyableOne.getNumber());
}

@Test
void go_tooLargeInput_success() {
CopyableInt copyableTwo = history.go(100); // Should return the last pushed item.
assertEquals(COPYABLE_TWO.getNumber(), copyableTwo.getNumber());
}

@Test
void go_tooSmallInput_success() {
CopyableInt copyableZero = history.go(-100); // Should return the first pushed item.
assertEquals(COPYABLE_ZERO.getNumber(), copyableZero.getNumber());
}

@Test
void push_expected_success() {
history.push(COPYABLE_THREE);
CopyableInt currentCopyableInt = history.getCurrentState();
assertNotEquals(COPYABLE_THREE, currentCopyableInt);
assertEquals(COPYABLE_THREE.getNumber(), currentCopyableInt.getNumber());
}

@Test
void push_null_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> history.push(null));
}

@Test
void pop_success() {
CopyableInt poppedCopyableInt = history.pop();
assertNotEquals(COPYABLE_TWO, poppedCopyableInt);
assertEquals(COPYABLE_TWO.getNumber(), poppedCopyableInt.getNumber());
}
}
74 changes: 74 additions & 0 deletions src/test/java/seedu/address/logic/history/SnapshotTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package seedu.address.logic.history;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

import org.junit.jupiter.api.Test;

import seedu.address.commons.util.CopyableInt;

public class SnapshotTest {
@Test
public void constructor_expected_success() {
CopyableInt copyableInt = new CopyableInt(0);
Snapshot<CopyableInt> snapshot = new Snapshot<>(copyableInt);
assertNotEquals(copyableInt, snapshot.getState());
assertEquals(copyableInt.getNumber(), snapshot.getState().getNumber());
}

@Test
public void getState_expected_success() {
int expectedState = 0;
CopyableInt copyableInt = new CopyableInt(expectedState);
Snapshot<CopyableInt> snapshot = new Snapshot<>(copyableInt);
assertEquals(expectedState, snapshot.getState().getNumber());
}

@Test
public void getState_null_throwsNullPointerException() {
assertThrows(NullPointerException.class, () -> new Snapshot<>(null));
}

@Test
public void restore_originalSnapshot_success() {
int expectedState = 0;
CopyableInt copyableInt = new CopyableInt(expectedState);
Snapshot<CopyableInt> snapshot = new Snapshot<>(copyableInt);
Snapshot<CopyableInt> restoredSnapshot = snapshot.restore();
assertNotEquals(snapshot, restoredSnapshot);
assertEquals(expectedState, restoredSnapshot.getState().getNumber());
}

@Test
public void restore_editedSnapshot_success() {
int originalState = 0;
int editedState = 1;
CopyableInt originalCopyableInt = new CopyableInt(originalState);
CopyableInt editedCopyableInt = new CopyableInt(editedState);
Snapshot<CopyableInt> snapshot = new Snapshot<>(originalCopyableInt);
Snapshot<CopyableInt> editedSnapshot = snapshot.edit(editedCopyableInt);
Snapshot<CopyableInt> restoredSnapshot = editedSnapshot.restore();
assertNotEquals(snapshot, restoredSnapshot);
assertEquals(originalState, restoredSnapshot.getState().getNumber());
}

@Test
public void edit_expected_success() {
int originalState = 0;
int editedState = 1;
CopyableInt originalCopyableInt = new CopyableInt(originalState);
CopyableInt editedCopyableInt = new CopyableInt(editedState);
Snapshot<CopyableInt> snapshot = new Snapshot<>(originalCopyableInt);
Snapshot<CopyableInt> editedSnapshot = snapshot.edit(editedCopyableInt);
assertNotEquals(snapshot, editedSnapshot);
assertNotEquals(snapshot.getState(), editedSnapshot.getState());
assertNotEquals(snapshot.getState().getNumber(), editedSnapshot.getState().getNumber());
}

@Test
public void edit_null_throwsNullPointerException() {
Snapshot<CopyableInt> snapshot = new Snapshot<>(new CopyableInt(0));
assertThrows(NullPointerException.class, () -> snapshot.edit(null));
}
}