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

[CS2103T-T10-3] WorkBook #102

Open
wants to merge 386 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
386 commits
Select commit Hold shift + click to select a range
8fdc41f
Update app version number
jacobkwan Oct 21, 2022
bb5ad97
Merge pull request #74 from jacobkwan/update-app-version
rylzxc Oct 21, 2022
ee57cee
Add use case for undo command to Developer Guide
adeearyaa Oct 21, 2022
020bf97
Update Developer Guide
rylzxc Oct 21, 2022
f6610a5
Merge pull request #76 from rylzxc/branch-update-dg
jacobkwan Oct 21, 2022
2982772
Fix grammar issues for use case
adeearyaa Oct 21, 2022
7ea1d08
Merge pull request #75 from adeearyaa/add-use-case-to-DG
jacobkwan Oct 21, 2022
7132449
Add 3 user stories and 1 use case to DG
glemenneo Oct 21, 2022
373d8c0
Add Redo Command
tienyu2000 Oct 21, 2022
a9b22f2
Add redo use case and update DeveloperGuide.md
tienyu2000 Oct 21, 2022
9e2b25d
Add redo user story
tienyu2000 Oct 21, 2022
8aaf5aa
Merge pull request #78 from tienyu2000/branch-Redo-Command
rylzxc Oct 21, 2022
cae0402
Merge pull request #79 from tienyu2000/branch-Update-DG
rylzxc Oct 21, 2022
10b8e3b
Merge branch 'master' into branch-updateDG
rylzxc Oct 21, 2022
5d378ba
Merge pull request #77 from glemenneo/branch-updateDG
rylzxc Oct 21, 2022
502f4a5
Fix company and roles attribute naming convention
adeearyaa Oct 22, 2022
e9737aa
Add vscode folder to .gitignore
jacobkwan Oct 23, 2022
b7a5059
Add role, stage and DateTime attribute test files
adeearyaa Oct 23, 2022
4462b1e
Change behaviour of Edit to not reset filtering
jacobkwan Oct 23, 2022
5cda869
Add util methods to DateTime to support comparison
jacobkwan Oct 23, 2022
e013d28
Ensure internship list is always sorted
jacobkwan Oct 23, 2022
e667023
Update sample data
jacobkwan Oct 23, 2022
98a65cc
Fix test cases and stick to DRY principle
adeearyaa Oct 24, 2022
a3384e2
Fix more test cases
jacobkwan Oct 24, 2022
457f020
Enhance `Stage` feature
rylzxc Oct 24, 2022
5721c5a
Update message displayed for added internships
rylzxc Oct 24, 2022
60dbec7
Fix method names
adeearyaa Oct 24, 2022
206c511
Merge pull request #81 from adeearyaa/fix-naming-convention-and-testing
jacobkwan Oct 24, 2022
91463fb
Reshuffle elements in internship card, add non functional tips button
glemenneo Oct 24, 2022
5b4e965
Merge pull request #83 from jacobkwan/add-sorting-by-date
rylzxc Oct 24, 2022
f29ed81
Add `StageUtil` class
rylzxc Oct 24, 2022
16a3372
Code Cleanup
rylzxc Oct 25, 2022
c0b01c8
Fix Testcase
rylzxc Oct 25, 2022
fa93356
Fix CheckStyle and add hyperlinks as comments
rylzxc Oct 25, 2022
799f4e9
Add new dynamic tip window to each internship card, functionality WIP
glemenneo Oct 25, 2022
3f30d78
Merge branch 'master' into branch-internshipCardTips
glemenneo Oct 25, 2022
ca18a75
Fix coding standards
rylzxc Oct 25, 2022
3fc81a3
Merge pull request #86 from rylzxc/branch-enhance-stage-feature
rylzxc Oct 25, 2022
2619d9e
Add filter functionality for role and stage as well
adeearyaa Oct 25, 2022
6159451
Add Javadocs to method
adeearyaa Oct 25, 2022
f02d66f
Add test files and fix bugs
adeearyaa Oct 26, 2022
3b66ba5
Merge branch 'master' into branch-internshipCardTips
glemenneo Oct 26, 2022
2248bec
Fix minor naming conventions
adeearyaa Oct 26, 2022
c05c3c8
Merge pull request #87 from adeearyaa/filter-by-role-and-stage
jacobkwan Oct 26, 2022
14a1fcf
Change method to accept stage, move map populator to static initialisor
glemenneo Oct 26, 2022
027911d
Finish tips window for stages that have specific tips
glemenneo Oct 26, 2022
dbde8b0
Remove constructor and redundant methods in StageUtil.java
glemenneo Oct 26, 2022
ff85952
Remove redundant method in StageUtil.java
glemenneo Oct 26, 2022
6f3a8f2
Add Language tags
jacobkwan Oct 26, 2022
37a696e
Add specific styling for Language Tags
jacobkwan Oct 26, 2022
f82c4ce
Fix test cases
jacobkwan Oct 26, 2022
a583232
Fix CheckStyle errors
glemenneo Oct 26, 2022
72255b7
Merge pull request #88 from glemenneo/branch-internshipCardTips
rylzxc Oct 26, 2022
b58c062
Merge pull request #89 from jacobkwan/add-language-tags
rylzxc Oct 26, 2022
c9ebc09
Fix find command
adeearyaa Oct 27, 2022
bc1aa43
Add responsive UI, tip window when window is resized to be wide
glemenneo Oct 27, 2022
0c02801
Merge pull request #90 from adeearyaa/Fix-filter-bugs
jacobkwan Oct 27, 2022
5d3d8a6
Update sample data for new users
jacobkwan Oct 27, 2022
44eb965
Move stage in internship card to match level of company title
glemenneo Oct 27, 2022
4840ce8
Fix CheckStyle errors and add JavaDocs
glemenneo Oct 27, 2022
b1286fe
Merge pull request #92 from glemenneo/branch-responsiveUi
jacobkwan Oct 27, 2022
30274a4
Put first card into focus upon app start
jacobkwan Oct 27, 2022
d1d3be0
Refine ui further
jacobkwan Oct 27, 2022
9cd3547
Merge pull request #91 from jacobkwan/update-sample-data
jacobkwan Oct 27, 2022
545db59
Merge pull request #93 from jacobkwan/refine-responsive-ui
jacobkwan Oct 27, 2022
a51e2e5
Add missing commands to help window
jacobkwan Oct 27, 2022
cecf142
Merge pull request #94 from jacobkwan/update-hint-add-command
glemenneo Oct 28, 2022
b07c378
Update UG
rylzxc Oct 28, 2022
de75b91
Add find command to user guide
adeearyaa Oct 28, 2022
caa94d2
Merge pull request #97 from adeearyaa/Update-User-Guide
jacobkwan Oct 28, 2022
0be58b8
Update UML diagrams and DG
tienyu2000 Oct 28, 2022
98600b0
Update UML diagrams and DG
tienyu2000 Oct 28, 2022
d38ff94
Update UG with undo and redo features
tienyu2000 Oct 28, 2022
308f52e
Merge pull request #99 from tienyu2000/master
rylzxc Oct 28, 2022
6629389
Merge branch 'master' into branch-update-ug
rylzxc Oct 28, 2022
9dfe561
Merge pull request #96 from rylzxc/branch-update-ug
rylzxc Oct 28, 2022
11bf378
Update user guide
jacobkwan Oct 28, 2022
9610700
Update Ui.png
jacobkwan Oct 28, 2022
b71a27a
Merge pull request #100 from jacobkwan/update-ug
rylzxc Oct 28, 2022
fa1f128
Fix UG and documentation
jacobkwan Oct 31, 2022
88c2a73
Fix validation bug on tags and related tests
jacobkwan Oct 31, 2022
fa275e1
Merge pull request #98 from tienyu2000/branch-Update-DG
rylzxc Oct 31, 2022
e53c7fe
Merge pull request #144 from jacobkwan/fix-ug-bugs
rylzxc Oct 31, 2022
5de6a18
Update User Guide
rylzxc Oct 31, 2022
30d934b
Update UG
rylzxc Oct 31, 2022
42d18b3
Update UG
rylzxc Oct 31, 2022
8ae54dd
Update UG
rylzxc Oct 31, 2022
0bafccd
Fix `DateTime` to not allow invalid dates
rylzxc Oct 31, 2022
462016b
Minor updates to UG
rylzxc Oct 31, 2022
1c18413
Minor UG fix
rylzxc Oct 31, 2022
d6207c0
Merge pull request #145 from rylzxc/branch-update-ug-issues
jacobkwan Oct 31, 2022
bb8a3fc
Fix TOC for UG
rylzxc Oct 31, 2022
44c618f
Add emoji to UG
rylzxc Oct 31, 2022
ea406f1
Fix grammar and formatting issues in UG
rylzxc Oct 31, 2022
ad3240e
Fix `find` under 'What you can do'
rylzxc Oct 31, 2022
f3e3dec
Merge pull request #146 from rylzxc/branch-update-ug-issues
rylzxc Oct 31, 2022
1916bf1
Fix TOC in UG
rylzxc Oct 31, 2022
8be861e
Merge pull request #149 from rylzxc/branch-update-ug-issues
adeearyaa Nov 1, 2022
957a29c
Fix user guide
adeearyaa Nov 1, 2022
8d564e3
Fix user guide use cases and other errors
adeearyaa Nov 1, 2022
a45b7b8
Fix typos in user guide
adeearyaa Nov 1, 2022
674ee5e
Merge pull request #150 from adeearyaa/Fix-user-guide
rylzxc Nov 1, 2022
a80e960
Fix numbering for TOC
rylzxc Nov 1, 2022
761d770
Add newline at EOF for _layout.scss
rylzxc Nov 1, 2022
de2b99b
Merge pull request #151 from rylzxc/branch-update-ug
jacobkwan Nov 1, 2022
5484ccd
Add narrow Ui example photo in UG Getting Started section
glemenneo Nov 1, 2022
da523c2
Update narrow Ui example photo to have less clipping
glemenneo Nov 1, 2022
3efb331
Add section on responsive Ui to UG
glemenneo Nov 1, 2022
48ed282
Replace html image embedding in UG for Ui examples
glemenneo Nov 1, 2022
b93e877
Add section in UG on how to view tips
glemenneo Nov 1, 2022
e9a4034
Change 6.11 section header
glemenneo Nov 1, 2022
b0ccff1
Update UG Introduction and Getting Started
rylzxc Nov 2, 2022
72358d4
Update SortExample image
rylzxc Nov 2, 2022
87492e5
Add gif to responsive Ui section
glemenneo Nov 2, 2022
fb2dbf9
Add anchor links to tips section
glemenneo Nov 2, 2022
f051294
Make changes to UG
glemenneo Nov 2, 2022
73000c3
Update UG with redo and undo features
tienyu2000 Nov 2, 2022
eb5875c
Shift undo and redo caution to become a tip
tienyu2000 Nov 2, 2022
52554fe
Add images to enhance undo and redo features in UG
tienyu2000 Nov 3, 2022
9b69b9b
Update description
tienyu2000 Nov 3, 2022
dcd82ab
Update undo and redo feature description
tienyu2000 Nov 3, 2022
942201c
Update PPP
tienyu2000 Nov 3, 2022
eac7c69
Merge pull request #153 from rylzxc/branch-update-ug
jacobkwan Nov 4, 2022
1e6cd2d
Fix typo and added example images under Responsive UI section
glemenneo Nov 4, 2022
413559a
Merge branch 'master' into branch-updateUG
glemenneo Nov 4, 2022
01de9b4
Move wide layout image above narrow layout image
glemenneo Nov 4, 2022
67ab18b
Update PPP
jacobkwan Nov 4, 2022
a3861a7
Merge pull request #155 from tienyu2000/branch-Update-PPP
rylzxc Nov 4, 2022
9103852
Add annotated picture for narrow ui and moved images around
glemenneo Nov 4, 2022
d1b6155
Update docs/team/jacobkwan.md
jacobkwan Nov 4, 2022
10298b8
Update role to UI/UX, update PPP with contributions
glemenneo Nov 4, 2022
db09292
Merge pull request #156 from jacobkwan/update-ppp
rylzxc Nov 4, 2022
ed0b214
Update PPP
rylzxc Nov 4, 2022
7eb0618
Add contributions to PPP
glemenneo Nov 4, 2022
8ff125d
Merge pull request #158 from rylzxc/branch-update-ppp
jacobkwan Nov 4, 2022
670af70
Merge pull request #157 from glemenneo/branch-updatePPP
jacobkwan Nov 4, 2022
9933df1
Update PPP
adeearyaa Nov 4, 2022
f224314
Fix bugs
adeearyaa Nov 4, 2022
8c6ad0e
Merge pull request #159 from adeearyaa/Update-PPP
tienyu2000 Nov 4, 2022
f9b0f4c
Merge pull request #160 from adeearyaa/Fix-PED-Bugs
rylzxc Nov 4, 2022
40a7a95
Change narrow ui example pic under responsive ui
glemenneo Nov 5, 2022
682e0c1
Fix spam clicking lightbulb button tips window bug
glemenneo Nov 5, 2022
21acfbe
Update DG for add command
rylzxc Nov 5, 2022
d5f9293
Merge pull request #152 from glemenneo/branch-updateUG
rylzxc Nov 5, 2022
4e49775
Merge pull request #154 from tienyu2000/branch-Update-UG
rylzxc Nov 5, 2022
0bdd9e2
Add Images UG
adeearyaa Nov 6, 2022
13e16d6
Improve UG for `add`
rylzxc Nov 6, 2022
a934f8a
Delete example from UG
adeearyaa Nov 6, 2022
06c7b65
Add newline after EOF
rylzxc Nov 6, 2022
d8da84d
Fix UG bugs
adeearyaa Nov 6, 2022
0d2c11a
Update add and edit commands
rylzxc Nov 6, 2022
c735de7
Merge pull request #164 from adeearyaa/Add-Images-UG
jacobkwan Nov 6, 2022
7d88d03
Enhance UG
rylzxc Nov 6, 2022
f6fcdf5
Merge pull request #162 from rylzxc/branch-update-dg-add-command
jacobkwan Nov 6, 2022
460ea0c
Rebuild UI components to fix padding and clipping bugs
glemenneo Nov 6, 2022
c963f1e
Merge pull request #165 from rylzxc/branch-update-ug-add
jacobkwan Nov 6, 2022
c59ce07
Update header links in UG and fix bugs
jacobkwan Nov 6, 2022
d1562ab
Update testcases
rylzxc Nov 6, 2022
c38ebb8
Remove unused import in `Tag`
rylzxc Nov 6, 2022
39a6df1
Add sections on responsive ui and tips to DG
glemenneo Nov 6, 2022
5d9f2d1
Merge pull request #166 from glemenneo/branch-fixUiBugs
jacobkwan Nov 6, 2022
e1d9b3b
Update TagTest
rylzxc Nov 6, 2022
dd80c61
Fix `edit` section in UG
rylzxc Nov 6, 2022
b81cd20
Update PPP
adeearyaa Nov 6, 2022
59a9904
Merge pull request #168 from rylzxc/branch-improve-code-quality
jacobkwan Nov 6, 2022
d8d6df6
Merge pull request #171 from adeearyaa/Update-PPP-Changes
jacobkwan Nov 6, 2022
3b2c83a
Merge pull request #167 from jacobkwan/update-ug
rylzxc Nov 6, 2022
b657cb0
Update docs/DeveloperGuide.md
glemenneo Nov 6, 2022
c51a917
Update docs/DeveloperGuide.md
glemenneo Nov 6, 2022
0a38113
Update docs/DeveloperGuide.md
glemenneo Nov 6, 2022
85c159e
Update docs/DeveloperGuide.md
glemenneo Nov 6, 2022
b7df14f
Update docs/DeveloperGuide.md
glemenneo Nov 6, 2022
4db5e31
Update docs/DeveloperGuide.md
glemenneo Nov 6, 2022
c6eca19
Fix typos and anchor links
glemenneo Nov 6, 2022
17f1eb7
Merge pull request #169 from glemenneo/branch-updateDG
glemenneo Nov 6, 2022
a4e3dcb
Change all Fxml versioning to javafx8
glemenneo Nov 6, 2022
792bf08
Merge pull request #172 from glemenneo/branch-fixFxmlVersioning
jacobkwan Nov 6, 2022
879f722
Update DG
jacobkwan Nov 6, 2022
1cf7fb0
Update PPP with more links
jacobkwan Nov 6, 2022
d3dd38f
Move command examples and url from HelpWindow class to HelpUtil class
glemenneo Nov 7, 2022
5d401bf
Fix javadocs for Command enum
glemenneo Nov 7, 2022
5ab26de
Change command example variable naming
glemenneo Nov 7, 2022
1b341b8
Add command example header to HelpUtil class
glemenneo Nov 7, 2022
e322ff7
Add getCommandHeader method to HelpUtil class
glemenneo Nov 7, 2022
171c602
Fix javadocs for getCommandHeader method
glemenneo Nov 7, 2022
e970911
Fix default case for getCommandHeader method
glemenneo Nov 7, 2022
149968b
Change HelpWindow to populate using HelpCard fxml
glemenneo Nov 7, 2022
8a7e915
Add HashMap to HelpUtil to map Command to example and header
glemenneo Nov 7, 2022
4c5f844
Merge pull request #173 from jacobkwan/update-dg
rylzxc Nov 7, 2022
b6b46ea
Fix checkstyle errors
glemenneo Nov 7, 2022
004857b
PPP update
adeearyaa Nov 7, 2022
244f3e7
Add Help window section to DG
glemenneo Nov 7, 2022
5a3eaac
Merge pull request #174 from jacobkwan/update-ppp
adeearyaa Nov 7, 2022
f87124b
Merge pull request #176 from adeearyaa/PPP-changes
adeearyaa Nov 7, 2022
d9a17a8
Update PPP
glemenneo Nov 7, 2022
f5db9bf
Merge pull request #177 from glemenneo/branch-updateDG
adeearyaa Nov 7, 2022
27afbad
Merge pull request #178 from glemenneo/branch-updateUG
jacobkwan Nov 7, 2022
f88bb4b
Add find command to DG
adeearyaa Nov 7, 2022
08af6bd
Add table header to `add` example
rylzxc Nov 7, 2022
cc7e96c
Merge pull request #170 from rylzxc/branch-update-ug-add
jacobkwan Nov 7, 2022
7f40200
Merge pull request #179 from adeearyaa/Add-DG-find-command
jacobkwan Nov 7, 2022
717a166
Add link to PPP
adeearyaa Nov 7, 2022
8940dec
Changes to PPP
adeearyaa Nov 7, 2022
97ac699
Update PPP
jacobkwan Nov 7, 2022
1395059
Update PPP to include links to work done
rylzxc Nov 7, 2022
7b4446c
Update PPP
jacobkwan Nov 7, 2022
95c1c0d
Merge pull request #180 from adeearyaa/Add-PPP
jacobkwan Nov 7, 2022
e2e81f6
Remove extra bullet point in PPP
rylzxc Nov 7, 2022
2eb555f
Merge pull request #181 from jacobkwan/update-ppp
jacobkwan Nov 7, 2022
c41fe24
Merge pull request #182 from rylzxc/branch-update-ppp
jacobkwan Nov 7, 2022
efd7d1d
Add extra line to PPP to fix formatting
adeearyaa Nov 7, 2022
7dafac0
Merge pull request #183 from adeearyaa/Add-PPP
adeearyaa Nov 7, 2022
4c81ace
Fix undo and redo in UG
tienyu2000 Nov 7, 2022
a4bb58d
Merge pull request #175 from glemenneo/branch-improveCodeQuality
rylzxc Nov 7, 2022
8bfd835
Update acknowledgements
rylzxc Nov 7, 2022
d2cfae8
Merge pull request #184 from tienyu2000/branch-Update-UG
rylzxc Nov 7, 2022
5aab88b
Merge pull request #185 from rylzxc/branch-acknowledgements
rylzxc Nov 7, 2022
8a86afe
Improve code quality
rylzxc Nov 7, 2022
ea13330
Add newline at EOF
rylzxc Nov 7, 2022
9b1f695
Add acknowledgements
rylzxc Nov 7, 2022
32c6dd5
Merge branch 'master' into branch-improve-slap
rylzxc Nov 7, 2022
c12747c
Remove unused import
rylzxc Nov 7, 2022
3bdf068
Update PPP
tienyu2000 Nov 7, 2022
91922c5
Fix minor documentation issue
rylzxc Nov 7, 2022
8fca5b2
Merge pull request #188 from tienyu2000/branch-Update-PPP
rylzxc Nov 7, 2022
37e7efc
Fix PPP bugs
tienyu2000 Nov 7, 2022
9e9eafc
Fix css resource file not found error
glemenneo Nov 7, 2022
f7f13f8
Merge pull request #189 from tienyu2000/branch-Update-PPP
rylzxc Nov 7, 2022
ab54b52
Fix PPP typos
glemenneo Nov 7, 2022
c53c8df
Fix PPP header bugs
tienyu2000 Nov 7, 2022
2036919
Update testcase to hit missed branch
rylzxc Nov 7, 2022
a14bf6d
Fix PPP header bugs
tienyu2000 Nov 7, 2022
3c5eed1
Merge pull request #191 from glemenneo/branch-updateUG
rylzxc Nov 7, 2022
af47362
Merge pull request #190 from glemenneo/branch-fixLogError
glemenneo Nov 7, 2022
2c57bc9
Merge pull request #192 from tienyu2000/branch-Update-PPP
rylzxc Nov 7, 2022
e952b6c
Merge pull request #187 from rylzxc/branch-improve-slap
rylzxc Nov 7, 2022
d790c73
Remove gif from UG
glemenneo Nov 7, 2022
17cf931
Merge pull request #193 from glemenneo/branch-updateUG
rylzxc Nov 7, 2022
f5ad2ee
Update docs
rylzxc Nov 7, 2022
3e9cc20
Update app version
rylzxc Nov 7, 2022
250afbf
Minor fixes
rylzxc Nov 7, 2022
b71926e
Fix formatting
rylzxc Nov 7, 2022
5639caf
Remove 'more to be added'
rylzxc Nov 7, 2022
bc057a1
Introduce page breaks for better conversion
rylzxc Nov 7, 2022
a659804
Merge pull request #194 from rylzxc/branch-final-updates
rylzxc Nov 7, 2022
74952bb
Hotfix for UG
jacobkwan Nov 7, 2022
b211279
Merge pull request #195 from jacobkwan/hotfix
jacobkwan Nov 7, 2022
586ab21
Add Acknowledgements
tienyu2000 Nov 26, 2022
fa0118d
Fix Checkstyle Issues
tienyu2000 Nov 26, 2022
c769654
Merge pull request #197 from tienyu2000/add-Acknowledgements
rylzxc Nov 26, 2022
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
Prev Previous commit
Next Next commit
Add new dynamic tip window to each internship card, functionality WIP
  • Loading branch information
