This repository has been archived by the owner on Apr 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
340 additions
and
151 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export default class StorefrontPermissions { | ||
static CanSeeOrganizationDetail = "storefront:organization:view"; | ||
static CanEditOrganization = "storefront:organization:edit"; | ||
static CanInviteUsers = "storefront:user:invite"; | ||
static CanCreateUsers = "storefront:user:create"; | ||
static CanEditUsers = "storefront:user:edit"; | ||
static CanDeleteUsers = "storefront:user:delete"; | ||
static CanViewUsers = "storefront:user:view"; | ||
static CanViewOrders = "storefront:order:view"; | ||
static CanChangeOrderStatus = "storefront:order:changestatus"; | ||
} |
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import Vue from 'vue'; | ||
import { ApiAccountClient, ApiCartClient, ApiCatalogClient, ApiOrderClient, ApiPricingClient } from '@common/api/api-clients'; | ||
import { baseUrl } from '@common/constants'; | ||
import axios from "@common/services/axios-instance"; | ||
|
||
// There is globals instances of api clients fore shared usage. | ||
// Add here new global instance any api client class if you need. | ||
export const accountClient = new ApiAccountClient(baseUrl, Vue.axios); | ||
export const catalogClient = new ApiCatalogClient(baseUrl, Vue.axios); | ||
export const cartClient = new ApiCartClient(baseUrl, Vue.axios); | ||
export const orderClient = new ApiOrderClient(baseUrl, Vue.axios); | ||
export const pricingClient = new ApiPricingClient(baseUrl, Vue.axios); | ||
export const accountClient = new ApiAccountClient(baseUrl, axios); | ||
export const catalogClient = new ApiCatalogClient(baseUrl, axios); | ||
export const cartClient = new ApiCartClient(baseUrl, axios); | ||
export const orderClient = new ApiOrderClient(baseUrl, axios); | ||
export const pricingClient = new ApiPricingClient(baseUrl, axios); |
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,25 @@ | ||
import axios from "axios"; | ||
import { baseUrl, loginUrl, accessDeniedUrl } from '@common/constants'; | ||
|
||
const axiosInstance = axios.create(); | ||
|
||
axiosInstance.defaults.baseURL = baseUrl; | ||
axiosInstance.interceptors.response.use( | ||
function (response) { | ||
return response; | ||
}, | ||
function (error) { | ||
if (error.response.status) { | ||
switch(error.response.status){ | ||
case 401: | ||
window.location.assign(loginUrl); | ||
break; | ||
case 403: | ||
window.location.assign(accessDeniedUrl); | ||
break; | ||
} | ||
} | ||
return Promise.reject(error) | ||
}); | ||
|
||
export default axiosInstance; |
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
import { baseUrl, locale, storeName, defaultPageSize } from "@common/constants"; | ||
|
||
export default class UrlService{ | ||
static get fullBaseUrl(){ | ||
return `${baseUrl}/${storeName}/${locale}/` | ||
} | ||
|
||
static get loginUrl() { | ||
return `${this.fullBaseUrl}account/login`; | ||
} | ||
|
||
static get accessDeniedUrl() { | ||
return `${this.fullBaseUrl}error/AccessDenied`; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,15 +1,24 @@ | ||
import Vue from "vue"; | ||
import i18n from "@i18n"; | ||
import { AuthorizationPlugin } from "plugins/authorization/authorization.plugin"; | ||
import { FETCH_PROFILE } from "plugins/authorization/store-profile/definitions"; | ||
import App from "@account/App.vue"; | ||
import router from "@account/router"; | ||
import store from "@account/store"; | ||
import InitializationService from '@common/services/initialization.service'; | ||
import InitializationService from "@common/services/initialization.service"; | ||
|
||
InitializationService.initializeCommon(); | ||
|
||
new Vue({ | ||
i18n, | ||
router, | ||
store, | ||
render: h => h(App) | ||
}).$mount("#app"); | ||
//custom plugins | ||
Vue.use(AuthorizationPlugin, {store}); | ||
|
||
store.dispatch(`profileModule/${FETCH_PROFILE}`).then(() =>{ | ||
|
||
new Vue({ | ||
i18n, | ||
router, | ||
store, | ||
render: h => h(App) | ||
}).$mount("#app"); | ||
|
||
}); |
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
1 change: 0 additions & 1 deletion
1
client-app/src/pages/account/store/modules/invoices-list/definitions.ts
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export const FETCH_INVOICES = "fetchInvoices"; | ||
export const GET_INVOICE_PDF = "getInvoicePdf"; | ||
|
||
export const SET_INVOICES_LIST_CONFIG = "setInvoicesListConfig"; |
2 changes: 1 addition & 1 deletion
2
client-app/src/pages/account/store/modules/invoices-list/getters.ts
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.