@vendure/admin-ui 1.8.4 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/vendure-admin-ui-catalog.umd.js +53 -101
- package/bundles/vendure-admin-ui-catalog.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-core.umd.js +115 -54
- package/bundles/vendure-admin-ui-core.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-customer.umd.js +52 -2
- package/bundles/vendure-admin-ui-customer.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-login.umd.js +40 -8
- package/bundles/vendure-admin-ui-login.umd.js.map +1 -1
- package/bundles/vendure-admin-ui-order.umd.js +52 -3
- package/bundles/vendure-admin-ui-order.umd.js.map +1 -1
- package/catalog/components/apply-facet-dialog/apply-facet-dialog.component.d.ts +1 -2
- package/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component.d.ts +0 -1
- package/catalog/components/product-detail/product-detail.component.d.ts +2 -7
- package/catalog/components/product-variants-list/product-variants-list.component.d.ts +11 -11
- package/catalog/providers/product-detail/product-detail.service.d.ts +1 -2
- package/catalog/vendure-admin-ui-catalog.metadata.json +1 -1
- package/core/common/generated-types.d.ts +59 -0
- package/core/common/version.d.ts +1 -1
- package/core/data/definitions/facet-definitions.d.ts +1 -0
- package/core/data/providers/facet-data.service.d.ts +5 -1
- package/core/providers/custom-history-entry-component/history-entry-component-types.d.ts +81 -0
- package/core/providers/custom-history-entry-component/history-entry-component.service.d.ts +16 -0
- package/core/public_api.d.ts +2 -1
- package/core/shared/components/facet-value-selector/facet-value-selector.component.d.ts +17 -17
- package/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.d.ts +3 -11
- package/core/shared/dynamic-form-inputs/register-dynamic-input-components.d.ts +1 -2
- package/core/vendure-admin-ui-core.metadata.json +1 -1
- package/customer/components/customer-detail/customer-detail.component.d.ts +3 -3
- package/customer/components/customer-history/customer-history-entry-host.component.d.ts +16 -0
- package/customer/components/customer-history/customer-history.component.d.ts +19 -3
- package/customer/public_api.d.ts +1 -0
- package/customer/vendure-admin-ui-customer.metadata.json +1 -1
- package/esm2015/catalog/components/apply-facet-dialog/apply-facet-dialog.component.js +2 -2
- package/esm2015/catalog/components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component.js +2 -3
- package/esm2015/catalog/components/product-detail/product-detail.component.js +16 -47
- package/esm2015/catalog/components/product-list/product-list-bulk-actions.js +4 -7
- package/esm2015/catalog/components/product-variants-list/product-variants-list.component.js +38 -30
- package/esm2015/catalog/providers/product-detail/product-detail.service.js +1 -4
- package/esm2015/core/common/generated-types.js +1 -1
- package/esm2015/core/common/introspection-result.js +2 -1
- package/esm2015/core/common/version.js +2 -2
- package/esm2015/core/data/definitions/facet-definitions.js +12 -1
- package/esm2015/core/data/providers/facet-data.service.js +5 -2
- package/esm2015/core/providers/custom-history-entry-component/history-entry-component-types.js +2 -0
- package/esm2015/core/providers/custom-history-entry-component/history-entry-component.service.js +39 -0
- package/esm2015/core/public_api.js +3 -2
- package/esm2015/core/shared/components/facet-value-selector/facet-value-selector.component.js +52 -22
- package/esm2015/core/shared/components/form-field/form-field.component.js +2 -2
- package/esm2015/core/shared/components/timeline-entry/timeline-entry.component.js +2 -2
- package/esm2015/core/shared/dynamic-form-inputs/facet-value-form-input/facet-value-form-input.component.js +3 -15
- package/esm2015/customer/components/customer-detail/customer-detail.component.js +1 -1
- package/esm2015/customer/components/customer-history/customer-history-entry-host.component.js +51 -0
- package/esm2015/customer/components/customer-history/customer-history.component.js +12 -4
- package/esm2015/customer/customer.module.js +3 -1
- package/esm2015/customer/public_api.js +2 -1
- package/esm2015/login/components/login/login.component.js +37 -5
- package/esm2015/order/components/order-detail/order-detail.component.js +1 -1
- package/esm2015/order/components/order-history/order-history-entry-host.component.js +51 -0
- package/esm2015/order/components/order-history/order-history.component.js +12 -5
- package/esm2015/order/order.module.js +6 -4
- package/esm2015/order/public_api.js +2 -1
- package/fesm2015/vendure-admin-ui-catalog.js +54 -85
- package/fesm2015/vendure-admin-ui-catalog.js.map +1 -1
- package/fesm2015/vendure-admin-ui-core.js +106 -39
- package/fesm2015/vendure-admin-ui-core.js.map +1 -1
- package/fesm2015/vendure-admin-ui-customer.js +63 -5
- package/fesm2015/vendure-admin-ui-customer.js.map +1 -1
- package/fesm2015/vendure-admin-ui-login.js +36 -4
- package/fesm2015/vendure-admin-ui-login.js.map +1 -1
- package/fesm2015/vendure-admin-ui-order.js +63 -6
- package/fesm2015/vendure-admin-ui-order.js.map +1 -1
- package/login/components/login/login.component.d.ts +11 -1
- package/login/vendure-admin-ui-login.metadata.json +1 -1
- package/order/components/order-detail/order-detail.component.d.ts +3 -3
- package/order/components/order-history/order-history-entry-host.component.d.ts +16 -0
- package/order/components/order-history/order-history.component.d.ts +18 -3
- package/order/public_api.d.ts +1 -0
- package/order/vendure-admin-ui-order.metadata.json +1 -1
- package/package.json +2 -2
- package/static/i18n-messages/de.json +3 -1
- package/static/i18n-messages/en.json +3 -1
- package/static/styles/_variables.scss +1 -0
- package/core/common/utilities/flatten-facet-values.d.ts +0 -2
- package/esm2015/core/common/utilities/flatten-facet-values.js +0 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/router'), require('@vendure/admin-ui/core'), require('rxjs/operators')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@vendure/admin-ui/login', ['exports', '@angular/core', '@angular/router', '@vendure/admin-ui/core', 'rxjs/operators'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.vendure = global.vendure || {}, global.vendure['admin-ui'] = global.vendure['admin-ui'] || {}, global.vendure['admin-ui'].login = {}), global.ng.core, global.ng.router, global.vendure['admin-ui'].core, global.rxjs.operators));
|
|
5
|
-
}(this, (function (exports, i0, i1, i2, operators) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('@angular/router'), require('@vendure/admin-ui/core'), require('rxjs/operators')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@vendure/admin-ui/login', ['exports', '@angular/common/http', '@angular/core', '@angular/router', '@vendure/admin-ui/core', 'rxjs/operators'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.vendure = global.vendure || {}, global.vendure['admin-ui'] = global.vendure['admin-ui'] || {}, global.vendure['admin-ui'].login = {}), global.ng.common.http, global.ng.core, global.ng.router, global.vendure['admin-ui'].core, global.rxjs.operators));
|
|
5
|
+
}(this, (function (exports, http, i0, i1, i2, operators) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -29,9 +29,10 @@
|
|
|
29
29
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
30
30
|
|
|
31
31
|
var LoginComponent = /** @class */ (function () {
|
|
32
|
-
function LoginComponent(authService, router) {
|
|
32
|
+
function LoginComponent(authService, router, httpClient) {
|
|
33
33
|
this.authService = authService;
|
|
34
34
|
this.router = router;
|
|
35
|
+
this.httpClient = httpClient;
|
|
35
36
|
this.username = '';
|
|
36
37
|
this.password = '';
|
|
37
38
|
this.rememberMe = false;
|
|
@@ -39,6 +40,18 @@
|
|
|
39
40
|
this.brand = i2.getAppConfig().brand;
|
|
40
41
|
this.hideVendureBranding = i2.getAppConfig().hideVendureBranding;
|
|
41
42
|
this.hideVersion = i2.getAppConfig().hideVersion;
|
|
43
|
+
this.customImageUrl = i2.getAppConfig().loginImageUrl;
|
|
44
|
+
this.imageUrl = '';
|
|
45
|
+
this.imageUnsplashUrl = '';
|
|
46
|
+
this.imageLocation = '';
|
|
47
|
+
this.imageCreator = '';
|
|
48
|
+
this.imageCreatorUrl = '';
|
|
49
|
+
if (this.customImageUrl) {
|
|
50
|
+
this.imageUrl = this.customImageUrl;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.loadImage();
|
|
54
|
+
}
|
|
42
55
|
}
|
|
43
56
|
LoginComponent.prototype.logIn = function () {
|
|
44
57
|
var _this = this;
|
|
@@ -56,6 +69,24 @@
|
|
|
56
69
|
}
|
|
57
70
|
});
|
|
58
71
|
};
|
|
72
|
+
LoginComponent.prototype.loadImage = function () {
|
|
73
|
+
var _this = this;
|
|
74
|
+
this.httpClient
|
|
75
|
+
.get('https://login-image.vendure.io')
|
|
76
|
+
.toPromise()
|
|
77
|
+
.then(function (res) {
|
|
78
|
+
_this.updateImage(res);
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
LoginComponent.prototype.updateImage = function (res) {
|
|
82
|
+
var user = res.user;
|
|
83
|
+
var location = res.location;
|
|
84
|
+
this.imageUrl = res.urls.regular;
|
|
85
|
+
this.imageCreator = user.name;
|
|
86
|
+
this.imageLocation = location.name;
|
|
87
|
+
this.imageCreatorUrl = user.links.html;
|
|
88
|
+
this.imageUnsplashUrl = res.links.html;
|
|
89
|
+
};
|
|
59
90
|
/**
|
|
60
91
|
* Attempts to read a redirect param from the current url and parse it into a
|
|
61
92
|
* route from which the user was redirected after a 401 error.
|
|
@@ -79,13 +110,14 @@
|
|
|
79
110
|
LoginComponent.decorators = [
|
|
80
111
|
{ type: i0.Component, args: [{
|
|
81
112
|
selector: 'vdr-login',
|
|
82
|
-
template: "<div class=\"login-wrapper\">\r\n <
|
|
83
|
-
styles: [".login-wrapper{background-image:
|
|
113
|
+
template: "<div class=\"login-wrapper\">\r\n <div class=\"login-wrapper-inner\">\r\n <div class=\"login-wrapper-image\">\r\n <div class=\"login-wrapper-image-content\">\r\n <div class=\"login-wrapper-image-title\">\r\n {{ 'common.login-image-title' | translate }}\r\n </div>\r\n <div class=\"login-wrapper-image-copyright\">\r\n <p *ngIf=\"imageCreator\" class=\"creator\">Photo by <a [href]=\"imageCreatorUrl\" target=\"_blank\">{{ imageCreator }}</a> on <a [href]=\"imageUnsplashUrl\" target=\"_blank\">Unsplash</a></p>\r\n <p *ngIf=\"imageLocation\" class=\"location\">{{ imageLocation }}</p>\r\n </div>\r\n </div>\r\n <img *ngIf=\"imageUrl\" [src]=\"imageUrl\" [alt]=\"imageUrl\">\r\n </div>\r\n <div class=\"login-wrapper-form\">\r\n <p class=\"login-title\">\r\n {{ 'common.login-title' | translate }}\r\n </p>\r\n <form class=\"login-form\">\r\n <div class=\"login-group\">\r\n <input\r\n class=\"username\"\r\n type=\"text\"\r\n name=\"username\"\r\n id=\"login_username\"\r\n [(ngModel)]=\"username\"\r\n [placeholder]=\"'common.username' | translate\"\r\n />\r\n <input\r\n class=\"password\"\r\n name=\"password\"\r\n type=\"password\"\r\n id=\"login_password\"\r\n [(ngModel)]=\"password\"\r\n [placeholder]=\"'common.password' | translate\"\r\n />\r\n <clr-alert [clrAlertType]=\"'danger'\" [clrAlertClosable]=\"false\" [class.visible]=\"errorMessage\" class=\"login-error\">\r\n <clr-alert-item>\r\n <span class=\"alert-text\">\r\n {{ errorMessage }}\r\n </span>\r\n </clr-alert-item>\r\n </clr-alert>\r\n <clr-checkbox-wrapper>\r\n <input\r\n type=\"checkbox\"\r\n clrCheckbox\r\n id=\"rememberme\"\r\n name=\"rememberme\"\r\n [(ngModel)]=\"rememberMe\"\r\n />\r\n <label>{{ 'common.remember-me' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n <button\r\n type=\"submit\"\r\n class=\"btn btn-primary\"\r\n (click)=\"logIn()\"\r\n [disabled]=\"!username || !password\"\r\n >\r\n {{ 'common.login' | translate }}\r\n </button>\r\n </div>\r\n <div class=\"version\">\r\n <span *ngIf=\"brand\">{{ brand }} <span *ngIf=\"!hideVendureBranding || !hideVersion\">-</span></span>\r\n <span *ngIf=\"!hideVendureBranding\">vendure</span>\r\n <span *ngIf=\"!hideVersion\">v{{ version }}</span>\r\n </div>\r\n </form>\r\n </div>\r\n <img class=\"login-wrapper-logo\" src=\"assets/logo-300px.png\" />\r\n </div>\r\n</div>\r\n",
|
|
114
|
+
styles: [".login-wrapper{background:#f0f2f5;background-image:none;height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}.login-wrapper .login-wrapper-inner{background:#fff;width:1120px;height:590px;display:flex;justify-content:flex-start;align-items:stretch;position:relative;border-radius:3px;overflow:hidden}@media (max-width: 992px){.login-wrapper .login-wrapper-inner{flex-direction:column;height:auto;width:100%}}.login-wrapper .login-wrapper-inner .login-wrapper-image{height:100%;flex-grow:1;position:relative}@media (max-width: 992px){.login-wrapper .login-wrapper-inner .login-wrapper-image{height:300px}}.login-wrapper .login-wrapper-inner .login-wrapper-image img{display:block;width:100%;height:100%;object-fit:cover;object-position:center;position:relative;z-index:1}.login-wrapper .login-wrapper-inner .login-wrapper-image .login-wrapper-image-content{width:100%;height:100%;position:absolute;left:0;bottom:0;z-index:10;background:#020024;background:linear-gradient(180deg,rgba(2,0,36,0) 0%,rgba(0,0,0,.75) 100%);display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;padding:30px}.login-wrapper .login-wrapper-inner .login-wrapper-image .login-wrapper-image-content .login-wrapper-image-title{font-size:1.6rem;font-weight:bold;color:#fff;margin-bottom:20px}@media (max-width: 992px){.login-wrapper .login-wrapper-inner .login-wrapper-image .login-wrapper-image-content .login-wrapper-image-title{font-size:1.2rem}}.login-wrapper .login-wrapper-inner .login-wrapper-image .login-wrapper-image-content .login-wrapper-image-copyright{opacity:.8}.login-wrapper .login-wrapper-inner .login-wrapper-image .login-wrapper-image-content .login-wrapper-image-copyright p{font-size:.6rem;color:#fff;margin:0!important}.login-wrapper .login-wrapper-inner .login-wrapper-image .login-wrapper-image-content .login-wrapper-image-copyright a{color:#fff;text-decoration:underline}.login-wrapper .login-wrapper-inner .login-wrapper-form{height:100%;width:400px;padding:40px;display:flex;flex-direction:column;align-items:stretch;justify-content:center;box-shadow:0 20px 25px #0000001a;overflow:hidden;border-radius:5px;flex-shrink:0}@media (max-width: 992px){.login-wrapper .login-wrapper-inner .login-wrapper-form{height:auto;width:100%;padding:20px}}.login-wrapper .login-wrapper-inner .login-wrapper-form .login-title{font-weight:bold;font-size:1.2rem;margin-bottom:20px;color:#afafaf}.login-wrapper .login-wrapper-inner .login-wrapper-form .login-group input.username,.login-wrapper .login-wrapper-inner .login-wrapper-form .login-group input.password{display:block;width:100%;margin-bottom:15px;padding:12px 16px!important;background:#fff;font-size:14px;line-height:22px;color:#52667a;outline:none;-webkit-appearance:none}.login-wrapper .login-wrapper-inner .login-wrapper-form .login-group .btn{width:100%!important;margin-top:20px!important}.login-wrapper .login-wrapper-inner .login-wrapper-logo{width:60px;height:auto;position:absolute;right:20px;top:20px}.version{flex:1;flex-grow:1;display:flex;align-items:flex-end;justify-content:center;color:var(--color-grey-300)}.version span+span{margin-left:5px}.login-error{max-height:0;overflow:hidden}.login-error.visible{max-height:46px;transition:max-height .2s;animation:shake .82s cubic-bezier(.36,.07,.19,.97) both;animation-delay:.2s;transform:translate(0);-webkit-backface-visibility:hidden;backface-visibility:hidden;perspective:1000px}@keyframes shake{10%,90%{transform:translate(-1px)}20%,80%{transform:translate(2px)}30%,50%,70%{transform:translate(-4px)}40%,60%{transform:translate(4px)}}\n"]
|
|
84
115
|
},] }
|
|
85
116
|
];
|
|
86
117
|
LoginComponent.ctorParameters = function () { return [
|
|
87
118
|
{ type: i2.AuthService },
|
|
88
|
-
{ type: i1.Router }
|
|
119
|
+
{ type: i1.Router },
|
|
120
|
+
{ type: http.HttpClient }
|
|
89
121
|
]; };
|
|
90
122
|
|
|
91
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendure-admin-ui-login.umd.js","sources":["../../src/lib/login/src/components/login/login.component.ts","../../src/lib/login/src/providers/login.guard.ts","../../src/lib/login/src/login.routes.ts","../../src/lib/login/src/login.module.ts","../../src/lib/login/src/public_api.ts","../../src/lib/login/src/vendure-admin-ui-login.ts"],"sourcesContent":["import { Component } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport { ADMIN_UI_VERSION, AuthService, AUTH_REDIRECT_PARAM, getAppConfig } from '@vendure/admin-ui/core';\r\n\r\n@Component({\r\n selector: 'vdr-login',\r\n templateUrl: './login.component.html',\r\n styleUrls: ['./login.component.scss'],\r\n})\r\nexport class LoginComponent {\r\n username = '';\r\n password = '';\r\n rememberMe = false;\r\n version = ADMIN_UI_VERSION;\r\n errorMessage: string | undefined;\r\n brand = getAppConfig().brand;\r\n hideVendureBranding = getAppConfig().hideVendureBranding;\r\n hideVersion = getAppConfig().hideVersion;\r\n\r\n constructor(private authService: AuthService, private router: Router) {}\r\n\r\n logIn(): void {\r\n this.errorMessage = undefined;\r\n this.authService.logIn(this.username, this.password, this.rememberMe).subscribe(result => {\r\n switch (result.__typename) {\r\n case 'CurrentUser':\r\n const redirect = this.getRedirectRoute();\r\n this.router.navigateByUrl(redirect ? redirect : '/');\r\n break;\r\n case 'InvalidCredentialsError':\r\n case 'NativeAuthStrategyError':\r\n this.errorMessage = result.message;\r\n break;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Attempts to read a redirect param from the current url and parse it into a\r\n * route from which the user was redirected after a 401 error.\r\n */\r\n private getRedirectRoute(): string | undefined {\r\n let redirectTo: string | undefined;\r\n const re = new RegExp(`${AUTH_REDIRECT_PARAM}=(.*)`);\r\n try {\r\n const redirectToParam = window.location.search.match(re);\r\n if (redirectToParam && 1 < redirectToParam.length) {\r\n redirectTo = atob(decodeURIComponent(redirectToParam[1]));\r\n }\r\n } catch (e) {\r\n // ignore\r\n }\r\n return redirectTo;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';\r\nimport { AuthService } from '@vendure/admin-ui/core';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\n\r\n/**\r\n * This guard prevents loggen-in users from navigating to the login screen.\r\n */\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class LoginGuard implements CanActivate {\r\n constructor(private router: Router, private authService: AuthService) {}\r\n\r\n canActivate(route: ActivatedRouteSnapshot): Observable<boolean> {\r\n return this.authService.checkAuthenticatedStatus().pipe(\r\n map(authenticated => {\r\n if (authenticated) {\r\n this.router.navigate(['/']);\r\n }\r\n return !authenticated;\r\n }),\r\n );\r\n }\r\n}\r\n","import { Routes } from '@angular/router';\r\n\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { LoginGuard } from './providers/login.guard';\r\n\r\nexport const loginRoutes: Routes = [\r\n {\r\n path: '',\r\n component: LoginComponent,\r\n pathMatch: 'full',\r\n canActivate: [LoginGuard],\r\n },\r\n];\r\n","import { NgModule } from '@angular/core';\r\nimport { RouterModule } from '@angular/router';\r\nimport { SharedModule } from '@vendure/admin-ui/core';\r\n\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { loginRoutes } from './login.routes';\r\n\r\n@NgModule({\r\n imports: [SharedModule, RouterModule.forChild(loginRoutes)],\r\n exports: [],\r\n declarations: [LoginComponent],\r\n})\r\nexport class LoginModule {}\r\n","// This file was generated by the build-public-api.ts script\nexport * from './components/login/login.component';\nexport * from './login.module';\nexport * from './login.routes';\nexport * from './providers/login.guard';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["ADMIN_UI_VERSION","getAppConfig","AUTH_REDIRECT_PARAM","Component","AuthService","Router","map","Injectable","NgModule","SharedModule","RouterModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"vendure-admin-ui-login.umd.js","sources":["../../src/lib/login/src/components/login/login.component.ts","../../src/lib/login/src/providers/login.guard.ts","../../src/lib/login/src/login.routes.ts","../../src/lib/login/src/login.module.ts","../../src/lib/login/src/public_api.ts","../../src/lib/login/src/vendure-admin-ui-login.ts"],"sourcesContent":["import { HttpClient, HttpParams } from '@angular/common/http';\r\nimport { Component } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport { ADMIN_UI_VERSION, AuthService, AUTH_REDIRECT_PARAM, getAppConfig } from '@vendure/admin-ui/core';\r\n\r\n@Component({\r\n selector: 'vdr-login',\r\n templateUrl: './login.component.html',\r\n styleUrls: ['./login.component.scss'],\r\n})\r\nexport class LoginComponent {\r\n username = '';\r\n password = '';\r\n rememberMe = false;\r\n version = ADMIN_UI_VERSION;\r\n errorMessage: string | undefined;\r\n brand = getAppConfig().brand;\r\n hideVendureBranding = getAppConfig().hideVendureBranding;\r\n hideVersion = getAppConfig().hideVersion;\r\n customImageUrl = getAppConfig().loginImageUrl;\r\n imageUrl = '';\r\n imageUnsplashUrl = '';\r\n imageLocation = '';\r\n imageCreator = '';\r\n imageCreatorUrl = '';\r\n\r\n constructor(private authService: AuthService, private router: Router, private httpClient: HttpClient) {\r\n if (this.customImageUrl) {\r\n this.imageUrl = this.customImageUrl;\r\n } else {\r\n this.loadImage();\r\n }\r\n }\r\n\r\n logIn(): void {\r\n this.errorMessage = undefined;\r\n this.authService.logIn(this.username, this.password, this.rememberMe).subscribe(result => {\r\n switch (result.__typename) {\r\n case 'CurrentUser':\r\n const redirect = this.getRedirectRoute();\r\n this.router.navigateByUrl(redirect ? redirect : '/');\r\n break;\r\n case 'InvalidCredentialsError':\r\n case 'NativeAuthStrategyError':\r\n this.errorMessage = result.message;\r\n break;\r\n }\r\n });\r\n }\r\n\r\n loadImage() {\r\n this.httpClient\r\n .get('https://login-image.vendure.io')\r\n .toPromise()\r\n .then(res => {\r\n this.updateImage(res);\r\n });\r\n }\r\n\r\n updateImage(res: any) {\r\n const user: any = (res as any).user;\r\n const location: any = (res as any).location;\r\n\r\n this.imageUrl = res.urls.regular;\r\n this.imageCreator = user.name;\r\n this.imageLocation = location.name;\r\n this.imageCreatorUrl = user.links.html;\r\n this.imageUnsplashUrl = res.links.html;\r\n }\r\n\r\n /**\r\n * Attempts to read a redirect param from the current url and parse it into a\r\n * route from which the user was redirected after a 401 error.\r\n */\r\n private getRedirectRoute(): string | undefined {\r\n let redirectTo: string | undefined;\r\n const re = new RegExp(`${AUTH_REDIRECT_PARAM}=(.*)`);\r\n try {\r\n const redirectToParam = window.location.search.match(re);\r\n if (redirectToParam && 1 < redirectToParam.length) {\r\n redirectTo = atob(decodeURIComponent(redirectToParam[1]));\r\n }\r\n } catch (e) {\r\n // ignore\r\n }\r\n return redirectTo;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';\r\nimport { AuthService } from '@vendure/admin-ui/core';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\n\r\n/**\r\n * This guard prevents loggen-in users from navigating to the login screen.\r\n */\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class LoginGuard implements CanActivate {\r\n constructor(private router: Router, private authService: AuthService) {}\r\n\r\n canActivate(route: ActivatedRouteSnapshot): Observable<boolean> {\r\n return this.authService.checkAuthenticatedStatus().pipe(\r\n map(authenticated => {\r\n if (authenticated) {\r\n this.router.navigate(['/']);\r\n }\r\n return !authenticated;\r\n }),\r\n );\r\n }\r\n}\r\n","import { Routes } from '@angular/router';\r\n\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { LoginGuard } from './providers/login.guard';\r\n\r\nexport const loginRoutes: Routes = [\r\n {\r\n path: '',\r\n component: LoginComponent,\r\n pathMatch: 'full',\r\n canActivate: [LoginGuard],\r\n },\r\n];\r\n","import { NgModule } from '@angular/core';\r\nimport { RouterModule } from '@angular/router';\r\nimport { SharedModule } from '@vendure/admin-ui/core';\r\n\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { loginRoutes } from './login.routes';\r\n\r\n@NgModule({\r\n imports: [SharedModule, RouterModule.forChild(loginRoutes)],\r\n exports: [],\r\n declarations: [LoginComponent],\r\n})\r\nexport class LoginModule {}\r\n","// This file was generated by the build-public-api.ts script\nexport * from './components/login/login.component';\nexport * from './login.module';\nexport * from './login.routes';\nexport * from './providers/login.guard';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["ADMIN_UI_VERSION","getAppConfig","AUTH_REDIRECT_PARAM","Component","AuthService","Router","HttpClient","map","Injectable","NgModule","SharedModule","RouterModule"],"mappings":"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"}
|
|
@@ -2906,8 +2906,49 @@
|
|
|
2906
2906
|
{ type: OrderTransitionService }
|
|
2907
2907
|
]; };
|
|
2908
2908
|
|
|
2909
|
+
var OrderHistoryEntryHostComponent = /** @class */ (function () {
|
|
2910
|
+
function OrderHistoryEntryHostComponent(componentFactoryResolver, historyEntryComponentService) {
|
|
2911
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
2912
|
+
this.historyEntryComponentService = historyEntryComponentService;
|
|
2913
|
+
this.expandClick = new i0.EventEmitter();
|
|
2914
|
+
}
|
|
2915
|
+
OrderHistoryEntryHostComponent.prototype.ngOnInit = function () {
|
|
2916
|
+
var componentType = this.historyEntryComponentService.getComponent(this.entry.type);
|
|
2917
|
+
var factory = this.componentFactoryResolver.resolveComponentFactory(componentType);
|
|
2918
|
+
var componentRef = this.portalRef.createComponent(factory);
|
|
2919
|
+
componentRef.instance.entry = this.entry;
|
|
2920
|
+
componentRef.instance.order = this.order;
|
|
2921
|
+
this.instance = componentRef.instance;
|
|
2922
|
+
this.componentRef = componentRef;
|
|
2923
|
+
};
|
|
2924
|
+
OrderHistoryEntryHostComponent.prototype.ngOnDestroy = function () {
|
|
2925
|
+
var _a;
|
|
2926
|
+
(_a = this.componentRef) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
2927
|
+
};
|
|
2928
|
+
return OrderHistoryEntryHostComponent;
|
|
2929
|
+
}());
|
|
2930
|
+
OrderHistoryEntryHostComponent.decorators = [
|
|
2931
|
+
{ type: i0.Component, args: [{
|
|
2932
|
+
selector: 'vdr-order-history-entry-host',
|
|
2933
|
+
template: " <vdr-timeline-entry\n [displayType]=\"instance.getDisplayType(entry)\"\n [iconShape]=\"instance.getIconShape && instance.getIconShape(entry)\"\n [createdAt]=\"entry.createdAt\"\n [name]=\"instance.getName && instance.getName(entry)\"\n [featured]=\"instance.isFeatured(entry)\"\n [collapsed]=\"!expanded && !instance.isFeatured(entry)\"\n (expandClick)=\"expandClick.emit()\"\n >\n <div #portal></div>\n </vdr-timeline-entry>",
|
|
2934
|
+
exportAs: 'historyEntry'
|
|
2935
|
+
},] }
|
|
2936
|
+
];
|
|
2937
|
+
OrderHistoryEntryHostComponent.ctorParameters = function () { return [
|
|
2938
|
+
{ type: i0.ComponentFactoryResolver },
|
|
2939
|
+
{ type: i1.HistoryEntryComponentService }
|
|
2940
|
+
]; };
|
|
2941
|
+
OrderHistoryEntryHostComponent.propDecorators = {
|
|
2942
|
+
entry: [{ type: i0.Input }],
|
|
2943
|
+
order: [{ type: i0.Input }],
|
|
2944
|
+
expanded: [{ type: i0.Input }],
|
|
2945
|
+
expandClick: [{ type: i0.Output }],
|
|
2946
|
+
portalRef: [{ type: i0.ViewChild, args: ['portal', { static: true, read: i0.ViewContainerRef },] }]
|
|
2947
|
+
};
|
|
2948
|
+
|
|
2909
2949
|
var OrderHistoryComponent = /** @class */ (function () {
|
|
2910
|
-
function OrderHistoryComponent() {
|
|
2950
|
+
function OrderHistoryComponent(historyEntryComponentService) {
|
|
2951
|
+
this.historyEntryComponentService = historyEntryComponentService;
|
|
2911
2952
|
this.addNote = new i0.EventEmitter();
|
|
2912
2953
|
this.updateNote = new i0.EventEmitter();
|
|
2913
2954
|
this.deleteNote = new i0.EventEmitter();
|
|
@@ -2916,6 +2957,9 @@
|
|
|
2916
2957
|
this.expanded = false;
|
|
2917
2958
|
this.type = i1.HistoryEntryType;
|
|
2918
2959
|
}
|
|
2960
|
+
OrderHistoryComponent.prototype.hasCustomComponent = function (type) {
|
|
2961
|
+
return !!this.historyEntryComponentService.getComponent(type);
|
|
2962
|
+
};
|
|
2919
2963
|
OrderHistoryComponent.prototype.getDisplayType = function (entry) {
|
|
2920
2964
|
if (entry.type === i1.HistoryEntryType.ORDER_STATE_TRANSITION) {
|
|
2921
2965
|
if (entry.data.to === 'Delivered') {
|
|
@@ -2987,7 +3031,7 @@
|
|
|
2987
3031
|
case i1.HistoryEntryType.ORDER_MODIFIED:
|
|
2988
3032
|
return true;
|
|
2989
3033
|
default:
|
|
2990
|
-
return
|
|
3034
|
+
return true;
|
|
2991
3035
|
}
|
|
2992
3036
|
};
|
|
2993
3037
|
OrderHistoryComponent.prototype.getFulfillment = function (entry) {
|
|
@@ -3070,11 +3114,14 @@
|
|
|
3070
3114
|
OrderHistoryComponent.decorators = [
|
|
3071
3115
|
{ type: i0.Component, args: [{
|
|
3072
3116
|
selector: 'vdr-order-history',
|
|
3073
|
-
template: "<h4>{{ 'order.order-history' | translate }}</h4>\r\n<div class=\"entry-list\" [class.expanded]=\"expanded\">\r\n <vdr-timeline-entry iconShape=\"note\" displayType=\"muted\" [featured]=\"true\">\r\n <div class=\"note-entry\">\r\n <textarea [(ngModel)]=\"note\" name=\"note\" class=\"note\"></textarea>\r\n <button class=\"btn btn-secondary\" [disabled]=\"!note\" (click)=\"addNoteToOrder()\">\r\n {{ 'common.add-note' | translate }}\r\n </button>\r\n </div>\r\n <div class=\"visibility-select\">\r\n <clr-checkbox-wrapper>\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"noteIsPrivate\" />\r\n <label>{{ 'order.note-is-private' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n <span *ngIf=\"noteIsPrivate\" class=\"private\">\r\n {{ 'order.note-only-visible-to-administrators' | translate }}\r\n </span>\r\n <span *ngIf=\"!noteIsPrivate\" class=\"public\">\r\n {{ 'order.note-visible-to-customer' | translate }}\r\n </span>\r\n </div>\r\n </vdr-timeline-entry>\r\n <vdr-timeline-entry\r\n *ngFor=\"let entry of history\"\r\n [displayType]=\"getDisplayType(entry)\"\r\n [iconShape]=\"getTimelineIcon(entry)\"\r\n [createdAt]=\"entry.createdAt\"\r\n [name]=\"getName(entry)\"\r\n [featured]=\"isFeatured(entry)\"\r\n [collapsed]=\"!expanded && !isFeatured(entry)\"\r\n (expandClick)=\"expanded = !expanded\"\r\n >\r\n <ng-container [ngSwitch]=\"entry.type\">\r\n <ng-container *ngSwitchCase=\"type.ORDER_STATE_TRANSITION\">\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Delivered'\">\r\n {{ 'order.history-order-fulfilled' | translate }}\r\n </div>\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Cancelled'\">\r\n {{ 'order.history-order-cancelled' | translate }}\r\n </div>\r\n <ng-template [ngIf]=\"entry.data.to !== 'Cancelled' && entry.data.to !== 'Delivered'\">\r\n {{\r\n 'order.history-order-transition'\r\n | translate: { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_MODIFIED\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-modified' | translate }}\r\n </div>\r\n <ng-container *ngIf=\"getModification(entry.data.modificationId) as modification\">\r\n {{ 'order.modify-order-price-difference' | translate }}:\r\n <strong>{{ modification.priceChange | localeCurrency: order.currencyCode }}</strong>\r\n <vdr-chip colorType=\"success\" *ngIf=\"modification.isSettled\">{{\r\n 'order.modification-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip colorType=\"error\" *ngIf=\"!modification.isSettled\">{{\r\n 'order.modification-not-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail>\r\n <vdr-modification-detail\r\n [order]=\"order\"\r\n [modification]=\"modification\"\r\n ></vdr-modification-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_PAYMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Settled'; else regularPaymentTransition\">\r\n <div class=\"title\">\r\n {{ 'order.history-payment-settled' | translate }}\r\n </div>\r\n {{ 'order.transaction-id' | translate }}: {{ getPayment(entry)?.transactionId }}\r\n <vdr-history-entry-detail *ngIf=\"getPayment(entry) as payment\">\r\n <vdr-payment-detail\r\n [payment]=\"payment\"\r\n [currencyCode]=\"order.currencyCode\"\r\n ></vdr-payment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-template #regularPaymentTransition>\r\n {{\r\n 'order.history-payment-transition'\r\n | translate\r\n : {\r\n from: entry.data.from,\r\n to: entry.data.to,\r\n id: getPayment(entry)?.transactionId\r\n }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_REFUND_TRANSITION\">\r\n {{\r\n 'order.history-refund-transition'\r\n | translate: { from: entry.data.from, to: entry.data.to, id: entry.data.refundId }\r\n }}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_CANCELLATION\">\r\n {{ 'order.history-items-cancelled' | translate: { count: entry.data.orderItemIds.length } }}\r\n <vdr-history-entry-detail *ngIf=\"getCancelledItems(entry) as items\">\r\n <vdr-labeled-data [label]=\"'order.cancellation-reason' | translate\">\r\n {{ entry.data.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.contents' | translate\">\r\n <vdr-simple-item-list [items]=\"items\"></vdr-simple-item-list>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.shipping-cancelled' | translate\">\r\n {{ entry.data.shippingCancelled }}\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT\">\r\n {{ 'order.history-fulfillment-created' | translate }}\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Delivered'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-delivered' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to === 'Shipped'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-shipped' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to !== 'Delivered' && entry.data.to !== 'Shipped'\">\r\n {{\r\n 'order.history-fulfillment-transition'\r\n | translate: { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-container>\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_NOTE\">\r\n <div class=\"flex\">\r\n <div class=\"note-text\">\r\n <span *ngIf=\"entry.isPublic\" class=\"note-visibility public\">{{\r\n 'common.public' | translate\r\n }}</span>\r\n <span *ngIf=\"!entry.isPublic\" class=\"note-visibility private\">{{\r\n 'common.private' | translate\r\n }}</span>\r\n {{ entry.data.note }}\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n class=\"button\"\r\n vdrDropdownItem\r\n (click)=\"updateNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n class=\"button\"\r\n vdrDropdownItem\r\n (click)=\"deleteNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_APPLIED\">\r\n {{ 'order.history-coupon-code-applied' | translate }}:\r\n <vdr-chip>\r\n <a [routerLink]=\"['/marketing', 'promotions', entry.data.promotionId]\">{{\r\n entry.data.couponCode\r\n }}</a>\r\n </vdr-chip>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_REMOVED\">\r\n {{ 'order.history-coupon-code-removed' | translate }}:\r\n <vdr-chip\r\n ><span class=\"cancelled-coupon-code\">{{ entry.data.couponCode }}</span></vdr-chip\r\n >\r\n </ng-container>\r\n </ng-container>\r\n </vdr-timeline-entry>\r\n <vdr-timeline-entry [isLast]=\"true\" [createdAt]=\"order.createdAt\" [featured]=\"true\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-created' | translate }}\r\n </div>\r\n </vdr-timeline-entry>\r\n</div>\r\n",
|
|
3117
|
+
template: "<h4>{{ 'order.order-history' | translate }}</h4>\r\n<div class=\"entry-list\" [class.expanded]=\"expanded\">\r\n <vdr-timeline-entry iconShape=\"note\" displayType=\"muted\" [featured]=\"true\">\r\n <div class=\"note-entry\">\r\n <textarea [(ngModel)]=\"note\" name=\"note\" class=\"note\"></textarea>\r\n <button class=\"btn btn-secondary\" [disabled]=\"!note\" (click)=\"addNoteToOrder()\">\r\n {{ 'common.add-note' | translate }}\r\n </button>\r\n </div>\r\n <div class=\"visibility-select\">\r\n <clr-checkbox-wrapper>\r\n <input type=\"checkbox\" clrCheckbox [(ngModel)]=\"noteIsPrivate\" />\r\n <label>{{ 'order.note-is-private' | translate }}</label>\r\n </clr-checkbox-wrapper>\r\n <span *ngIf=\"noteIsPrivate\" class=\"private\">\r\n {{ 'order.note-only-visible-to-administrators' | translate }}\r\n </span>\r\n <span *ngIf=\"!noteIsPrivate\" class=\"public\">\r\n {{ 'order.note-visible-to-customer' | translate }}\r\n </span>\r\n </div>\r\n </vdr-timeline-entry>\r\n <ng-container *ngFor=\"let entry of history\">\r\n <vdr-order-history-entry-host\r\n *ngIf=\"hasCustomComponent(entry.type); else defaultComponents\"\r\n [order]=\"order\"\r\n [entry]=\"entry\"\r\n [expanded]=\"expanded\"\r\n (expandClick)=\"expanded = !expanded\"\r\n ></vdr-order-history-entry-host>\r\n <ng-template #defaultComponents>\r\n <vdr-timeline-entry\r\n [displayType]=\"getDisplayType(entry)\"\r\n [iconShape]=\"getTimelineIcon(entry)\"\r\n [createdAt]=\"entry.createdAt\"\r\n [name]=\"getName(entry)\"\r\n [featured]=\"isFeatured(entry)\"\r\n [collapsed]=\"!expanded && !isFeatured(entry)\"\r\n (expandClick)=\"expanded = !expanded\"\r\n >\r\n <ng-container [ngSwitch]=\"entry.type\">\r\n <ng-container *ngSwitchCase=\"type.ORDER_STATE_TRANSITION\">\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Delivered'\">\r\n {{ 'order.history-order-fulfilled' | translate }}\r\n </div>\r\n <div class=\"title\" *ngIf=\"entry.data.to === 'Cancelled'\">\r\n {{ 'order.history-order-cancelled' | translate }}\r\n </div>\r\n <ng-template [ngIf]=\"entry.data.to !== 'Cancelled' && entry.data.to !== 'Delivered'\">\r\n {{\r\n 'order.history-order-transition'\r\n | translate: { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_MODIFIED\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-modified' | translate }}\r\n </div>\r\n <ng-container *ngIf=\"getModification(entry.data.modificationId) as modification\">\r\n {{ 'order.modify-order-price-difference' | translate }}:\r\n <strong>{{\r\n modification.priceChange | localeCurrency: order.currencyCode\r\n }}</strong>\r\n <vdr-chip colorType=\"success\" *ngIf=\"modification.isSettled\">{{\r\n 'order.modification-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-chip colorType=\"error\" *ngIf=\"!modification.isSettled\">{{\r\n 'order.modification-not-settled' | translate\r\n }}</vdr-chip>\r\n <vdr-history-entry-detail>\r\n <vdr-modification-detail\r\n [order]=\"order\"\r\n [modification]=\"modification\"\r\n ></vdr-modification-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_PAYMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Settled'; else regularPaymentTransition\">\r\n <div class=\"title\">\r\n {{ 'order.history-payment-settled' | translate }}\r\n </div>\r\n {{ 'order.transaction-id' | translate }}: {{ getPayment(entry)?.transactionId }}\r\n <vdr-history-entry-detail *ngIf=\"getPayment(entry) as payment\">\r\n <vdr-payment-detail\r\n [payment]=\"payment\"\r\n [currencyCode]=\"order.currencyCode\"\r\n ></vdr-payment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-template #regularPaymentTransition>\r\n {{\r\n 'order.history-payment-transition'\r\n | translate\r\n : {\r\n from: entry.data.from,\r\n to: entry.data.to,\r\n id: getPayment(entry)?.transactionId\r\n }\r\n }}\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_REFUND_TRANSITION\">\r\n {{\r\n 'order.history-refund-transition'\r\n | translate\r\n : { from: entry.data.from, to: entry.data.to, id: entry.data.refundId }\r\n }}\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_CANCELLATION\">\r\n {{\r\n 'order.history-items-cancelled'\r\n | translate: { count: entry.data.orderItemIds.length }\r\n }}\r\n <vdr-history-entry-detail *ngIf=\"getCancelledItems(entry) as items\">\r\n <vdr-labeled-data [label]=\"'order.cancellation-reason' | translate\">\r\n {{ entry.data.reason }}\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.contents' | translate\">\r\n <vdr-simple-item-list [items]=\"items\"></vdr-simple-item-list>\r\n </vdr-labeled-data>\r\n <vdr-labeled-data [label]=\"'order.shipping-cancelled' | translate\">\r\n {{ entry.data.shippingCancelled }}\r\n </vdr-labeled-data>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT\">\r\n {{ 'order.history-fulfillment-created' | translate }}\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_FULFILLMENT_TRANSITION\">\r\n <ng-container *ngIf=\"entry.data.to === 'Delivered'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-delivered' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to === 'Shipped'\">\r\n <div class=\"title\">\r\n {{ 'order.history-fulfillment-shipped' | translate }}\r\n </div>\r\n {{ 'order.tracking-code' | translate }}: {{ getFulfillment(entry)?.trackingCode }}\r\n </ng-container>\r\n <ng-container *ngIf=\"entry.data.to !== 'Delivered' && entry.data.to !== 'Shipped'\">\r\n {{\r\n 'order.history-fulfillment-transition'\r\n | translate: { from: entry.data.from, to: entry.data.to }\r\n }}\r\n </ng-container>\r\n <vdr-history-entry-detail *ngIf=\"getFulfillment(entry) as fulfillment\">\r\n <vdr-fulfillment-detail\r\n [fulfillmentId]=\"fulfillment.id\"\r\n [order]=\"order\"\r\n ></vdr-fulfillment-detail>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_NOTE\">\r\n <div class=\"flex\">\r\n <div class=\"note-text\">\r\n <span *ngIf=\"entry.isPublic\" class=\"note-visibility public\">{{\r\n 'common.public' | translate\r\n }}</span>\r\n <span *ngIf=\"!entry.isPublic\" class=\"note-visibility private\">{{\r\n 'common.private' | translate\r\n }}</span>\r\n {{ entry.data.note }}\r\n </div>\r\n <div class=\"flex-spacer\"></div>\r\n <vdr-dropdown>\r\n <button class=\"icon-button\" vdrDropdownTrigger>\r\n <clr-icon shape=\"ellipsis-vertical\"></clr-icon>\r\n </button>\r\n <vdr-dropdown-menu vdrPosition=\"bottom-right\">\r\n <button\r\n class=\"button\"\r\n vdrDropdownItem\r\n (click)=\"updateNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"edit\"></clr-icon>\r\n {{ 'common.edit' | translate }}\r\n </button>\r\n <div class=\"dropdown-divider\"></div>\r\n <button\r\n class=\"button\"\r\n vdrDropdownItem\r\n (click)=\"deleteNote.emit(entry)\"\r\n [disabled]=\"!('UpdateOrder' | hasPermission)\"\r\n >\r\n <clr-icon shape=\"trash\" class=\"is-danger\"></clr-icon>\r\n {{ 'common.delete' | translate }}\r\n </button>\r\n </vdr-dropdown-menu>\r\n </vdr-dropdown>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_APPLIED\">\r\n {{ 'order.history-coupon-code-applied' | translate }}:\r\n <vdr-chip>\r\n <a [routerLink]=\"['/marketing', 'promotions', entry.data.promotionId]\">{{\r\n entry.data.couponCode\r\n }}</a>\r\n </vdr-chip>\r\n </ng-container>\r\n <ng-container *ngSwitchCase=\"type.ORDER_COUPON_REMOVED\">\r\n {{ 'order.history-coupon-code-removed' | translate }}:\r\n <vdr-chip\r\n ><span class=\"cancelled-coupon-code\">{{ entry.data.couponCode }}</span></vdr-chip\r\n >\r\n </ng-container>\r\n <ng-container *ngSwitchDefault>\r\n <div class=\"title\">\r\n {{ entry.type | translate }}\r\n </div>\r\n <vdr-history-entry-detail *ngIf=\"entry.data\">\r\n <vdr-object-tree [value]=\"entry.data\"></vdr-object-tree>\r\n </vdr-history-entry-detail>\r\n </ng-container>\r\n </ng-container>\r\n </vdr-timeline-entry>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <vdr-timeline-entry [isLast]=\"true\" [createdAt]=\"order.createdAt\" [featured]=\"true\">\r\n <div class=\"title\">\r\n {{ 'order.history-order-created' | translate }}\r\n </div>\r\n </vdr-timeline-entry>\r\n</div>\r\n",
|
|
3074
3118
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
3075
3119
|
styles: [":host{margin-top:48px;display:block}.entry-list{margin-top:24px;margin-left:24px;margin-right:12px}.note-entry{display:flex;align-items:center}.note-entry .note{flex:1}.note-entry button{margin:0}.visibility-select{display:flex;justify-content:space-between;align-items:baseline}.visibility-select .public{color:var(--color-warning-500)}.visibility-select .private{color:var(--color-success-500)}textarea.note{flex:1;height:36px;border-radius:3px;margin-right:6px}.note-text{color:var(--color-grey-800);white-space:pre-wrap}.cancelled-coupon-code{text-decoration:line-through}.note-visibility{text-transform:lowercase}.note-visibility.public{color:var(--color-warning-500)}.note-visibility.private{color:var(--color-success-500)}\n"]
|
|
3076
3120
|
},] }
|
|
3077
3121
|
];
|
|
3122
|
+
OrderHistoryComponent.ctorParameters = function () { return [
|
|
3123
|
+
{ type: i1.HistoryEntryComponentService }
|
|
3124
|
+
]; };
|
|
3078
3125
|
OrderHistoryComponent.propDecorators = {
|
|
3079
3126
|
order: [{ type: i0.Input }],
|
|
3080
3127
|
history: [{ type: i0.Input }],
|
|
@@ -3964,6 +4011,7 @@
|
|
|
3964
4011
|
SelectAddressDialogComponent,
|
|
3965
4012
|
CouponCodeSelectorComponent,
|
|
3966
4013
|
SelectShippingMethodDialogComponent,
|
|
4014
|
+
OrderHistoryEntryHostComponent,
|
|
3967
4015
|
],
|
|
3968
4016
|
},] }
|
|
3969
4017
|
];
|
|
@@ -3994,6 +4042,7 @@
|
|
|
3994
4042
|
exports.OrderEditsPreviewDialogComponent = OrderEditsPreviewDialogComponent;
|
|
3995
4043
|
exports.OrderGuard = OrderGuard;
|
|
3996
4044
|
exports.OrderHistoryComponent = OrderHistoryComponent;
|
|
4045
|
+
exports.OrderHistoryEntryHostComponent = OrderHistoryEntryHostComponent;
|
|
3997
4046
|
exports.OrderListComponent = OrderListComponent;
|
|
3998
4047
|
exports.OrderModule = OrderModule;
|
|
3999
4048
|
exports.OrderPaymentCardComponent = OrderPaymentCardComponent;
|