Skip to content

Commit

Permalink
fix: Get Promotions working with new design
Browse files Browse the repository at this point in the history
Fix all tests broken by the broad design changes of this branch.
  • Loading branch information
michaelbromley committed Oct 17, 2018
1 parent b0d4b6c commit 9076d45
Show file tree
Hide file tree
Showing 53 changed files with 830 additions and 1,203 deletions.
Expand Up @@ -57,6 +57,15 @@
[formControl]="formArray.get([i, 'price'])"></vdr-currency-input>
</clr-input-container>
</div>
<div class="price-with-tax">
<clr-input-container>
<label>{{ 'catalog.price-including-tax' | translate }}</label>
<vdr-currency-input clrInput
[formControl]="formArray.get([i, 'priceWithTax'])"></vdr-currency-input> </clr-input-container>
</div>
<div class="price-with-tax-preview">
{{ formArray.get([i, 'price']).value * ( 1 + variant.taxRateApplied.value / 100) }}
</div>
</div>
</div>
</div>
Expand Down
Expand Up @@ -8,6 +8,7 @@ import { AffixedInputComponent } from '../../../shared/components/affixed-input/
import { ChipComponent } from '../../../shared/components/chip/chip.component';
import { CurrencyInputComponent } from '../../../shared/components/currency-input/currency-input.component';
import { SelectToggleComponent } from '../../../shared/components/select-toggle/select-toggle.component';
import { BackgroundColorFromDirective } from '../../../shared/directives/background-color-from.directive';
import { CreateOptionGroupFormComponent } from '../create-option-group-form/create-option-group-form.component';
import { SelectOptionGroupComponent } from '../select-option-group/select-option-group.component';

Expand All @@ -28,6 +29,7 @@ describe('ProductVariantsWizardComponent', () => {
ChipComponent,
CurrencyInputComponent,
AffixedInputComponent,
BackgroundColorFromDirective,
],
providers: [{ provide: NotificationService, useClass: MockNotificationService }],
}).compileComponents();
Expand Down
Expand Up @@ -6,6 +6,7 @@ import { DataService } from '../../../data/providers/data.service';
import { MockDataService } from '../../../data/providers/data.service.mock';
import { ChipComponent } from '../../../shared/components/chip/chip.component';
import { SelectToggleComponent } from '../../../shared/components/select-toggle/select-toggle.component';
import { BackgroundColorFromDirective } from '../../../shared/directives/background-color-from.directive';

import { SelectOptionGroupComponent } from './select-option-group.component';

Expand All @@ -16,7 +17,12 @@ describe('SelectOptionGroupComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ReactiveFormsModule, TestingCommonModule],
declarations: [SelectOptionGroupComponent, SelectToggleComponent, ChipComponent],
declarations: [
SelectOptionGroupComponent,
SelectToggleComponent,
ChipComponent,
BackgroundColorFromDirective,
],
providers: [{ provide: DataService, useClass: MockDataService }],
}).compileComponents();
}));
Expand Down
Expand Up @@ -186,7 +186,10 @@ export class PromotionDetailComponent extends BaseDetailComponent<Promotion.Frag
return operations.map((o, i) => {
return {
code: o.code,
arguments: Object.values(formValueOperations[i].args).map(v => v.toString()),
arguments: Object.values(formValueOperations[i].args).map((value, j) => ({
name: o.args[j].name,
value: value.toString(),
})),
};
});
}
Expand Down
Expand Up @@ -10,7 +10,14 @@

<clr-input-container *ngFor="let arg of operation.args">
<label>{{ arg.name | titlecase }}</label>

<div *ngIf="arg.type === 'boolean'"
clrInput
class="checkbox" >
<input type="checkbox"
[formControlName]="arg.name"
[id]="arg.name">
<label [for]="arg.name"></label>
</div>
<input *ngIf="arg.type === 'int'"
clrInput [name]="arg.name"
type="number"
Expand Down
2 changes: 1 addition & 1 deletion schema.json

Large diffs are not rendered by default.

268 changes: 0 additions & 268 deletions server/e2e/__snapshots__/adjustment-source.e2e-spec.ts.snap

This file was deleted.

0 comments on commit 9076d45

Please sign in to comment.