Skip to content

Commit ca81695

Browse files
committed
Improved UIs and added demo to readme
1 parent 1c23b28 commit ca81695

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,29 @@ Each of us have created one or more PRs and most of these have been merged into
1111

1212
![image](https://user-images.githubusercontent.com/18428059/202935072-ba09587d-c67d-4599-9986-9c652480356f.png)
1313

14+
### Profile display
15+
- By Parmis
16+
- Implemented by UserSearchUI, which allows a user to type in a user's username to view their features (user and username so far).
17+
- User information is captured using ChangeController interface, which uses UserDatabse interfaces to retrieve the user of interest:
18+
![img.png](img.png)
19+
- Here, Alex123 is not a user of the chat system:
20+
![img_1.png](img_1.png)
21+
- parmis is a user of the chat system though:
22+
![img_2.png](img_2.png)
23+
24+
### Profile feature modification
25+
- By Parmis
26+
- Implemented by UserMdoificationUI, which allows a user to verify their authority to access their account by confirming their username and password, and then choosing the feature they wish to modify, and enter the new value for it.
27+
- User information is captured using UserPresenter interface, which uses UserAuthenticationI to confirm user's authority to make the change, then uses Changeable interface (use case) to make the changes to the User entity, and finally uses UserModificationGateway to relay the changed info to UserDatabase:
28+
![img_3.png](img_3.png)
29+
- Here: Parmis's password is actually 123, so she doesn't get the chance to change her email:
30+
![img_4.png](img_4.png)
31+
- as you can see, her email is unchanged.
32+
- now she enters the right password and tries again:
33+
![img_5.png](img_5.png)
34+
- This time, change was successful. She could use this tool to similarly change her username or password too:
35+
![img_6.png](img_6.png)
36+
1437

1538
## Template Readme
1639
This is a template repository for CSC 207 projects.

src/main/java/entities/user_entities/User.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package entities.user_entities;
22

33
import entities.chat.Chat;
4+
import interface_adapters.profile_modification_IA.UserAuthenticationI;
45
import interface_adapters.login_interface_adapters.Login;
56
import use_cases.user_attribute_modification_use_case.Changeable;
67
import interface_adapters.app_screen_interface_adapters.UserAppScreenGateway;
@@ -9,7 +10,7 @@
910
import java.io.Serializable;
1011
import java.util.ArrayList;
1112

12-
public abstract class User implements Serializable, Changeable, Login {
13+
public abstract class User implements Serializable, Changeable, Login, UserAuthenticationI {
1314
protected String username;
1415
protected String password;
1516
protected String email;
@@ -48,6 +49,7 @@ public void changeFeature(String feature, String newFeature){
4849
}
4950
}
5051

52+
@Override
5153
public Boolean PasswordMatch(String attempt){
5254
return (this.getPassword().equals(attempt));
5355
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package interface_adapters.profile_modification_IA;
2+
3+
// allows for ChangeController to authenticate user's username and password.
4+
5+
public interface UserAuthenticationI {
6+
public Boolean PasswordMatch(String attempt);
7+
}

src/main/java/screens/Profile_screen/UserSearchUI.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public void actionPerformed(ActionEvent e) {
3131
}
3232

3333
});
34+
frame.setTitle("User Search Tool");
3435
frame.add(field);
3536
label = new JLabel();
3637
frame.add(label);

src/main/java/screens/profile_update_screen/UserModificationUI.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public void actionPerformed(ActionEvent e) {
6262

6363
label = new JLabel();
6464

65+
frame.setTitle("Profile Editor Tool");
6566
frame.add(usernameField);
6667
frame.add(passwordField);
6768
frame.add(cb);

0 commit comments

Comments
 (0)