Skip to content

Commit 80ab213

Browse files
Merge pull request #11 from ArthurPedroti/feat/quick-coupler-order-type
Feat/quick coupler order type
2 parents c57eaf4 + 5d804ee commit 80ab213

File tree

19 files changed

+1470
-482
lines changed

19 files changed

+1470
-482
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@
6565
## Roadmap
6666

6767
### Bugs
68-
- [x] Payment calculation with non-integer values
69-
- [x] Only down payment on payment option
70-
- [ ] Pushing groups from CDE
68+
- [x] Loading text from "Imprimindo..." to "Gerando PDF"
69+
- [x] Don't show coupler if coupler isn't selected
70+
- [x] Put order date on the first item to appear(on confirmation)
71+
- [x] Pushing groups from CDE
7172

7273
### Features
73-
- [x] Place on top input order date
74-
- [x] Column "item" at products
75-
- [x] Show the payment calculation errors at payment page
76-
- [ ] Create an input of delivery date
74+
- [x] Page for quick coupler orders
75+
- [x] Today order default value
76+
- [x] Create an input of delivery date
7777
- [ ] File explorer to save the pdf on mobile
7878
- [ ] Select the group before the products
7979

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pv-agf-frontend",
3-
"version": "0.9.63",
3+
"version": "0.9.64",
44
"private": true,
55
"dependencies": {
66
"@date-io/date-fns": "^2.4.0",

public/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"type": "image/x-icon"
99
},
1010
{
11-
"src": "logo192.png",
11+
"src": "android-chrome-192x192.png",
1212
"type": "image/png",
1313
"sizes": "192x192"
1414
},
1515
{
16-
"src": "logo512.png",
16+
"src": "android-chrome-512x512.png",
1717
"type": "image/png",
1818
"sizes": "512x512"
1919
}

src/components/Menu.js

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import {
5656
import pjson from '../../package.json';
5757
import { store } from '../store';
5858

59-
const useStyles = makeStyles((theme) => ({
59+
const useStyles = makeStyles(theme => ({
6060
list: {
6161
width: 250,
6262
},
@@ -91,33 +91,21 @@ const App = styled(AppBar)({
9191
margin: '0 0 20px 0',
9292
});
9393

94-
const AppItem = ({
95-
address, label, icon, subtitle,
96-
}) => (
94+
const AppItem = ({ address, label, icon, subtitle }) => (
9795
<ListItem button component={Link} to={address}>
9896
<ListItemIcon>{icon}</ListItemIcon>
99-
<ListItemText
100-
primary={label}
101-
secondary={subtitle}
102-
/>
97+
<ListItemText primary={label} secondary={subtitle} />
10398
</ListItem>
10499
);
105100

106-
const AppItemAction = ({
107-
label, action, icon, subtitle,
108-
}) => (
101+
const AppItemAction = ({ label, action, icon, subtitle }) => (
109102
<ListItem button onClick={action}>
110103
<ListItemIcon>{icon}</ListItemIcon>
111-
<ListItemText
112-
primary={label}
113-
secondary={subtitle}
114-
/>
104+
<ListItemText primary={label} secondary={subtitle} />
115105
</ListItem>
116106
);
117107

118-
function Menu({
119-
title, values, dispatch, history,
120-
}) {
108+
function Menu({ title, values, dispatch, history }) {
121109
const classes = useStyles();
122110
const [state, setState] = React.useState({
123111
top: false,
@@ -126,10 +114,10 @@ function Menu({
126114
right: false,
127115
});
128116

129-
const toggleDrawer = (side, open) => (event) => {
117+
const toggleDrawer = (side, open) => event => {
130118
if (
131-
event.type === 'keydown'
132-
&& (event.key === 'Tab' || event.key === 'Shift')
119+
event.type === 'keydown' &&
120+
(event.key === 'Tab' || event.key === 'Shift')
133121
) {
134122
return;
135123
}
@@ -156,6 +144,15 @@ function Menu({
156144
await dispatch(destroy('infoReduxForm'));
157145
await store.dispatch(change('infoReduxForm', 'login', true));
158146
await store.dispatch(change('infoReduxForm', 'sync_date', sync_date));
147+
await store.dispatch(change('infoReduxForm', 'payment_type', false));
148+
await store.dispatch(change('infoReduxForm', 'contrato', 'nao'));
149+
await store.dispatch(
150+
change(
151+
'infoReduxForm',
152+
'data_pc',
153+
new Date().toISOString().substring(0, 10),
154+
),
155+
);
159156
await store.dispatch(ProductCreators.resetProduct());
160157
await store.dispatch(PaymentCreators.resetPayment());
161158
await store.dispatch(SelectCreators.resetSelect());
@@ -189,7 +186,15 @@ function Menu({
189186
handleClose();
190187
}
191188

192-
const sideList = (side) => (
189+
async function UpdateServiceWorker() {
190+
handleOpen();
191+
await navigator.serviceWorker.register('/sw.js').then(reg => {
192+
reg.update();
193+
});
194+
handleClose();
195+
}
196+
197+
const sideList = side => (
193198
<div
194199
className={classes.list}
195200
role="presentation"
@@ -248,7 +253,7 @@ function Menu({
248253
<Divider />
249254
<List>
250255
<AppItemAction
251-
label="Sincronizar Dados "
256+
label="Sincronizar Dados"
252257
subtitle={dataAtualFormatada(
253258
values === undefined ? null : values.sync_date,
254259
)}
@@ -262,9 +267,10 @@ function Menu({
262267
/>
263268
<AppItemAction label="Sair" icon={<ExitToAppIcon />} action={logout} />
264269
</List>
265-
<AppItem
270+
<AppItemAction
266271
icon={<SettingsApplicationsIcon />}
267272
subtitle={`v${pjson.version}`}
273+
action={UpdateServiceWorker}
268274
address={() => {}}
269275
/>
270276
</div>
@@ -325,7 +331,7 @@ function Menu({
325331
);
326332
}
327333

328-
const mapStateToProps = (state) => ({
334+
const mapStateToProps = state => ({
329335
values: getFormValues('infoReduxForm')(state),
330336
});
331337

0 commit comments

Comments
 (0)