Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: handling specific view for trustvox app #97

Merged
merged 1 commit into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions src/router/index.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import VueRouter from 'vue-router'
import Marketplace from '../views/Marketplace.vue'
import Application from '../views/Application.vue'
import AppBling from '../views/apps/AppBling.vue'
import AppTrustvox from '../views/apps/AppTrustvox.vue'

Vue.use(VueRouter)

Expand All @@ -21,6 +22,11 @@ const routes = [
path: '/apps/edit/1247/:objectId?',
name: 'app-bling',
component: AppBling
},
{
path: '/apps/edit/1255/:objectId?',
name: 'app-trustvox',
component: AppTrustvox
}
]

Expand All @@ -34,6 +40,12 @@ router.beforeEach((to, from, next) => {
case 1247:
router.push({ ...to, name: 'app-bling' })
break
case 1247:
router.push({ ...to, name: 'app-bling' })
break
case 1255:
router.push({ ...to, name: 'app-trustvox' })
break
}
}
next()
Expand Down
16 changes: 16 additions & 0 deletions src/views/apps/AppTrustvox.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template>
<Application>
<template #settings-append>
<a-collapse class="mt-4">
<a-collapse-panel key="1" header="Autenticação">
<a-alert message="Configure primeiro os parametros ApiKey, Store Id e Url da loja antes de autenticar a aplicativo." banner />
<div class="mt-3">
<a-button type="primary" @click="handlerClick">Autenticar</a-button>
</div>
</a-collapse-panel>
</a-collapse>
</template>
</Application>
</template>

<script src="./js/AppTrustvox.js"></script>
16 changes: 16 additions & 0 deletions src/views/apps/js/AppTrustvox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Application from '../../Application.vue'
import { $ecomConfig } from '@ecomplus/utils'
export default {
name: 'AppTrustvox',

components: {
Application
},

methods: {
handlerClick () {
const authUrl = `https://trustvox.ecomplus.biz/trustvox/auth-callback?x_store_id=${$ecomConfig.get('store_id')}`
window.open(authUrl, "_blank")
}
}
}