-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ever-co/develop
Develop
- Loading branch information
Showing
79 changed files
with
2,896 additions
and
450 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
65 changes: 65 additions & 0 deletions
65
admin/website-angular/src/app/@core/data/currencies.service.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,65 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Apollo } from 'apollo-angular'; | ||
import { Observable } from 'rxjs'; | ||
import Currency from '@modules/server.common/entities/Currency'; | ||
import gql from 'graphql-tag'; | ||
import { map, share } from 'rxjs/operators'; | ||
|
||
export interface CurrencyMutationRespone { | ||
success: boolean; | ||
message?: string; | ||
data?: Currency; | ||
} | ||
|
||
@Injectable() | ||
export class CurrenciesService { | ||
constructor(private readonly apollo: Apollo) {} | ||
|
||
private currencies$: Observable<Currency[]> = this.apollo | ||
.watchQuery<{ currencies: Currency[] }>({ | ||
query: gql` | ||
query allCurrencies { | ||
currencies { | ||
currencyCode | ||
} | ||
} | ||
`, | ||
pollInterval: 2000 | ||
}) | ||
.valueChanges.pipe( | ||
map((result) => result.data.currencies), | ||
share() | ||
); | ||
|
||
getCurrencies(): Observable<Currency[]> { | ||
return this.currencies$; | ||
} | ||
|
||
create(createInput: { | ||
currencyCode: string; | ||
}): Observable<CurrencyMutationRespone> { | ||
return this.apollo | ||
.mutate<{ createCurrency: CurrencyMutationRespone }>({ | ||
mutation: gql` | ||
mutation CreateCurrency( | ||
$createInput: CurrencyCreateInput! | ||
) { | ||
createCurrency(createInput: $createInput) { | ||
success | ||
message | ||
data { | ||
currencyCode | ||
} | ||
} | ||
} | ||
`, | ||
variables: { | ||
createInput | ||
} | ||
}) | ||
.pipe( | ||
map((result) => result.data.createCurrency), | ||
share() | ||
); | ||
} | ||
} |
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
12 changes: 11 additions & 1 deletion
12
admin/website-angular/src/app/@shared/file-uploader/file-uploader.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
37 changes: 37 additions & 0 deletions
37
admin/website-angular/src/app/@shared/user/ban-confirm/ban-confirm.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,37 @@ | ||
<div class="modal-header"> | ||
<h4 class="modal-title" id="modal-title">Profile Ban</h4> | ||
<button | ||
type="button" | ||
class="close" | ||
aria-label="Close button" | ||
aria-describedby="modal-title" | ||
(click)="modal.dismiss()" | ||
> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
<p> | ||
<strong | ||
>Are you sure you want to {{ user.isBanned ? 'unban' : 'ban' }} | ||
<span class="text-primary">"{{ user.name }}"</span>?</strong | ||
> | ||
</p> | ||
</div> | ||
<div class="modal-footer"> | ||
<button | ||
type="button" | ||
class="btn btn-outline-secondary" | ||
(click)="modal.dismiss()" | ||
> | ||
Cancel | ||
</button> | ||
<button | ||
type="button" | ||
ngbAutofocus | ||
class="btn btn-danger" | ||
(click)="modal.close(user.id)" | ||
> | ||
Ok | ||
</button> | ||
</div> |
Empty file.
15 changes: 15 additions & 0 deletions
15
admin/website-angular/src/app/@shared/user/ban-confirm/ban-confirm.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,15 @@ | ||
import { Component, OnInit, Input } from '@angular/core'; | ||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | ||
import { CustomerViewModel } from 'app/pages/+customers/customers.component'; | ||
|
||
@Component({ | ||
selector: 'ea-ban-confirm', | ||
templateUrl: './ban-confirm.component.html', | ||
styleUrls: ['./ban-confirm.component.scss'] | ||
}) | ||
export class BanConfirmComponent implements OnInit { | ||
@Input() user: CustomerViewModel; | ||
constructor(private readonly modal: NgbActiveModal) {} | ||
|
||
ngOnInit() {} | ||
} |
11 changes: 11 additions & 0 deletions
11
admin/website-angular/src/app/@shared/user/ban-confirm/ban-confirm.module.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,11 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { BanConfirmComponent } from './ban-confirm.component'; | ||
|
||
@NgModule({ | ||
declarations: [BanConfirmComponent], | ||
exports: [BanConfirmComponent], | ||
entryComponents: [BanConfirmComponent], | ||
imports: [CommonModule] | ||
}) | ||
export class BanConfirmModule {} |
2 changes: 2 additions & 0 deletions
2
admin/website-angular/src/app/@shared/user/ban-confirm/index.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,2 @@ | ||
export * from './ban-confirm.module'; | ||
export * from './ban-confirm.component'; |
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.