This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vladimir Shakhov
committed
Jul 19, 2017
1 parent
8f3339b
commit 0578329
Showing
30 changed files
with
375 additions
and
212 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { QueryEncoder } from '@angular/http'; | ||
|
||
|
||
// Default QueryEncoder used in URLSearchParams does not encode '+' and '/', | ||
// We have to provide a custom QueryEncoder to encode '+' and '/' | ||
export class CustomQueryEncoder extends QueryEncoder { | ||
private static encode(v: string): string { | ||
return encodeURIComponent(v) | ||
.replace(/%40/gi, '@') | ||
.replace(/%3A/gi, ':') | ||
.replace(/%24/gi, '$') | ||
.replace(/%2C/gi, ',') | ||
.replace(/%3B/gi, ';') | ||
.replace(/%3D/gi, '=') | ||
.replace(/%3F/gi, '?'); | ||
} | ||
|
||
encodeKey(k: string): string { | ||
return CustomQueryEncoder.encode(k); | ||
} | ||
|
||
encodeValue(v: string): string { | ||
return CustomQueryEncoder.encode(v); | ||
} | ||
} |
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
3 changes: 0 additions & 3 deletions
3
src/app/snapshot/recurring-snapshots/day-of-week/day-of-week.component.scss
This file was deleted.
Oops, something went wrong.
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
3 changes: 0 additions & 3 deletions
3
src/app/snapshot/recurring-snapshots/policy-editor/daily/daily-policy.component.scss
This file was deleted.
Oops, something went wrong.
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
41 changes: 21 additions & 20 deletions
41
src/app/snapshot/recurring-snapshots/policy-editor/monthly/monthly-policy.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 |
---|---|---|
@@ -1,22 +1,23 @@ | ||
<cs-time-picker | ||
name="time" | ||
[ngModel]="time" | ||
(ngModelChange)="updateTime($event)" | ||
></cs-time-picker> | ||
<div class="flex-container"> | ||
<cs-time-picker | ||
name="time" | ||
[ngModel]="time" | ||
(ngModelChange)="updateTime($event)" | ||
></cs-time-picker> | ||
|
||
<mdl-select | ||
name="dayOfMonth" | ||
floating-label | ||
required | ||
[label]="'DAY_OF_MONTH' | translate" | ||
[ngModel]="dayOfMonth" | ||
(ngModelChange)="updateDayOfMonth($event)" | ||
> | ||
<mdl-option | ||
*ngFor="let d of daysOfMonth" | ||
[value]="d" | ||
<mdl-select | ||
name="dayOfMonth" | ||
floating-label | ||
required | ||
[label]="'DAY_OF_MONTH' | translate" | ||
[ngModel]="dayOfMonth" | ||
(ngModelChange)="updateDayOfMonth($event)" | ||
> | ||
{{ d }} | ||
</mdl-option> | ||
</mdl-select> | ||
|
||
<mdl-option | ||
*ngFor="let d of daysOfMonth" | ||
[value]="d" | ||
> | ||
{{ d }} | ||
</mdl-option> | ||
</mdl-select> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
src/app/snapshot/recurring-snapshots/policy-editor/monthly/monthly-policy.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,8 @@ | ||
.flex-container { | ||
display: flex; | ||
align-content: space-between; | ||
} | ||
|
||
.flex-container *:first-child { | ||
flex: 1; | ||
} |
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
87 changes: 52 additions & 35 deletions
87
src/app/snapshot/recurring-snapshots/policy-editor/policy-editor.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 |
---|---|---|
@@ -1,41 +1,58 @@ | ||
<div [ngSwitch]="policyMode"> | ||
<cs-hourly-policy | ||
*ngSwitchCase="Policies.Hourly" | ||
[(ngModel)]="policy" | ||
></cs-hourly-policy> | ||
<form | ||
(ngSubmit)="save()" | ||
#policyEditorForm="ngForm" | ||
novalidate | ||
> | ||
<div [ngSwitch]="policyMode"> | ||
<cs-hourly-policy | ||
name="hourlyPolicy" | ||
*ngSwitchCase="Policies.Hourly" | ||
[(ngModel)]="policy" | ||
></cs-hourly-policy> | ||
|
||
<cs-daily-policy | ||
*ngSwitchCase="Policies.Daily" | ||
[(ngModel)]="policy" | ||
></cs-daily-policy> | ||
<cs-daily-policy | ||
name="dailyPolicy" | ||
*ngSwitchCase="Policies.Daily" | ||
[(ngModel)]="policy" | ||
></cs-daily-policy> | ||
|
||
<cs-weekly-policy | ||
*ngSwitchCase="Policies.Weekly" | ||
[(ngModel)]="policy" | ||
></cs-weekly-policy> | ||
<cs-weekly-policy | ||
name="weeklyPolicy" | ||
*ngSwitchCase="Policies.Weekly" | ||
[(ngModel)]="policy" | ||
></cs-weekly-policy> | ||
|
||
<cs-monthly-policy | ||
*ngSwitchCase="Policies.Monthly" | ||
[(ngModel)]="policy" | ||
></cs-monthly-policy> | ||
</div> | ||
<cs-monthly-policy | ||
name="monthlyPolicy" | ||
*ngSwitchCase="Policies.Monthly" | ||
[(ngModel)]="policy" | ||
></cs-monthly-policy> | ||
</div> | ||
|
||
<cs-time-zone | ||
name="timeZone" | ||
[(ngModel)]="timeZone" | ||
></cs-time-zone> | ||
<div class="flex-container"> | ||
<cs-time-zone | ||
name="timeZone" | ||
[(ngModel)]="timeZone" | ||
></cs-time-zone> | ||
|
||
<cs-stored-number | ||
name="storedNumber" | ||
[(ngModel)]="storedSnapshots" | ||
></cs-stored-number> | ||
<cs-stored-number | ||
name="storedNumber" | ||
[(ngModel)]="storedSnapshots" | ||
[min]="minStoredSnapshots" | ||
[max]="maxStoredSnapshots" | ||
[minValue]="minStoredSnapshots" | ||
[maxValue]="maxStoredSnapshots" | ||
></cs-stored-number> | ||
</div> | ||
|
||
<div class="button-wrapper"> | ||
<button | ||
mdl-button | ||
mdl-colored | ||
(click)="save()" | ||
> | ||
{{ 'SAVE' | translate }} | ||
</button> | ||
</div> | ||
<div class="button-wrapper"> | ||
<button | ||
mdl-button | ||
mdl-colored="primary" | ||
type="submit" | ||
[disabled]="!policyEditorForm.valid" | ||
> | ||
{{ 'SAVE' | translate }} | ||
</button> | ||
</div> | ||
</form> |
9 changes: 9 additions & 0 deletions
9
src/app/snapshot/recurring-snapshots/policy-editor/policy-editor.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 |
---|---|---|
@@ -1,3 +1,12 @@ | ||
.button-wrapper { | ||
text-align: right; | ||
} | ||
|
||
.flex-container { | ||
display: flex; | ||
align-content: space-between; | ||
} | ||
|
||
.flex-container *:first-child { | ||
flex: 1; | ||
} |
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
23 changes: 13 additions & 10 deletions
23
src/app/snapshot/recurring-snapshots/policy-editor/weekly/weekly-policy.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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
<cs-time-picker | ||
name="time" | ||
[ngModel]="time" | ||
(ngModelChange)="updateTime($event)" | ||
></cs-time-picker> | ||
<div class="flex-container"> | ||
<cs-time-picker | ||
name="time" | ||
[ngModel]="time" | ||
(ngModelChange)="updateTime($event)" | ||
></cs-time-picker> | ||
|
||
<cs-day-of-week | ||
name="dayOfWeek" | ||
[ngModel]="dayOfWeek" | ||
(ngModelChange)="updateDayOfWeek($event)" | ||
></cs-day-of-week> | ||
</div> | ||
|
||
<cs-day-of-week | ||
name="dayOfWeek" | ||
[ngModel]="dayOfWeek" | ||
(ngModelChange)="updateDayOfWeek($event)" | ||
></cs-day-of-week> |
8 changes: 8 additions & 0 deletions
8
src/app/snapshot/recurring-snapshots/policy-editor/weekly/weekly-policy.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,8 @@ | ||
.flex-container { | ||
display: flex; | ||
align-content: space-between; | ||
} | ||
|
||
.flex-container *:first-child { | ||
flex: 1; | ||
} |
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
Oops, something went wrong.