fix: nested router
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2022-11-22 14:57:52 +01:00
parent 660648e01f
commit 314e98b838
7 changed files with 17 additions and 26 deletions

View File

@ -13,7 +13,7 @@ module.exports = function(Self) {
const params = {
recipient: info.email,
lang: user.lang,
url: `${origin}/#!/login/reset-password?access_token=${info.accessToken.id}`
url: `${origin}/#!/reset-password?access_token=${info.accessToken.id}`
};
const email = new Email('recover-password', params);

View File

@ -23,7 +23,10 @@ export default class Auth {
initialize() {
let criteria = {
to: state => !state.name.includes('login')
to: state => {
const outLayout = ['login', 'recoverPassword', 'resetPassword'];
return !outLayout.some(ol => ol == state.name);
}
};
this.$transitions.onStart(criteria, transition => {
if (this.loggedIn)

View File

@ -14,21 +14,9 @@ export default class App extends Component {
}
get showLayout() {
let state = this.$state.current.name;
console.log(this.$state.current.name);
return state && !this.isLogin && !this.isRecover && !this.isReset;
}
get isLogin() {
return this.$state.current.name == 'login';
}
get isRecover() {
return this.$state.current.name == 'login.recover-password';
}
get isReset() {
return this.$state.current.name == 'login.reset-password';
const state = this.$state.current.name;
const outLayout = ['login', 'recoverPassword', 'resetPassword'];
return state && !outLayout.some(ol => ol == state);
}
$onDestroy() {

View File

@ -1,2 +1 @@
HOLA
<ui-view>HOLA</ui-view>
<ui-view></ui-view>

View File

@ -23,7 +23,7 @@
<vn-spinner enable="$ctrl.loading"></vn-spinner>
</div>
<div class="vn-pt-lg">
<a ui-sref="login.recover-password" translate>
<a ui-sref="recoverPassword" translate>
I do not remember my password
</a>
</div>

View File

@ -9,14 +9,14 @@ function config($stateProvider, $urlRouterProvider) {
.state('login', {
url: '/login?continue',
description: 'Login',
component: '<vn-out-layout></vn-out-layout>'
template: '<vn-login></vn-login>'
})
.state('login.recover-password', {
.state('recoverPassword', {
url: '/recover-password',
description: 'Recover-password',
template: '<vn-recover-password></vn-recover-password>'
template: '<vn-recover-password>asd</vn-recover-password>'
})
.state('login.reset-password', {
.state('resetPassword', {
url: '/reset-password',
description: 'Reset-password',
template: '<vn-reset-password></vn-reset-password>'

View File

@ -245,5 +245,6 @@
"Already has this status": "Ya tiene este estado",
"There aren't records for this week": "No existen registros para esta semana",
"Empty data source": "Origen de datos vacio",
"Email verify": "Correo de verificación"
}
"Email verify": "Correo de verificación",
"Landing cannot be lesser than shipment": "Landing cannot be lesser than shipment"
}