glemenneo committed Oct 25, 2022
commit 799f4e9cc3d19dc0c8f4a1f52ccbce2a62dbcc31
55 changes: 53 additions & 2 deletions src/main/java/seedu/workbook/ui/InternshipCard.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package seedu.workbook.ui;

import java.util.Comparator;
import java.util.ArrayList;
import java.util.List;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
@@ -9,6 +11,7 @@
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.workbook.model.internship.Internship;
import seedu.workbook.model.internship.Stage;

/**
* An UI component that displays information of a {@code Internship}.
@@ -17,6 +20,7 @@ public class InternshipCard extends UiPart<Region> {

private static final String FXML = "InternshipListCard.fxml";


/**
* Note: Certain keywords such as "location" and "resources" are reserved keywords in JavaFX.
* As a consequence, UI elements' variable names cannot be set to such keywords
@@ -27,6 +31,12 @@ public class InternshipCard extends UiPart<Region> {

public final Internship internship;

//Independent tips window residing in each internship list card controller
private TipsWindow tipsWindow;

private final Stage internshipStage;
private final boolean stageHasTips;

@FXML
private HBox cardPane;
@FXML
@@ -53,15 +63,25 @@ public class InternshipCard extends UiPart<Region> {
public InternshipCard(Internship internship, int displayedIndex) {
super(FXML);
this.internship = internship;
this.internshipStage = internship.getStage();
//this.stageHasTips = Stage.hasTips(this.internshipStage);
this.stageHasTips = true;

if(!stageHasTips) {
tipsButton.setVisible(false);
}

id.setText(displayedIndex + ". ");
company.setText(internship.getCompany().name);
role.setText(internship.getRole().value);
email.setText(internship.getEmail().value);
stage.setText(internship.getStage().value);
stage.setText(internshipStage.value);
dateTime.setText(internship.getDateTime().value);
internship.getTags().stream()
.sorted(Comparator.comparing(tag -> tag.tagName))
.forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));

tipsWindow = new TipsWindow();
}

@Override
@@ -87,6 +107,37 @@ public boolean equals(Object other) {
*/
@FXML
private void showTips() {

if (!this.stageHasTips) {
return;
}

//Set header of tips to be name of stage.
tipsWindow.setTipsHeader(this.internshipStage.value);

List<String> tips = new ArrayList<String>();

//Dummy tips for testing purposes.
tips.add("Contact the hiring manager/recruitment by submitting a short follow-up email to "
+ "show interest in the company and stand out!");

tips.add("Keep a copy of your resume by the phone so that you can refer to them and answer"
+ " questions if the company were to call you for a short interview!");

tips.add("Conduct a detailed research on the organisation you applied for, especially their"
+ "mission statement, policies, initiatives and programmes to prepare for a potential interview!");

tips.add("Prepare for interviews and assessment by brushing up on your interview and coding"
+ "skills! Refer to our tips included in “Online Assessment”, “Technical Interview” and"
+ "“Behavioural Interview” for more advice!");

tips.add("Short tip formatting test");

tipsWindow.populateTips(tips);

if (!tipsWindow.isShowing()) {
tipsWindow.show();
} else {
tipsWindow.focus();
}
}
}
133 changes: 133 additions & 0 deletions src/main/java/seedu/workbook/ui/TipsWindow.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
package seedu.workbook.ui;

