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

New UI, refactoring and small fixes #86

Closed

Conversation

jianhandev
Copy link

UI Changes:

  • Changed UI theme to white
  • New layout (tab pane -> dashboard, patient, appointment tabs etc)
  • Automatic tab switching upon entering command

Logic component changes:

  • Refactor classes related to patient into a separate patient package

Small fixes:

  • Style issues (e.g. import statements, javadoc)
  • Bug fixes

Note: Added an "dummy" appointment class (for testing the rest of the app) - to be removed.

Screenshot 2020-10-04 at 7 14 19 PM

@jianhandev jianhandev added this to the v1.2 milestone Oct 6, 2020
@jianhandev jianhandev self-assigned this Oct 6, 2020
@jianhandev jianhandev linked an issue Oct 6, 2020 that may be closed by this pull request
Copy link

@kaitlynng kaitlynng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, mostly need to change command names and clarify a bit more on TAB_ID. Would be good if there's another reviewer too.

@@ -8,6 +9,8 @@
*/
public abstract class Command {

public static final Index TAB_ID = Index.fromOneBased(3);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have an enum for TAB_ID instead to make it more clear.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, can you explain what is the TAB_ID used for in the Command class actually? Is it only relevant in the CommandResult class?

@@ -17,21 +19,25 @@
/** The application should exit. */
private final boolean exit;

/** Switch to the tab indicated by tabId */
private final Index tabId;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be confusing to have TAB_ID in Command.java and tabId in CommandResult.java? Maybe more descriptive name like tabIdToSwitchTo can help.

import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.person.Person;

/**
* Adds a person to the address book.
*/
public class AddCommand extends Command {
public class AddPatientCommand extends Command {

public static final String COMMAND_WORD = "add";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the command word be 'add' or 'add patient'? Since we've changed the AddCommand to AddPatientCommand, and we need to consider adding appointments too.

Copy link

@porkeypine porkeypine Oct 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! I think it will be addpatient based on our user guide.

@@ -41,7 +43,7 @@
/**
* Creates an AddCommand to add the specified {@code Person}
*/
public AddCommand(Person person) {
public AddPatientCommand(Person person) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should rename 'Person' to 'Patient' (but I think this is model people's job)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, we'll do that in the next PR!

@@ -13,11 +16,10 @@
public static final String COMMAND_WORD = "clear";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since AddCommand was changed to AddPatientCommand, maybe ClearCommand should be changed to be more descriptive also? i.e. change to ClearAllPatientsCommand.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

import seedu.address.model.person.Name;
import seedu.address.model.person.Person;
import seedu.address.model.person.Phone;
import seedu.address.model.person.Remark;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't add a comment at the required line, but maybe we can rename this command to EditPatientCommand instead to align with AddPatientCommand? Also because we are probably adding capabilities or editing appointments right, so will need to clarify what we're editing.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will also need to remember to edit the MESSAGE_USAGE to reflect patient parameters.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed


import static java.util.Objects.requireNonNull;

import seedu.address.commons.core.Messages;
import seedu.address.logic.commands.Command;
import seedu.address.logic.commands.CommandResult;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, should we rename to FindPatientCommand?


import static java.util.Objects.requireNonNull;
import static seedu.address.model.Model.PREDICATE_SHOW_ALL_PERSONS;

import seedu.address.commons.core.index.Index;
import seedu.address.logic.commands.Command;
import seedu.address.logic.commands.CommandResult;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, should we change this to ListPatientsCommand? I'm not very sure because then now we'll have the 'Patient' in every command which is a lot more verbose, but it also makes the command clearer.

Copy link

@porkeypine porkeypine Oct 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, because we will have various ListAppointmentsCommands, like listing all appointment of a specific patient!

ArgumentMultimap argMultimap =
ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_ADDRESS, PREFIX_TAG,
PREFIX_REMARK);

if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_EMAIL, PREFIX_REMARK)
if (!arePrefixesPresent(argMultimap, PREFIX_NAME, PREFIX_ADDRESS, PREFIX_PHONE, PREFIX_EMAIL)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is PREFIX_REMARK removed?


import seedu.address.commons.core.index.Index;
import seedu.address.logic.commands.Command;
import seedu.address.logic.commands.CommandResult;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have RemarkCommand for both patient and appointment? so we split into RemarkPatientCommand and RemarkAppointmentCommand

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appointment class already has a String description, is that good enough?

@@ -13,7 +14,7 @@

@Override
public CommandResult execute(Model model) {
return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, true);
return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, true, TAB_ID);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TAB_ID needs to be declared as a public static final constant above right?

@kaitlynng kaitlynng closed this Oct 7, 2020
@kaitlynng kaitlynng reopened this Oct 7, 2020
@jianhandev jianhandev closed this Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change UI layout and give the application a white interface
3 participants