Skip to content

Commit

Permalink
feat(admin-ui): Implement creation of new PaymentMethods
Browse files Browse the repository at this point in the history
Relates to #671
  • Loading branch information
michaelbromley committed Feb 1, 2021
1 parent 15fc707 commit 09a1a97
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 53 deletions.
52 changes: 26 additions & 26 deletions packages/admin-ui/i18n-coverage.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
{
"generatedOn": "2021-01-22T13:12:13.937Z",
"lastCommit": "d969e15cbac79672127aee5446532e3e91eb20c5",
"generatedOn": "2021-02-01T13:23:30.145Z",
"lastCommit": "56c39f8ada2711dd731de4543e48358d24212b3f",
"translationStatus": {
"cs": {
"tokenCount": 765,
"translatedCount": 754,
"percentage": 99
"tokenCount": 767,
"translatedCount": 753,
"percentage": 98
},
"de": {
"tokenCount": 765,
"translatedCount": 595,
"percentage": 78
"tokenCount": 767,
"translatedCount": 594,
"percentage": 77
},
"en": {
"tokenCount": 765,
"tokenCount": 767,
"translatedCount": 764,
"percentage": 100
},
"es": {
"tokenCount": 765,
"translatedCount": 457,
"percentage": 60
"tokenCount": 767,
"translatedCount": 456,
"percentage": 59
},
"fr": {
"tokenCount": 765,
"translatedCount": 691,
"tokenCount": 767,
"translatedCount": 690,
"percentage": 90
},
"pl": {
"tokenCount": 765,
"translatedCount": 550,
"tokenCount": 767,
"translatedCount": 549,
"percentage": 72
},
"pt_BR": {
"tokenCount": 765,
"translatedCount": 641,
"percentage": 84
"tokenCount": 767,
"translatedCount": 749,
"percentage": 98
},
"zh_Hans": {
"tokenCount": 765,
"translatedCount": 532,
"percentage": 70
"tokenCount": 767,
"translatedCount": 531,
"percentage": 69
},
"zh_Hant": {
"tokenCount": 765,
"translatedCount": 532,
"percentage": 70
"tokenCount": 767,
"translatedCount": 531,
"percentage": 69
}
}
}
}
14 changes: 7 additions & 7 deletions packages/admin-ui/src/lib/core/src/common/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ export type ImportInfo = {
/**
* @description
* The state of a Job in the JobQueue
*
*
* @docsCategory common
*/
export enum JobState {
Expand Down Expand Up @@ -2569,7 +2569,7 @@ export enum DeletionResult {
* @description
* Permissions for administrators and customers. Used to control access to
* GraphQL resolvers via the {@link Allow} decorator.
*
*
* @docsCategory common
*/
export enum Permission {
Expand Down Expand Up @@ -2778,7 +2778,7 @@ export type ConfigArgDefinition = {
type: Scalars['String'];
list: Scalars['Boolean'];
required: Scalars['Boolean'];
defaultValue?: Maybe<Scalars['String']>;
defaultValue?: Maybe<Scalars['JSON']>;
label?: Maybe<Scalars['String']>;
description?: Maybe<Scalars['String']>;
ui?: Maybe<Scalars['JSON']>;
Expand Down Expand Up @@ -2966,7 +2966,7 @@ export type CountryList = PaginatedList & {
/**
* @description
* ISO 4217 currency code
*
*
* @docsCategory common
*/
export enum CurrencyCode {
Expand Down Expand Up @@ -3503,7 +3503,7 @@ export type HistoryEntryList = PaginatedList & {
* region or script modifier (e.g. de_AT). The selection available is based
* on the [Unicode CLDR summary list](https://unicode-org.github.io/cldr-staging/charts/37/summary/root.html)
* and includes the major spoken languages of the world and any widely-used variants.
*
*
* @docsCategory common
*/
export enum LanguageCode {
Expand Down Expand Up @@ -3882,7 +3882,7 @@ export type OrderItem = Node & {
unitPriceWithTax: Scalars['Int'];
/**
* The price of a single unit including discounts, excluding tax.
*
*
* If Order-level discounts have been applied, this will not be the
* actual taxable unit price (see `proratedUnitPrice`), but is generally the
* correct price to display to customers to avoid confusion
Expand Down Expand Up @@ -3922,7 +3922,7 @@ export type OrderLine = Node & {
unitPriceWithTax: Scalars['Int'];
/**
* The price of a single unit including discounts, excluding tax.
*
*
* If Order-level discounts have been applied, this will not be the
* actual taxable unit price (see `proratedUnitPrice`), but is generally the
* correct price to display to customers to avoid confusion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ export function configurableOperationValueIsValid(
* Returns a default value based on the type of the config arg.
*/
export function getDefaultConfigArgValue(arg: ConfigArgDefinition): any {
return arg.list ? [] : arg.defaultValue || null; // getDefaultConfigArgSingleValue(arg.type as ConfigArgType);
return arg.list ? [] : arg.defaultValue ?? null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class="btn btn-primary"
*ngIf="isNew$ | async; else updateButton"
[disabled]="detailForm.pristine || detailForm.invalid"
(click)="create()"
>
{{ 'common.create' | translate }}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export class PaymentMethodDetailComponent
});
this.detailForm.markAsPristine();
this.changeDetector.markForCheck();
this.router.navigate(['../', data.createPaymentMethod.id], { relativeTo: this.route });
},
err => {
this.notificationService.error(_('common.notify-create-error'), {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<vdr-action-bar>
<vdr-ab-right>
<vdr-action-bar-items locationId="payment-method-list"></vdr-action-bar-items>
<a class="btn btn-primary" [routerLink]="['./create']" *vdrIfPermissions="'CreateSettings'">
<clr-icon shape="plus"></clr-icon>
{{ 'settings.create-new-payment-method' | translate }}
</a>
</vdr-ab-right>
</vdr-action-bar>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export class PaymentMethodResolver extends BaseEntityResolver<PaymentMethod.Frag
code: '',
description: '',
enabled: true,
handler: {} as any,
checker: undefined as any,
handler: undefined as any,
},
id => dataService.settings.getPaymentMethod(id).mapStream(data => data.paymentMethod),
);
Expand Down
6 changes: 4 additions & 2 deletions packages/admin-ui/src/lib/static/i18n-messages/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@
"confirm-delete-tax-rate": "Smazat daňovou sazbu?",
"create-new-channel": "Vytvořit kanál",
"create-new-country": "Vytvořit zemi",
"create-new-payment-method": "",
"create-new-role": "Vytvořit roli",
"create-new-shipping-method": "Vytvořit dodací metodu",
"create-new-tax-category": "Vytvořit daňovou kategorii",
Expand All @@ -734,7 +735,8 @@
"last-name": "Příjmení",
"no-eligible-shipping-methods": "Nezpůsobilé pro žádnou dodací metodu",
"password": "Heslo",
"payment-method-config-options": "Konfigurace platební metody",
"payment-eligibility-checker": "",
"payment-handler": "",
"permissions": "Oprávnění",
"prices-include-tax": "Zadávané ceny jsou včetně daně pro výchozí zónu",
"profile": "Profil",
Expand Down Expand Up @@ -798,4 +800,4 @@
"job-result": "Výsledek úlohy",
"job-state": "Stav úlohy"
}
}
}
6 changes: 4 additions & 2 deletions packages/admin-ui/src/lib/static/i18n-messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@
"confirm-delete-tax-rate": "Steuersatz löschen?",
"create-new-channel": "Neuen Kanal erstellen",
"create-new-country": "Neues Land erstellen",
"create-new-payment-method": "",
"create-new-role": "Neue Rolle erstellen",
"create-new-shipping-method": "Neue Versandart erstellen",
"create-new-tax-category": "Neue Steuerkategorie erstellen",
Expand All @@ -734,7 +735,8 @@
"last-name": "Nachname",
"no-eligible-shipping-methods": "Keine verfügbaren Versandarten",
"password": "Passwort",
"payment-method-config-options": "Konfiguration der Zahlungsart",
"payment-eligibility-checker": "",
"payment-handler": "",
"permissions": "Berechtigungen",
"prices-include-tax": "Preise enthalten die Steuer für die Standardzone",
"profile": "",
Expand Down Expand Up @@ -798,4 +800,4 @@
"job-result": "Job-Ergebnis",
"job-state": "Job-Status"
}
}
}
4 changes: 3 additions & 1 deletion packages/admin-ui/src/lib/static/i18n-messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@
"confirm-delete-tax-rate": "Delete tax rate?",
"create-new-channel": "Create new channel",
"create-new-country": "Create new country",
"create-new-payment-method": "Create new payment method",
"create-new-role": "Create new role",
"create-new-shipping-method": "Create new shipping method",
"create-new-tax-category": "Create tax category",
Expand All @@ -734,7 +735,8 @@
"last-name": "Last name",
"no-eligible-shipping-methods": "No eligible shipping methods",
"password": "Password",
"payment-method-config-options": "Payment method configuration",
"payment-eligibility-checker": "Payment eligibility checker",
"payment-handler": "Payment handler",
"permissions": "Permissions",
"prices-include-tax": "Prices include tax for the default Zone",
"profile": "Profile",
Expand Down
6 changes: 4 additions & 2 deletions packages/admin-ui/src/lib/static/i18n-messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@
"confirm-delete-tax-rate": "¿Eliminar tasa de impuestos?",
"create-new-channel": "Crear nuevo canal",
"create-new-country": "Crear nuevo país",
"create-new-payment-method": "",
"create-new-role": "Crear nuevo rol",
"create-new-shipping-method": "Crear nuevo método de envío",
"create-new-tax-category": "Crear categoría de impuestos",
Expand All @@ -734,7 +735,8 @@
"last-name": "Apellidos",
"no-eligible-shipping-methods": "No hay métodos de envío disponibles",
"password": "Contraseña",
"payment-method-config-options": "Configuración método de pago",
"payment-eligibility-checker": "",
"payment-handler": "",
"permissions": "Permisos",
"prices-include-tax": "Los precios incluyen impuestos para la zona por defecto.",
"profile": "",
Expand Down Expand Up @@ -798,4 +800,4 @@
"job-result": "Resultado",
"job-state": "Estado"
}
}
}
6 changes: 4 additions & 2 deletions packages/admin-ui/src/lib/static/i18n-messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@
"confirm-delete-tax-rate": "Supprimer le taux de taxe ?",
"create-new-channel": "Créer nouveau canal",
"create-new-country": "Créer nouveau pays",
"create-new-payment-method": "",
"create-new-role": "Créer nouveau role",
"create-new-shipping-method": "Créer nouveau mode d'expédition",
"create-new-tax-category": "Créer catégorie de taxe",
Expand All @@ -734,7 +735,8 @@
"last-name": "Nom",
"no-eligible-shipping-methods": "Aucun mode d'expédition",
"password": "Mot de passe",
"payment-method-config-options": "Configuration du mode de paiement",
"payment-eligibility-checker": "",
"payment-handler": "",
"permissions": "Permissions",
"prices-include-tax": "Les prix TTC pour la zone par défaut",
"profile": "Profil",
Expand Down Expand Up @@ -798,4 +800,4 @@
"job-result": "Résultat de la tâche",
"job-state": "Etat de la tâche"
}
}
}
6 changes: 4 additions & 2 deletions packages/admin-ui/src/lib/static/i18n-messages/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@
"confirm-delete-tax-rate": "Usunąć stawke podatkową?",
"create-new-channel": "Utwórz nowy kanał",
"create-new-country": "Utwórz nowy kraj",
"create-new-payment-method": "",
"create-new-role": "Utwórz nową role",
"create-new-shipping-method": "Utwórz nową metode wysyłki",
"create-new-tax-category": "Utwórz nową kategorię podatkową",
Expand All @@ -734,7 +735,8 @@
"last-name": "Nazwisko",
"no-eligible-shipping-methods": "Brak pasujących metod wysyłki",
"password": "Hasło",
"payment-method-config-options": "Konfiguracja metody płatności",
"payment-eligibility-checker": "",
"payment-handler": "",
"permissions": "Uprawnienia",
"prices-include-tax": "Ceny zawierają podatek dla domyślnej strefy",
"profile": "",
Expand Down Expand Up @@ -798,4 +800,4 @@
"job-result": "Rezultat zlecenia",
"job-state": "Status zlecenia"
}
}
}
8 changes: 5 additions & 3 deletions packages/admin-ui/src/lib/static/i18n-messages/pt_BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"original-asset-size": "Tamanho do arquivo",
"preview": "Pré-visualização",
"remove-asset": "Excluir imagens",
"search-asset-name": "Procurar imagens por nome",
"select-asset": "",
"select-assets": "Selecione imagens",
"set-as-featured-asset": "Definir como imagem em destaque",
"set-focal-point": "Definir ponto central",
Expand Down Expand Up @@ -714,6 +714,7 @@
"confirm-delete-tax-rate": "Excluir taxa de imposto?",
"create-new-channel": "Criar novo canal",
"create-new-country": "Criar novo país",
"create-new-payment-method": "",
"create-new-role": "Criar nova regra",
"create-new-shipping-method": "Criar novo método de envio",
"create-new-tax-category": "Criar categoria de imposto",
Expand All @@ -734,7 +735,8 @@
"last-name": "Sobrenome",
"no-eligible-shipping-methods": "Nenhum método de envio qualificado",
"password": "Senha",
"payment-method-config-options": "Configuração do método de pagamento",
"payment-eligibility-checker": "",
"payment-handler": "",
"permissions": "Permissões",
"prices-include-tax": "Os preços incluem impostos para a Zona padrão",
"profile": "Perfil",
Expand Down Expand Up @@ -798,4 +800,4 @@
"job-result": "Resultado do trabalho",
"job-state": "Estado do trabalho"
}
}
}
6 changes: 4 additions & 2 deletions packages/admin-ui/src/lib/static/i18n-messages/zh_Hans.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@
"confirm-delete-tax-rate": "去人删除税率?",
"create-new-channel": "添加销售渠道",
"create-new-country": "添加国家",
"create-new-payment-method": "",
"create-new-role": "添加角色",
"create-new-shipping-method": "添加配送方式",
"create-new-tax-category": "创建税表分类",
Expand All @@ -734,7 +735,8 @@
"last-name": "",
"no-eligible-shipping-methods": "没有符合条件的配送方式",
"password": "密码",
"payment-method-config-options": "支付方式选项配置",
"payment-eligibility-checker": "",
"payment-handler": "",
"permissions": "权限",
"prices-include-tax": "设置默认销售区域价格含税",
"profile": "",
Expand Down Expand Up @@ -798,4 +800,4 @@
"job-result": "",
"job-state": ""
}
}
}
Loading

0 comments on commit 09a1a97

Please sign in to comment.