Skip to content

Commit 6aa3bcf

Browse files
committed
Restyle
1 parent 9078455 commit 6aa3bcf

13 files changed

Lines changed: 529 additions & 57 deletions

File tree

src/admin/client/modules/customer-groups/actions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function successDeleteGroup(id) {
6969
function fetchGroups() {
7070
return dispatch => {
7171
dispatch(requestGroups());
72-
return api.customer_groups.list()
72+
return api.customerGroups.list()
7373
.then(({status, json}) => {
7474
json = json.sort((a,b) => (a.position - b.position ));
7575

@@ -107,7 +107,7 @@ export function fetchGroupsIfNeeded() {
107107
export function updateGroup(data) {
108108
return (dispatch, getState) => {
109109
dispatch(requestUpdateGroup(data.id));
110-
return api.customer_groups.update(data.id, data)
110+
return api.customerGroups.update(data.id, data)
111111
.then(({status, json}) => {
112112
dispatch(receiveUpdateGroup());
113113
dispatch(fetchGroups());
@@ -120,7 +120,7 @@ export function updateGroup(data) {
120120

121121
export function createGroup(data) {
122122
return (dispatch, getState) => {
123-
return api.customer_groups.create(data)
123+
return api.customerGroups.create(data)
124124
.then(({status, json}) => {
125125
dispatch(successCreateGroup(json.id));
126126
dispatch(fetchGroups());
@@ -135,7 +135,7 @@ export function createGroup(data) {
135135

136136
export function deleteGroup(id) {
137137
return (dispatch, getState) => {
138-
return api.customer_groups.delete(id)
138+
return api.customerGroups.delete(id)
139139
.then(({status, json}) => {
140140
if(status === 200) {
141141
dispatch(successDeleteGroup(id));

src/admin/client/modules/product-categories/actions.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function successReplaceCategory(newParentId) {
8282
export function fetchCategories() {
8383
return dispatch => {
8484
dispatch(requestCategories());
85-
return api.product_categories.list()
85+
return api.productCategories.list()
8686
.then(({status, json}) => {
8787
json.forEach((element, index, theArray) => {
8888
if(theArray[index].name === '') {
@@ -118,7 +118,7 @@ export function fetchCategoriesIfNeeded() {
118118
function sendUpdateCategory(id, data) {
119119
return dispatch => {
120120
dispatch(requestUpdateCategory(id));
121-
return api.product_categories.update(id, data)
121+
return api.productCategories.update(id, data)
122122
.then(({status, json}) => {
123123
dispatch(receiveUpdateCategory());
124124
dispatch(fetchCategories());
@@ -137,7 +137,7 @@ export function updateCategory(data) {
137137

138138
export function createCategory() {
139139
return (dispatch, getState) => {
140-
return api.product_categories.create({ enabled: false })
140+
return api.productCategories.create({ enabled: false })
141141
.then(({status, json}) => {
142142
dispatch(successCreateCategory(json.id));
143143
dispatch(fetchCategories());
@@ -155,7 +155,7 @@ export function deleteImage() {
155155
const state = getState();
156156
const categoryId = state.productCategories.selectedId;
157157

158-
return api.product_categories.deleteImage(categoryId)
158+
return api.productCategories.deleteImage(categoryId)
159159
.then(({status, json}) => {
160160
if(status === 200) {
161161
dispatch(fetchCategories());
@@ -172,7 +172,7 @@ export function deleteImage() {
172172

173173
export function deleteCategory(id) {
174174
return (dispatch, getState) => {
175-
return api.product_categories.delete(id)
175+
return api.productCategories.delete(id)
176176
.then(({status, json}) => {
177177
if(status === 200) {
178178
dispatch(successDeleteCategory(id));
@@ -201,9 +201,9 @@ function moveCategory(allCategories = [], selectedCategory, isUp = true) {
201201
let targetCategory = allCategories[0];
202202
let newPosition = targetCategory.position;
203203

204-
api.product_categories.update(selectedCategory.id, { position: targetCategory.position })
204+
api.productCategories.update(selectedCategory.id, { position: targetCategory.position })
205205
.then(() => {
206-
api.product_categories.update(targetCategory.id, { position: selectedCategory.position })
206+
api.productCategories.update(targetCategory.id, { position: selectedCategory.position })
207207
.then(() => {
208208
resolve(newPosition);
209209
})
@@ -254,7 +254,7 @@ export function replaceCategory(parentId) {
254254
let state = getState();
255255
var selectedCategory = state.productCategories.items.find((item) => (item.id === state.productCategories.selectedId));
256256

257-
return api.product_categories.update(selectedCategory.id, { parent_id: parentId })
257+
return api.productCategories.update(selectedCategory.id, { parent_id: parentId })
258258
.then(({status, json}) => {
259259
dispatch(successReplaceCategory());
260260
dispatch(fetchCategories());

src/admin/client/modules/products/actions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export function fetchProduct(id) {
313313

314314
export function fetchImages(productId) {
315315
return (dispatch, getState) => {
316-
return api.products.getImages(productId).then(({status, json}) => {
316+
return api.products.images.list(productId).then(({status, json}) => {
317317
dispatch(receiveImages(json))
318318
})
319319
.catch(error => {});
@@ -323,7 +323,7 @@ export function fetchImages(productId) {
323323

324324
export function deleteImage(productId, imageId) {
325325
return (dispatch, getState) => {
326-
return api.products.deleteImage(productId, imageId).then(({status, json}) => {
326+
return api.products.images.delete(productId, imageId).then(({status, json}) => {
327327
dispatch(fetchImages(productId))
328328
})
329329
.catch(error => {});

src/admin/client/modules/products/edit/images/components/images.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import Gallery from 'modules/shared/image-upload-multiple'
3+
import Paper from 'material-ui/Paper';
34

45
export default class ProductImages extends React.Component {
56
constructor(props) {
@@ -13,7 +14,11 @@ export default class ProductImages extends React.Component {
1314
render() {
1415
let {productId, images, onImageDelete, onImageSort, fetchData} = this.props;
1516
return (
16-
<Gallery productId={productId} images={images} onImageDelete={onImageDelete} onImageSort={onImageSort} onUpload={fetchData} />
17+
<Paper className="paper-box" zDepth={1}>
18+
<div style={{ padding: '10px 10px 30px 10px' }}>
19+
<Gallery productId={productId} images={images} onImageDelete={onImageDelete} onImageSort={onImageSort} onUpload={fetchData} />
20+
</div>
21+
</Paper>
1722
)
1823
}
1924
}

src/admin/client/modules/settings/actions.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export function updateEmailTemplate(emailTemplate) {
211211

212212
export function fetchCheckoutFields() {
213213
return (dispatch, getState) => {
214-
return api.checkout_fields.list().then(({status, json}) => {
214+
return api.checkoutFields.list().then(({status, json}) => {
215215
dispatch(receiveCheckoutFields(json))
216216
}).catch(error => {});
217217
}
@@ -220,7 +220,7 @@ export function fetchCheckoutFields() {
220220
export function fetchCheckoutField(fieldName) {
221221
return (dispatch, getState) => {
222222
dispatch(requestCheckoutField())
223-
return api.checkout_fields.retrieve(fieldName).then(({status, json}) => {
223+
return api.checkoutFields.retrieve(fieldName).then(({status, json}) => {
224224
json.fieldName = fieldName;
225225
dispatch(receiveCheckoutField(json))
226226
}).catch(error => {});
@@ -229,7 +229,7 @@ export function fetchCheckoutField(fieldName) {
229229

230230
export function updateCheckoutField(checkoutField) {
231231
return (dispatch, getState) => {
232-
return api.checkout_fields.update(checkoutField.fieldName, checkoutField).then(({status, json}) => {
232+
return api.checkoutFields.update(checkoutField.fieldName, checkoutField).then(({status, json}) => {
233233
json.fieldName = fieldName;
234234
dispatch(receiveCheckoutField(json))
235235
}).catch(error => {});
@@ -238,79 +238,79 @@ export function updateCheckoutField(checkoutField) {
238238

239239
export function fetchShippingMethods() {
240240
return (dispatch, getState) => {
241-
return api.shipping_methods.list().then(({status, json}) => {
241+
return api.shippingMethods.list().then(({status, json}) => {
242242
dispatch(receiveShippingMethods(json))
243243
}).catch(error => {});
244244
}
245245
}
246246

247247
export function fetchPaymentMethods() {
248248
return (dispatch, getState) => {
249-
return api.payment_methods.list().then(({status, json}) => {
249+
return api.paymentMethods.list().then(({status, json}) => {
250250
dispatch(receivePaymentMethods(json))
251251
}).catch(error => {});
252252
}
253253
}
254254

255255
export function updateShippingMethod(method) {
256256
return (dispatch, getState) => {
257-
return api.shipping_methods.update(method.id, method).then(({status, json}) => {
257+
return api.shippingMethods.update(method.id, method).then(({status, json}) => {
258258
dispatch(fetchShippingMethods())
259259
}).catch(error => {});
260260
}
261261
}
262262

263263
export function updatePaymentMethod(method) {
264264
return (dispatch, getState) => {
265-
return api.payment_methods.update(method.id, method).then(({status, json}) => {
265+
return api.paymentMethods.update(method.id, method).then(({status, json}) => {
266266
dispatch(fetchPaymentMethods())
267267
}).catch(error => {});
268268
}
269269
}
270270

271271
export function fetchShippingMethod(id) {
272272
return (dispatch, getState) => {
273-
return api.shipping_methods.retrieve(id).then(({status, json}) => {
273+
return api.shippingMethods.retrieve(id).then(({status, json}) => {
274274
dispatch(receiveShippingMethod(json))
275275
}).catch(error => {});
276276
}
277277
}
278278

279279
export function fetchPaymentMethod(id) {
280280
return (dispatch, getState) => {
281-
return api.payment_methods.retrieve(id).then(({status, json}) => {
281+
return api.paymentMethods.retrieve(id).then(({status, json}) => {
282282
dispatch(receivePaymentMethod(json))
283283
}).catch(error => {});
284284
}
285285
}
286286

287287
export function deleteShippingMethod(methodId) {
288288
return (dispatch, getState) => {
289-
return api.shipping_methods.delete(methodId).then(({status, json}) => {
289+
return api.shippingMethods.delete(methodId).then(({status, json}) => {
290290
dispatch(fetchShippingMethods())
291291
}).catch(error => {});
292292
}
293293
}
294294

295295
export function deletePaymentMethod(methodId) {
296296
return (dispatch, getState) => {
297-
return api.payment_methods.delete(methodId).then(({status, json}) => {
297+
return api.paymentMethods.delete(methodId).then(({status, json}) => {
298298
dispatch(fetchPaymentMethods())
299299
}).catch(error => {});
300300
}
301301
}
302302

303303
export function createShippingMethod(method) {
304304
return (dispatch, getState) => {
305-
return api.shipping_methods.create(method).then(({status, json}) => {
305+
return api.shippingMethods.create(method).then(({status, json}) => {
306306
dispatch(fetchShippingMethods())
307307
}).catch(error => {});
308308
}
309309
}
310310

311311
export function createPaymentMethod(method) {
312312
return (dispatch, getState) => {
313-
return api.payment_methods.create(method).then(({status, json}) => {
313+
return api.paymentMethods.create(method).then(({status, json}) => {
314314
dispatch(fetchPaymentMethods())
315315
}).catch(error => {});
316316
}

src/admin/client/modules/shared/image-upload-multiple/uploader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default class MultiUploader extends React.Component {
9191

9292

9393
{percentComplete === 100 &&
94-
<RaisedButton label={messages.actions_upload} style={{ marginLeft:20, marginTop:10 }} onTouchTap={() => { this.dropzone.open() }} />
94+
<RaisedButton primary={true} label={messages.chooseImage} style={{ marginLeft:20, marginTop:10 }} onTouchTap={() => { this.dropzone.open() }} />
9595
}
9696

9797
{percentComplete < 100 &&

0 commit comments

Comments
 (0)