-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin-ui): Implement UI for updating, deleting notes
Relates to #310
- Loading branch information
1 parent
90bacf5
commit ef5eddf
Showing
18 changed files
with
447 additions
and
23 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
23 changes: 23 additions & 0 deletions
23
...in-ui/src/lib/core/src/shared/components/edit-note-dialog/edit-note-dialog.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,23 @@ | ||
<ng-template vdrDialogTitle> | ||
{{ 'common.edit-note' | translate }} | ||
</ng-template> | ||
|
||
<textarea [(ngModel)]="note" name="note" class="note"></textarea> | ||
<div class="visibility-select" *ngIf="displayPrivacyControls"> | ||
<clr-checkbox-wrapper> | ||
<input type="checkbox" clrCheckbox [(ngModel)]="noteIsPrivate" /> | ||
<label>{{ 'order.note-is-private' | translate }}</label> | ||
</clr-checkbox-wrapper> | ||
<span *ngIf="noteIsPrivate" class="private"> | ||
{{ 'order.note-only-visible-to-administrators' | translate }} | ||
</span> | ||
<span *ngIf="!noteIsPrivate" class="public"> | ||
{{ 'order.note-visible-to-customer' | translate }} | ||
</span> | ||
</div> | ||
<ng-template vdrDialogButtons> | ||
<button type="button" class="btn" (click)="cancel()">{{ 'common.cancel' | translate }}</button> | ||
<button type="submit" (click)="confirm()" class="btn btn-primary" [disabled]="note.length === 0"> | ||
{{ 'common.confirm' | translate }} | ||
</button> | ||
</ng-template> |
19 changes: 19 additions & 0 deletions
19
...in-ui/src/lib/core/src/shared/components/edit-note-dialog/edit-note-dialog.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,19 @@ | ||
@import "variables"; | ||
|
||
.visibility-select { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: baseline; | ||
.public { | ||
color: $color-warning-500; | ||
} | ||
.private { | ||
color: $color-success-500; | ||
} | ||
} | ||
textarea.note { | ||
width: 100%; | ||
height: 72px; | ||
border-radius: 3px; | ||
margin-right: 6px; | ||
} |
26 changes: 26 additions & 0 deletions
26
...dmin-ui/src/lib/core/src/shared/components/edit-note-dialog/edit-note-dialog.component.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,26 @@ | ||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; | ||
import { Dialog } from '@vendure/admin-ui/core'; | ||
|
||
@Component({ | ||
selector: 'vdr-edit-note-dialog', | ||
templateUrl: './edit-note-dialog.component.html', | ||
styleUrls: ['./edit-note-dialog.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class EditNoteDialogComponent implements Dialog<{ note: string; isPrivate?: boolean }> { | ||
displayPrivacyControls = true; | ||
noteIsPrivate = true; | ||
note = ''; | ||
resolveWith: (result?: { note: string; isPrivate?: boolean }) => void; | ||
|
||
confirm() { | ||
this.resolveWith({ | ||
note: this.note, | ||
isPrivate: this.noteIsPrivate, | ||
}); | ||
} | ||
|
||
cancel() { | ||
this.resolveWith(); | ||
} | ||
} |
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
Oops, something went wrong.