import java.util.List;
import java.util.logging.Logger;

import javafx.fxml.FXML;
import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.RowConstraints;
import javafx.stage.Stage;
import seedu.workbook.commons.core.LogsCenter;

/**
* Controller for a tips page
*/
public class TipsWindow extends UiPart<Stage> {

private static final Logger logger = LogsCenter.getLogger(TipsWindow.class);
private static final String FXML = "TipsWindow.fxml";

@FXML
private Label tipsHeader;

@FXML
private GridPane gridPane;

/**
* Creates a new TipsWindow.
*
* @param root Stage to use as the root of the TipsWindow.
*/
public TipsWindow(Stage root) {
super(FXML, root);
}

/**
* Creates a new TipsWindow.
*/
public TipsWindow() {
this(new Stage());
}

/**
* Shows the help window.
* @throws IllegalStateException
* <ul>
* <li>
* if this method is called on a thread other than the JavaFX Application Thread.
* </li>
* <li>
* if this method is called during animation or layout processing.
* </li>
* <li>
* if this method is called on the primary stage.
* </li>
* <li>
* if {@code dialogStage} is already showing.
* </li>
* </ul>
*/
public void show() {
logger.fine("Showing tips page about the internship stage.");
getRoot().show();
getRoot().centerOnScreen();
}

/**
* Returns true if the tips window is currently being shown.
*/
public boolean isShowing() {
return getRoot().isShowing();
}

/**
* Hides the tips window.
*/
public void hide() {
getRoot().hide();
}

/**
* Focuses on the tips window.
*/
public void focus() {
getRoot().requestFocus();
}

/*
* Set the tips window header to be the stage name.
*/
public void setTipsHeader(String stageName) {
tipsHeader.setText("Tips for " + stageName);
}

/*
* Populates the tips window with tips.
*/
public void populateTips(List<String> tips) {
for (int i = 0; i < tips.size(); i++) {

//Indexing for the tips.
String index = String.format("%d.", i + 1);
Label indexLabel = new Label(index);
indexLabel.setPadding(new Insets(0, 10, 0, 0));
indexLabel.getStyleClass().add("indexText");

String tip = tips.get(i);
Label tipLabel = new Label(tip);

//Setting up Label to be fixed width.
tipLabel.setMinWidth(500);
tipLabel.setMaxWidth(500);
tipLabel.setWrapText(true);
tipLabel.getStyleClass().add("tipText");

HBox hbox = new HBox();
hbox.getChildren().addAll(indexLabel, tipLabel);

hbox.getStyleClass().add("tipContainer");

//Ensure that rows containing hbox label can grow to accomodate.
RowConstraints rowConstraint = new RowConstraints();
rowConstraint.setVgrow(Priority.ALWAYS);
gridPane.getRowConstraints().add(rowConstraint);

gridPane.add(hbox, 0, i, 1, 1);
}
}

}
27 changes: 27 additions & 0 deletions src/main/resources/view/TipsWindow.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#tipsHeader {
-fx-text-fill: orange;
-fx-font-weight: bold;
-fx-font-size: 20px;
}

