-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement(Depot) #5714
improvement(Depot) #5714
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using checkbox and grid for allowed distribution depot is a good idea 👍🏽 it gives to the user much space to interact and it is more readable.
I just made a comment about the use of depotLeft
and depotRight
.
Is it still necessary to have depotLeft
and depotRight
while we use just one loop with <div ng-repeat ="r in DepotModalCtrl.depots" class="col-md-6">
</label> | ||
</div> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If depotLeft and depotRight are just for displaying depots left and right, you could use just one loop such as :
<div ng-repeat ="r in DepotModalCtrl.depots" class="col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="r.checked" ng-true-value="1" ng-false-value="0">
<span translate> {{ r.text }} </span>
</label>
</div>
</div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at the answer to this: https://stackoverflow.com/questions/25655207/angularjs-how-to-dynamically-split-list-in-multiple-columns
.then(depots => { | ||
vm.depots = depots; | ||
|
||
let index = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, you don't need to do this extra index. The second argument of Array.forEach()
is an index
like you made. So you can do this:
depots.forEach((depot, index) => {
// everything else
});
@mbayopanda can you check again |
|
Your approach looks pretty robust and automatic. Nice! |
@lomamech How do I get to this display? |
@jmcameron you'll need to enable restricting distribution depots. I think it is in stock settings, but it might be in the depot settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The update looks good and it works fine.
Minor suggestion: since the depots will be listed in two columns, perhaps the create depot modal should be a bit wider?
</div> | ||
|
||
<div class="form-group" ng-class="{'has-error' : DepotForm.description.$invalid && DepotForm.$submitted}"> | ||
<label class="control-label" translate>FORM.LABELS.DESCRIPTION</label> | ||
<textarea | ||
class="form-control" | ||
name="description" | ||
ng-model="DepotModalCtrl.depot.description" | ||
ng-model=" DepotModalCtrl.depot.description" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like an extra leading space got into this string
- Improve display in Allowed Destination Depots closes Third-Culture-Software#5713
- Remove depotLeft and depotRight - Use index for display depot in two column
2d85831
to
a46b9e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. bors r+
bors r+ |
Build succeeded: |
closes #5713