Skip to content

Commit

Permalink
Merge pull request #2709 from LibreSign/backport/2708/stable28
Browse files Browse the repository at this point in the history
[stable28] Incomplete route
  • Loading branch information
vitormattos authored Apr 11, 2024
2 parents febd0aa + 272b97a commit b4e525e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions appinfo/routes/routesPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
// Pages - restricted
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#indexF', 'url' => '/f/', 'verb' => 'GET'],
['name' => 'page#incomplete', 'url' => '/f/incomplete', 'verb' => 'GET'],
['name' => 'page#signFPath', 'url' => '/f/sign/{uuid}/{path}', 'verb' => 'GET', 'requirements' => ['path' => '.+'], 'postfix' => 'extra'],
['name' => 'page#signF', 'url' => '/f/sign/{uuid}', 'verb' => 'GET'],
['name' => 'page#indexFPath', 'url' => '/f/{path}', 'verb' => 'GET', 'requirements' => ['path' => '.+'], 'postfix' => 'front'],
['name' => 'page#getPdfFile', 'url' => '/pdf/{uuid}', 'verb' => 'GET'],
['name' => 'page#resetPassword', 'url' => '/reset-password', 'verb' => 'GET'],
// Pages - public
['name' => 'page#incompleteP', 'url' => '/p/incomplete', 'verb' => 'GET'],
['name' => 'page#sign', 'url' => '/p/sign/{uuid}', 'verb' => 'GET'],
['name' => 'page#sign', 'url' => '/p/sign/{uuid}/{path}', 'verb' => 'GET', 'requirements' => ['path' => '.+'], 'postfix' => 'extra'],
['name' => 'page#signAccountFile', 'url' => '/p/account/files/approve/{uuid}', 'verb' => 'GET'],
Expand Down
14 changes: 14 additions & 0 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@ public function indexF(): TemplateResponse {
return $this->index();
}

#[NoAdminRequired]
#[NoCSRFRequired]
public function incomplete(): TemplateResponse {
Util::addScript(Application::APP_ID, 'libresign-main');
$response = new TemplateResponse(Application::APP_ID, 'main', [], TemplateResponse::RENDER_AS_BASE);
return $response;
}

#[PublicPage]
#[NoCSRFRequired]
public function incompleteP(): TemplateResponse {
return $this->incomplete();
}

#[NoAdminRequired]
#[NoCSRFRequired]
#[RequireSetupOk(template: 'main')]
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/SelectAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const selectAction = (action, to, from) => {
case 4500: // ACTION_RENEW_EMAIL
return 'RenewEmail' + external
case 5000: // ACTION_INCOMPLETE_SETUP
return 'incomplete' + external
return 'Incomplete' + external
default:
break
}
Expand Down
20 changes: 19 additions & 1 deletion src/router/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,24 @@ const router = new Router({
component: () => import('../views/Validation.vue'),
props: true,
},
{
path: '/p/incomplete',
name: 'IncompleteExternal',
beforeEnter: (to, from, next) => {
const action = selectAction(loadState('libresign', 'action', ''), to, from)
if (action !== undefined) {
if (to.name !== 'IncompleteExternal') {
next({
name: action,
params: to.params,
})
return
}
}
next()
},
component: () => import('../views/IncompleteCertification.vue'),
},

// internal pages
{
Expand All @@ -110,7 +128,7 @@ const router = new Router({
beforeEnter: (to, from, next) => {
const action = selectAction(loadState('libresign', 'action', ''), to, from)
if (action !== undefined) {
if (to.name !== 'incomplete') {
if (to.name !== 'Incomplete') {
next({
name: action,
params: to.params,
Expand Down

0 comments on commit b4e525e

Please sign in to comment.