.headerContainer {
-fx-background-color: derive(#1d1d1d, 20%);
}

#gridPane {
-fx-background-color: derive(#1d1d1d, 20%);
}

.tipContainer {
-fx-background-color: derive(#1d1d1d, 20%);
}

.indexText {
-fx-text-fill: white;
-fx-font-weight: bold;
-fx-font-size: 14px;
}

.tipText {
-fx-text-fill: white;
}
48 changes: 48 additions & 0 deletions src/main/resources/view/TipsWindow.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import java.net.URL?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.Scene?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.stage.Stage?>

<fx:root resizable="false" title="Tips" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1">
<icons>
<Image url="@/images/lightbulb.png" />
</icons>
<scene>
<Scene>
<stylesheets>
<URL value="@TipsWindow.css" />
</stylesheets>
<VBox alignment="CENTER">
<children>
<HBox fx:id="headerContainer" alignment="CENTER" styleClass="headerContainer">
<children>
<Label fx:id="tipsHeader" text="Tips Header" />
</children>
<opaqueInsets>
<Insets bottom="6.0" left="5.0" right="10.0" top="5.0" />
</opaqueInsets>
<padding>
<Insets bottom="10.0" left="5.0" right="10.0" top="5.0" />
</padding>
</HBox>
<GridPane fx:id="gridPane" vgap="15.0">
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" />
</columnConstraints>
<padding>
<Insets bottom="30.0" left="10.0" right="10.0" top="10.0" />
</padding>
</GridPane>
</children>
</VBox>
</Scene>
</scene>
</fx:root>