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

SAN-140 STOP screen - service is down (unscheduled) #196

Merged
merged 21 commits into from
Jan 14, 2025

Conversation

klai-ch
Copy link
Contributor

@klai-ch klai-ch commented Jan 9, 2025

Set up page for STOP screen - service is down (unscheduled)

…duled

# Conflicts:
#	src/main/java/uk/gov/companieshouse/web/pps/controller/pps/ConfirmationController.java
#	src/test/java/uk/gov/companieshouse/web/pps/controller/pps/ConfirmationControllerTest.java
…duled

# Conflicts:
#	src/main/java/uk/gov/companieshouse/web/pps/controller/pps/BankTransferSanctionsDetailsController.java
#	src/test/java/uk/gov/companieshouse/web/pps/controller/pps/BankTransferSanctionsDetailsControllerTest.java
@ch-code-analysis
Copy link

CI: No security warnings found

public String getUnscheduledServiceDown(Model model) {

String loginEmail = penaltyUtils.getLoginEmail(sessionService);
if (loginEmail != null && !loginEmail.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use apache.commons here and just do:
StringUtils.isEmpty(loginEmail)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part should be changed/removed now after SAN-166 changes


@GetMapping
public String getUnscheduledServiceDown(Model model) {

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove empty line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated from review

private static final String COMPANY_NUMBER = "12345678";
private static final String PENALTY_REF = "EXAMPLE12345";
private static final String PAYABLE_REF = "PR_123456";

private static final String VIEW_CONFIRMATION_PATH = "/late-filing-penalty/company/" + COMPANY_NUMBER + "/penalty/" + PENALTY_REF + "/payable/" + PAYABLE_REF + "/confirmation";

private static final String RESUME_URL_PATH = "redirect:/late-filing-penalty/company/" + COMPANY_NUMBER + "/penalty/" + PENALTY_REF + "/view-penalties";
private static final String UNSCHEDULED_SERVICE_DOWN_PATH = "/late-filing-penalty/unscheduled-service-down";

private static final String CONFIRMATION_VIEW = "pps/confirmationPage";
private static final String ERROR_VIEW = "error";
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused variable 'ERROR_VIEW'
Also, if you don't mind, could you remove it from 'BankTransferSanctionsDetailsControllerTest.java' too? I know you didn't touch that file but it would be great to clean that up too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated from review

@@ -64,6 +69,7 @@ class SignOutControllerTest {
private static final String PREVIOUS_PATH = "/late-filing-penalty/enter-details";
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused variables line 62:
MOCK_CONTROLLER_PATH = UrlBasedViewResolver.REDIRECT_URL_PREFIX + "mockControllerPath";
HOME = "/late-filing-penalty/";
ERROR_VIEW = "error";
Can you also check the formatting of this file, there's a load of extra line where they are not needed throughout the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed from the file and some of the empty lines also

@@ -59,6 +64,7 @@ void setup() {
private static final String START_PATH = "/late-filing-penalty";
private static final String START_PATH_PARAM = "/late-filing-penalty?start=0";
private static final String MOCK_CONTROLLER_PATH = UrlBasedViewResolver.REDIRECT_URL_PREFIX + "mockControllerPath";
private static final String UNSCHEDULED_SERVICE_DOWN_PATH = "/late-filing-penalty/unscheduled-service-down";

private static final String PPS_START_VIEW = "pps/home";
private static final String ERROR_VIEW = "error";
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated from review

@InjectMocks
private ViewPenaltiesController controller;

private static final String COMPANY_NUMBER = "12345678";
private static final String PENALTY_NUMBER = "44444444";

private static final String VIEW_PENALTIES_PATH = "/late-filing-penalty/company/" + COMPANY_NUMBER + "/penalty/" + PENALTY_NUMBER + "/view-penalties";
private static final String UNSCHEDULED_SERVICE_DOWN_PATH = "/late-filing-penalty/unscheduled-service-down";

private static final String ENTER_PPS_DETAILS_VIEW = "pps/viewPenalties";
private static final String ERROR_VIEW = "error";
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated from review

@@ -92,6 +97,8 @@ class EnterDetailsControllerTest {
private static final String ALREADY_PAID_PATH =
"redirect:/late-filing-penalty/company/" + VALID_COMPANY_NUMBER + "/penalty/" + VALID_PENALTY_REF + "/penalty-paid";

private static final String UNSCHEDULED_SERVICE_DOWN_PATH = "/late-filing-penalty/unscheduled-service-down";

private static final String ERROR_PAGE = "error";
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated from review

@ch-code-analysis
Copy link

CI: No security warnings found

@ch-code-analysis
Copy link

CI: No security warnings found

@klai-ch
Copy link
Contributor Author

klai-ch commented Jan 9, 2025

Change for this ticket, adding a unscheduled down page
Change all the error view page to the new unscheduled down page

@ch-code-analysis
Copy link

CI: No security warnings found

…duled

# Conflicts:
#	src/test/java/uk/gov/companieshouse/web/pps/controller/pps/EnterDetailsControllerTest.java
#	src/test/java/uk/gov/companieshouse/web/pps/controller/pps/PenaltyPaidControllerTest.java
@ch-code-analysis
Copy link

CI: No security warnings found

@klai-ch klai-ch requested a review from acallaghan-ch January 13, 2025 12:56
Copy link
Contributor

@aonubeze-ch aonubeze-ch left a comment

Choose a reason for hiding this comment

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

I can see this expression in multiple locations: "REDIRECT_URL_PREFIX + penaltyConfigurationProperties.getUnscheduledServiceDownPath();" A method call, maybe?
I will go ahead and approve as it is just a nice to have.

@ch-code-analysis
Copy link

CI: No security warnings found

@klai-ch
Copy link
Contributor Author

klai-ch commented Jan 14, 2025

Moved "REDIRECT_URL_PREFIX + penaltyConfigurationProperties.getUnscheduledServiceDownPath();" into Util from comment

@ch-code-analysis
Copy link

CI: No security warnings found

@klai-ch klai-ch merged commit 5649735 into master Jan 14, 2025
1 check passed
@klai-ch klai-ch deleted the feature/austin/SAN-140-Service-Down-Unscheduled branch January 14, 2025 11:23
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.

5 participants