-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Order recurrence (subscription support)
- Loading branch information
Showing
36 changed files
with
588 additions
and
17 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
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
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
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,6 @@ | ||
export interface Recurrence { | ||
interval: string; | ||
startDate: string; | ||
endDate?: string; | ||
repetitions?: number; | ||
} |
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
31 changes: 31 additions & 0 deletions
31
...app/pages/basket/basket-order-recurrence-edit/basket-order-recurrence-edit.component.html
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,31 @@ | ||
<div id="order-recurrence"> | ||
<div> | ||
<input | ||
type="radio" | ||
id="order_recurrence_single" | ||
name="order_recurrence" | ||
value="single-order" | ||
class="form-check-input" | ||
[checked]="!recurrence" | ||
(change)="updateOrderRecurrence(null)" | ||
/> | ||
<label class="form-check-label" for="order_recurrence_single">One-time purchase</label> | ||
</div> | ||
<div> | ||
<input | ||
type="radio" | ||
id="order_recurrence_recurring" | ||
name="order_recurrence" | ||
value="recurring-order" | ||
class="form-check-input" | ||
[checked]="!!recurrence" | ||
(change)="updateOrderRecurrence(defaultRecurrence)" | ||
/> | ||
<label class="form-check-label" for="order_recurrence_recurring">Recurring order</label> | ||
</div> | ||
<div *ngIf="!!recurrence" class="mt-3"> | ||
<form [formGroup]="form"> | ||
<formly-form [form]="form" [fields]="fields" [model]="model" /> | ||
</form> | ||
</div> | ||
</div> |
11 changes: 11 additions & 0 deletions
11
...app/pages/basket/basket-order-recurrence-edit/basket-order-recurrence-edit.component.scss
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 @@ | ||
@import 'variables'; | ||
|
||
#order-recurrence { | ||
padding: ($space-default * 0.5) ($space-default * 1.5); | ||
margin: ($space-default * 1) ($space-default * -1.5); | ||
background-color: $white; | ||
} | ||
|
||
#order-recurrence-configuration { | ||
height: 100px; | ||
} |
27 changes: 27 additions & 0 deletions
27
.../pages/basket/basket-order-recurrence-edit/basket-order-recurrence-edit.component.spec.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { BasketOrderRecurrenceEditComponent } from './basket-order-recurrence-edit.component'; | ||
|
||
describe('Basket Order Recurrence Edit Component', () => { | ||
let component: BasketOrderRecurrenceEditComponent; | ||
let fixture: ComponentFixture<BasketOrderRecurrenceEditComponent>; | ||
let element: HTMLElement; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [BasketOrderRecurrenceEditComponent], | ||
}).compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(BasketOrderRecurrenceEditComponent); | ||
component = fixture.componentInstance; | ||
element = fixture.nativeElement; | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(component).toBeTruthy(); | ||
expect(element).toBeTruthy(); | ||
expect(() => fixture.detectChanges()).not.toThrow(); | ||
}); | ||
}); |
Oops, something went wrong.