Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
: dialogData.chargebacks.length + ' chargebacks'
}} status"
>
<div style="display: grid; grid-template-columns: 1fr; gap: 16px">
<div class="flex flex-col">
<mat-form-field style="width: 100%">
<mat-label>Action</mat-label>
<mat-select [formControl]="actionControl">
Expand All @@ -16,13 +16,14 @@
</mat-select>
</mat-form-field>

<v-thrift-form
[extensions]="extensions$ | async"
[formControl]="control"
[metadata]="metadata$ | async"
[type]="types[actionControl.value]"
namespace="payment_processing"
></v-thrift-form>
@if (types[actionControl.value]) {
<cc-domain-thrift-editor
[formControl]="control"
[type]="types[actionControl.value]"
namespace="payment_processing"
noToolbar
></cc-domain-thrift-editor>
}
</div>
<v-dialog-actions>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MatButtonModule } from '@angular/material/button';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatSelectModule } from '@angular/material/select';

import { metadata$ } from '@vality/domain-proto';
import { Invoicing } from '@vality/domain-proto/payment_processing';
import { StatChargeback } from '@vality/magista-proto/magista';
import {
DialogModule,
Expand All @@ -18,11 +18,10 @@ import {
NotifyLogService,
forkJoinToResult,
} from '@vality/matez';
import { ThriftFormModule } from '@vality/ng-thrift';

import { ThriftInvoicingService } from '~/api/services';

import { DomainMetadataFormExtensionsService } from '../thrift-api-crud';
import { DomainThriftFormComponent } from '../thrift-api-crud';

enum Action {
Accept,
Expand All @@ -36,7 +35,7 @@ const CHANGE_STATUS_METHODS = {
[Action.Reject]: 'RejectChargeback',
[Action.Reopen]: 'ReopenChargeback',
[Action.Cancel]: 'CancelChargeback',
} as const;
} satisfies Record<Action, keyof Invoicing>;

@Component({
templateUrl: './change-chargebacks-status-dialog.component.html',
Expand All @@ -45,12 +44,12 @@ const CHANGE_STATUS_METHODS = {
CommonModule,
DialogModule,
MatButtonModule,
ThriftFormModule,
ReactiveFormsModule,
MatFormFieldModule,
MatSelectModule,
EnumKeysPipe,
EnumKeyPipe,
DomainThriftFormComponent,
],
})
export class ChangeChargebacksStatusDialogComponent
Expand All @@ -62,10 +61,8 @@ export class ChangeChargebacksStatusDialogComponent
{
private invoicingService = inject(ThriftInvoicingService);
private log = inject(NotifyLogService);
private domainMetadataFormExtensionsService = inject(DomainMetadataFormExtensionsService);
private destroyRef = inject(DestroyRef);
metadata$ = metadata$;
extensions$ = this.domainMetadataFormExtensionsService.extensions$;

control = new FormControl();
actionControl = new FormControl<Action>(null, Validators.required);
typeEnum = Action;
Expand Down
Loading