blueimpact / kucipong

BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

add `X` button on each coupon on store's coupon list for deleting coupons #157

Open cdepillabout opened 7 years ago

cdepillabout commented 7 years ago

It would be nice to have an X button on each coupon on the Store's coupon list for deleting the coupon.

This recommendation comes from https://github.com/blueimpact/kucipong/pull/155#issuecomment-290096847.


Also, we need a way to determine whether or not to show the delete button. It should be shown to Store users, but not to end users.

My original solution is below (and implemented in https://github.com/blueimpact/kucipong/pull/155):

Since the coupon id template (frontend/src/pug/common/_coupon_id.pug) is the same for the end user and store user, I had to add an ugly hack to determine whether or not to show the coupon delete button. Can you think of any better way of doing this?

However, @arowM has a better idea:

The important point is we need not ask backend server to determine whether we should render delete button or not, but we can determine it in compile time.

So, I have two plan to realize this.

  1. Use pug-side variable to handle appearance of delete button
  2. Set the style of store delete button display: block in store.scss.

Anyway since I'll implement OOUX way of delete feature in future PR, then I'll change this, too.