Skip to content

Commit

Permalink
Refresher removed
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoumpierre committed Aug 8, 2018
1 parent 18a9281 commit a55adaf
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 138 deletions.
14 changes: 5 additions & 9 deletions src/pages/customers/index/customers.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
<ion-title>Clientes</ion-title>

<ion-buttons end>
<button ion-button icon-only (click)="doRefresh()">
<ion-icon name="refresh"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Atualizar</span>
</button>

<button ion-button icon-only (click)="goToForm()">
<ion-icon name="add"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Adicionar</span>
Expand All @@ -12,15 +17,6 @@
</ion-header>

<ion-content>
<ion-refresher (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="arrow-dropdown"
pullingText="Puxe para atualizar"
refreshingSpinner="circles"
refreshingText="Atualizando...">
</ion-refresher-content>
</ion-refresher>

<ion-grid fixed>
<ion-row>
<ion-col>
Expand Down
7 changes: 2 additions & 5 deletions src/pages/customers/index/customers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,14 @@ export class CustomersPage {

/**
* Updates the customer with the refresher
*
* @param refresher
*/
doRefresh(refresher) {
doRefresh() {
this.syncProvider
.verifySync('customers', true, false)
.verifySync('customers', true)
.then(customers => {
this.customers = customers;
this.filteredItems = customers;
})
.then(() => refresher.complete())
.catch((error) => console.log(error));
}

Expand Down
18 changes: 7 additions & 11 deletions src/pages/home/home.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
<!-- Cabeçalho -->
<ion-header>
<ion-navbar>
<ion-title>Frozen Salgados</ion-title>

<ion-buttons end>
<button ion-button icon-only (click)="doRefresh()">
<ion-icon name="refresh"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Atualizar</span>
</button>
</ion-buttons>
</ion-navbar>
</ion-header>

<!-- Conteúdo -->
<ion-content>
<ion-refresher (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="arrow-dropdown"
pullingText="Puxe para atualizar"
refreshingSpinner="circles"
refreshingText="Atualizando...">
</ion-refresher-content>
</ion-refresher>

<ion-grid fixed>
<ion-row>
<ion-col col-5>
Expand Down
111 changes: 56 additions & 55 deletions src/pages/home/home.scss
Original file line number Diff line number Diff line change
@@ -1,81 +1,82 @@
page-home {

ion-grid {
height: 100%;
justify-content: center;
}

button {
height: 7.5rem !important;
margin: 3rem 0.25rem !important;
button {
height: 7.5rem !important;
margin: 3rem 0.25rem !important;

&.button-clear-wp,
&.button-clear-md,
&.button-clear-ios {
color: #FFF;
}
&.button-clear-wp,
&.button-clear-md,
&.button-clear-ios {
color: #FFF;
}

&.button-clear-md {
text-transform: capitalize;
}
&.button-clear-md {
text-transform: capitalize;
}

> .button-inner {
-webkit-flex-flow: column nowrap;
-ms-flex-flow: column nowrap;
flex-flow: column nowrap;
> .button-inner {
-webkit-flex-flow: column nowrap;
-ms-flex-flow: column nowrap;
flex-flow: column nowrap;

> ion-icon {
font-size: 3em;
margin-bottom: 0.125em;
> ion-icon {
font-size: 3em;
margin-bottom: 0.125em;
}
}
}
}

ion-row {
align-items: center;
ion-row {
align-items: center;

> ion-col[col-5] {
> ion-col[col-5] {

&::after {
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#ffffff+0,ffffff+100&0+0,0.3+50,0+100 */
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#00ffffff',GradientType=0 ); /* IE6-9 */
&::after {
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#ffffff+0,ffffff+100&0+0,0.3+50,0+100 */
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,0.3) 50%,rgba(255,255,255,0) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#00ffffff',GradientType=0 ); /* IE6-9 */

content: "";
height: 100%;
position: absolute;
top: 0;
right: 0;
width: 2px;
content: "";
height: 100%;
position: absolute;
top: 0;
right: 0;
width: 2px;
}
}
}
}

#seller {
color: #FFF;
text-align: center;
}
#seller {
color: #FFF;
text-align: center;
}

#seller-image {
margin-bottom: 1rem;
#seller-image {
margin-bottom: 1rem;

> img {
@include border-radius(50%);
> img {
@include border-radius(50%);
}
}
}

#seller-name {
font-size: 1.8rem;
margin-bottom: 0.25rem;
}
#seller-name {
font-size: 1.8rem;
margin-bottom: 0.25rem;
}

#seller-id {
font-size: 1.3rem;
}
#seller-id {
font-size: 1.3rem;
}

#seller-id,
#seller-name {
padding: 0 1rem;
#seller-id,
#seller-name {
padding: 0 1rem;
}
}
}
7 changes: 2 additions & 5 deletions src/pages/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,10 @@ export class HomePage {

/**
* Updates all the categories with the refresher
*
* @param refresher
*/
doRefresh(refresher) {
doRefresh() {
this.syncProvider
.syncCategories(['customers', 'orders', 'products', 'users'], true, false)
.then(() => refresher.complete())
.syncCategories(['customers', 'orders', 'products', 'users'], true)
.catch((error) => console.log(error));
}
}
14 changes: 5 additions & 9 deletions src/pages/orders/index/orders.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
<ion-title>Pedidos</ion-title>

<ion-buttons end>
<button ion-button icon-only (click)="doRefresh()">
<ion-icon name="refresh"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Atualizar</span>
</button>

<button ion-button icon-only (click)="goToForm()">
<ion-icon name="add"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Novo pedido</span>
Expand All @@ -12,15 +17,6 @@
</ion-header>

<ion-content>
<ion-refresher (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="arrow-dropdown"
pullingText="Puxe para atualizar"
refreshingSpinner="circles"
refreshingText="Atualizando...">
</ion-refresher-content>
</ion-refresher>

<ion-grid fixed>
<ion-row>
<ion-col>
Expand Down
7 changes: 2 additions & 5 deletions src/pages/orders/index/orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,14 @@ export class OrdersPage {

/**
* Updates the orders with the refresher
*
* @param refresher
*/
doRefresh(refresher) {
doRefresh() {
this.syncProvider
.verifySync('orders', true, false)
.verifySync('orders', true)
.then(orders => {
this.orders = orders;
this.filteredItems = orders;
})
.then(() => refresher.complete())
.catch((error) => console.log(error));
}

Expand Down
8 changes: 7 additions & 1 deletion src/pages/orders/view/order-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@
<ion-content>
<div class="grid" fixed>
<div class="list-item" *ngIf="order">
<div class="list-item__header">Vendedor</div>

<div class="list-item__content">
<p class="highlight">Nome: {{ order.user.name }}</p>
</div>

<div class="list-item__header">Cliente</div>

<div class="list-item__content">
<p class="highlight">Cliente {{ order.customer.name }}</p>
<p class="highlight">Nome: {{ order.customer.name }}</p>
<p>CNPJ: {{ order.customer.cnpj }}</p>
<p>Endereço: {{ order.customer.address }}</p>
</div>
Expand Down
18 changes: 7 additions & 11 deletions src/pages/products/index/products.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
<ion-navbar>
<ion-title>{{ pageTitle }}</ion-title>

<ion-buttons end *ngIf="currentUser.role == 1">
<button ion-button icon-only (click)="goToForm()">
<ion-buttons end>
<button ion-button icon-only (click)="doRefresh()">
<ion-icon name="refresh"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Atualizar</span>
</button>

<button ion-button icon-only (click)="goToForm()" *ngIf="currentUser.role == 1">
<ion-icon name="add"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Adicionar</span>
</button>
Expand All @@ -23,15 +28,6 @@
</ion-header>

<ion-content>
<ion-refresher (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="arrow-dropdown"
pullingText="Puxe para atualizar"
refreshingSpinner="circles"
refreshingText="Atualizando...">
</ion-refresher-content>
</ion-refresher>

<div class="grid" fixed>
<div [ngSwitch]="tab">
<!-- Products -->
Expand Down
12 changes: 4 additions & 8 deletions src/pages/products/index/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,27 +146,23 @@ export class ProductsPage {

/**
* Updates the products with the refresher
*
* @param refresher
*/
doRefresh(refresher) {
doRefresh() {
if (this.isProduct()) {
this.syncProvider
.verifySync('products', true, false)
.verifySync('products', true)
.then(products => {
this.products = products;
this.filteredProducts = products;;
this.filteredProducts = products;
})
.then(() => refresher.complete())
.catch((error) => console.log(error));
} else {
this.syncProvider
.verifySync('categories', true, false)
.verifySync('categories', true)
.then(categories => {
this.categories = categories;
this.filteredCategories = categories;
})
.then(() => refresher.complete())
.catch((error) => console.log(error));
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/pages/reports/view/reports-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
<ion-title>{{ pageTitle }}</ion-title>

<ion-buttons end>
<button ion-button icon-only (click)="presentPopover($event)">
<ion-icon name="more"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Opções</span>
</button>
<button ion-button icon-only (click)="download()">
<ion-icon name="download"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Download</span>
</button>

<button ion-button icon-only (click)="presentPopover($event)">
<ion-icon name="more"></ion-icon>
<span class="hide-xs hide-sm show-lg show-xl">Opções</span>
</button>
</ion-buttons>
</ion-navbar>

Expand Down
Loading

0 comments on commit a55adaf

Please sign in to comment.