Skip to content

Commit

Permalink
Merge pull request #2 from ever-co/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
AdemHodzic authored May 31, 2019
2 parents fb1ed17 + 981bdce commit ec1891a
Show file tree
Hide file tree
Showing 79 changed files with 2,896 additions and 450 deletions.
13 changes: 10 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ We would love for you to contribute to Ever Platform!

If you're changing the structure of the repository please create an issue first.

By default, when you submitting contributions with Pull Requests, we require electronic submission of individual [Contributor Assignment Agreement (CAA)](https://gist.github.com/evereq/95f74ae09510766ffa9379006715ccfd). In some cases (when contributions are very small, at our discretion) instead of CAA we may accept submission of individual [Contributor License Agreement (CLA)](https://gist.github.com/evereq/53ddec283243481344fb61df1706ec40).

If you submitting contribution on behalf of some legal entity, you need to submit Entity Contributor Assignment Agreement (CAA) or Entity Contributor License Agreement (CLA), which you can request by sending us an email to legal@ever.co.

We are using open-source [CLA assistant](https://github.com/cla-assistant/cla-assistant) project to collect your signatures on CAA.
The templates for our CAA/CLA documents generated by http://www.harmonyagreements.org.

## Submitting bug reports

Make sure you are on latest changes.
Expand All @@ -19,6 +26,6 @@ You are more than welcome to submit future requests here https://github.com/ever

This is an open source project.
Contributions you make to this public Ever Platform repository are completely voluntary.
When you submit an issue, bug report, question, enhancement, pull request, etc., you are offering your contribution without expectation of payment,
you expressly waive any future pay claims against the Ever Co. LTD related to your contribution, and you acknowledge that this does not create an obligation on the part of the Ever Co. LTD of any kind.
Furthermore, your contributing to this project does not create an employer-employee relationship between the Ever Co. LTD and the contributor.
When you submit an issue, bug report, question, enhancement, pull request, etc., you are offering your contribution without expectation of payment, you expressly waive any future pay claims against the Ever Co. LTD related to your contribution, and you acknowledge that this does not create an obligation on the part of the Ever Co. LTD of any kind. Furthermore, your contributing to this project does not create an employer-employee relationship between the Ever Co. LTD and the contributor.

See also "Submitting Pull Requests" section above for more information on CAA/CLA, required for any contributions.
4 changes: 2 additions & 2 deletions admin/website-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"chart.js": "^2.8.0",
"ckeditor": "^4.11.4",
"classlist.js": "1.1.20150312",
"core-js": "^3.0.1",
"core-js": "^3.1.3",
"cryptiles": "^4.1.3",
"echarts": "^4.2.1",
"eva-icons": "^1.1.1",
Expand Down Expand Up @@ -204,7 +204,7 @@
"ts-node": "^8.1.0",
"tslint": "^5.16.0",
"typescript": "~3.2.4",
"typescript-tslint-plugin": "^0.3.1",
"typescript-tslint-plugin": "^0.4.0",
"webpack-dev-server": "^3.3.1",
"yargs": "^13.2.4"
},
Expand Down
65 changes: 65 additions & 0 deletions admin/website-angular/src/app/@core/data/currencies.service.ts
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()
);
}
}
36 changes: 36 additions & 0 deletions admin/website-angular/src/app/@core/data/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class UsersService {
email
apartment
phone
isBanned
geoLocation {
countryId
city
Expand Down Expand Up @@ -94,6 +95,7 @@ export class UsersService {
email
apartment
phone
isBanned
geoLocation {
streetAddress
city
Expand Down Expand Up @@ -145,6 +147,40 @@ export class UsersService {
return res.data['registerUser'];
}

async banUser(id: string) {
return this._apollo
.mutate({
mutation: gql`
mutation BanUser($id: String!) {
banUser(id: $id) {
id
firstName
lastName
}
}
`,
variables: { id }
})
.toPromise();
}

async unbanUser(id: string) {
return this._apollo
.mutate({
mutation: gql`
mutation UnbanUser($id: String!) {
unbanUser(id: $id) {
id
firstName
lastName
}
}
`,
variables: { id }
})
.toPromise();
}

async getCountOfUsers() {
const res = await this._apollo
.query({
Expand Down
30 changes: 30 additions & 0 deletions admin/website-angular/src/app/@core/data/warehouses.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,43 @@ export class WarehousesService {
getAllStores {
id
_createdAt
geoLocation {
loc {
coordinates
}
}
}
}
`
})
.pipe(map((res) => res.data.getAllStores));
}

getStoreLivePosition() {
return this._apollo
.watchQuery<{ getAllStores: Warehouse[] }>({
query: gql`
query GetAllStores {
getAllStores {
id
_createdAt
name
logo
geoLocation {
loc {
coordinates
}
city
countryId
}
}
}
`,
pollInterval: 5000
})
.valueChanges.pipe(map((res) => res.data.getAllStores));
}

getStores(pagingOptions?: IPagingOptions): Observable<Warehouse[]> {
return this._apollo
.watchQuery<{ warehouses: IWarehouse[] }>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
/>

<input
#shownInput="ngModel"
type="text"
class="form-control col-10"
[ngClass]="customClass"
placeholder="{{ placeholder }}"
(change)="imageUrlChanged()"
[(ngModel)]="fileUrl"
/>

<button
(click)="fileInput.click()"
class="btn btn-primary btn-rectangle col-2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import { Component, Input, Output, EventEmitter } from '@angular/core';
import {
Component,
Input,
Output,
EventEmitter,
ViewChild
} from '@angular/core';
import { FileUploader, FileUploaderOptions } from 'ng2-file-upload';
import { environment } from 'environment';
import { ProductLocalesService } from '@modules/client.common.angular2/locale/product-locales.service';
import { IProductImage } from '@modules/server.common/interfaces/IProduct';
import { NgModel } from '@angular/forms';

@Component({
selector: 'e-cu-file-uploader',
templateUrl: './file-uploader.component.html',
styleUrls: ['./file-uploader.component.scss']
})
export class FileUploaderComponent {
@ViewChild('shownInput')
shownInput: NgModel;

@Input()
placeholder: string;
@Input()
Expand Down
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">&times;</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.
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() {}
}
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 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './ban-confirm.module';
export * from './ban-confirm.component';
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@
<nb-checkbox
[value]="forwardingEmail"
(change)="forwardingEmailChange()"
>Order Forwarding Email</nb-checkbox
>
{{
'WAREHOUSE_VIEW.MUTATION.CONTACT_INFO_TAB.ORDER_FORWARDING_EMAIL'
| translate
}}
</nb-checkbox>
<input
*ngIf="forwardingEmail"
type="email"
Expand Down Expand Up @@ -106,8 +110,12 @@
<nb-checkbox
[value]="forwardingPhone"
(change)="forwardingPhoneChange()"
>Order Forwarding Phone</nb-checkbox
>
{{
'WAREHOUSE_VIEW.MUTATION.CONTACT_INFO_TAB.ORDER_FORWARDING_PHONE'
| translate
}}
</nb-checkbox>
<input
*ngIf="forwardingPhone"
type="text"
Expand Down
21 changes: 21 additions & 0 deletions admin/website-angular/src/app/@theme/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,24 @@ nb-card.no-box-shadow {
box-shadow: none;
margin-bottom: 0;
}

.preview-img-container {
.preview-img {
padding-right: 16px;
}

.img-rounded {
margin-top: 3px;
max-height: 70px !important;
}

.remove-icon {
cursor: pointer;

span {
padding-right: 7px;
position: absolute;
font-size: 1.1em;
}
}
}
Loading

0 comments on commit ec1891a

Please sign in to comment.