-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VEIOSS-350 | Allow Trader to Select Countries for Return (#4)
* VEIOSS-350 | Add dropdown select for country. Create NoPeriodsAvailable page. Add missing captions to initial pages * VEIOSS-250 | Create AddToListPage for SoldToCountry. Refactor Action to exclude peroid param and refactor all associated controllers. WIP * VEIOSS-350 | Use Button group in view.
- Loading branch information
1 parent
0bf5221
commit a006043
Showing
72 changed files
with
1,450 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2023 HM Revenue & Customs | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package controllers | ||
|
||
import models.requests.DataRequest | ||
import models.{Country, Index} | ||
import pages.{JourneyRecoveryPage, SoldToCountryPage, Waypoints} | ||
import play.api.mvc.Results.Redirect | ||
import play.api.mvc.{AnyContent, Result} | ||
import utils.FutureSyntax.FutureOps | ||
|
||
import scala.concurrent.Future | ||
|
||
trait GetCountry { | ||
|
||
protected def getCountry(waypoints: Waypoints, index: Index) | ||
(block: Country => Future[Result]) | ||
(implicit request: DataRequest[AnyContent]): Future[Result] = | ||
request.userAnswers | ||
.get(SoldToCountryPage(index)) | ||
.map(block(_)) | ||
.getOrElse(Redirect(JourneyRecoveryPage.route(waypoints)).toFuture) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2023 HM Revenue & Customs | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package controllers | ||
|
||
import controllers.actions._ | ||
import pages.Waypoints | ||
import play.api.i18n.{I18nSupport, MessagesApi} | ||
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents} | ||
import uk.gov.hmrc.play.bootstrap.frontend.controller.FrontendBaseController | ||
import views.html.NoOtherPeriodsAvailableView | ||
|
||
import javax.inject.Inject | ||
|
||
class NoOtherPeriodsAvailableController @Inject()( | ||
override val messagesApi: MessagesApi, | ||
cc: AuthenticatedControllerComponents, | ||
view: NoOtherPeriodsAvailableView | ||
) extends FrontendBaseController with I18nSupport { | ||
|
||
protected val controllerComponents: MessagesControllerComponents = cc | ||
|
||
def onPageLoad(waypoints: Waypoints): Action[AnyContent] = (cc.actionBuilder andThen cc.identify) { | ||
implicit request => | ||
Ok(view(waypoints)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.