-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Add sortby state to things-list and extend things-inbox for multi-unignore #1096
base: main
Are you sure you want to change the base?
Changes from all commits
108c68b
b99bef8
60599f2
4b2f423
2617c2f
4e8f52d
636620a
e46aa34
7b3e6df
997e380
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -23,6 +23,9 @@ | |||||||||||||||||||||||
<f7-link color="orange" v-show="selectedItems.length" v-if="!$theme.md" class="ignore" @click="confirmActionOnSelection('ignore')" icon-ios="f7:eye_slash" icon-aurora="f7:eye_slash"> | ||||||||||||||||||||||||
Ignore {{ selectedItems.length }} | ||||||||||||||||||||||||
</f7-link> | ||||||||||||||||||||||||
<f7-link color="blue" v-show="selectedItems.length" v-if="!$theme.md" class="unignore" @click="confirmActionOnSelection('unignore')" icon-ios="f7:eye" icon-aurora="f7:eye"> | ||||||||||||||||||||||||
Unignore {{ selectedItems.length }} | ||||||||||||||||||||||||
</f7-link> | ||||||||||||||||||||||||
<f7-link color="green" v-show="selectedItems.length" v-if="!$theme.md" class="approve" @click="confirmActionOnSelection('approve')" icon-ios="f7:hand_thumbsup" icon-aurora="f7:hand_thumbsup"> | ||||||||||||||||||||||||
Approve {{ selectedItems.length }} | ||||||||||||||||||||||||
</f7-link> | ||||||||||||||||||||||||
|
@@ -33,6 +36,7 @@ | |||||||||||||||||||||||
<div class="right" v-if="$theme.md"> | ||||||||||||||||||||||||
<f7-link v-show="selectedItems.length" icon-md="material:delete" icon-color="white" @click="confirmActionOnSelection('delete')" /> | ||||||||||||||||||||||||
<f7-link v-show="selectedItems.length" icon-md="material:visibility_off" icon-color="white" @click="confirmActionOnSelection('ignore')" /> | ||||||||||||||||||||||||
<f7-link v-show="selectedItems.length" icon-md="material:visibility" icon-color="white" @click="confirmActionOnSelection('unignore')" /> | ||||||||||||||||||||||||
<f7-link v-show="selectedItems.length" icon-md="material:thumb_up" icon-color="white" @click="confirmActionOnSelection('approve')" /> | ||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||
</f7-toolbar> | ||||||||||||||||||||||||
|
@@ -61,6 +65,7 @@ | |||||||||||||||||||||||
By binding | ||||||||||||||||||||||||
</f7-button> | ||||||||||||||||||||||||
</f7-segmented> | ||||||||||||||||||||||||
<f7-checkbox v-if="showCheckboxes" @change="masterToggle" /> | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not convinced this lone checkbox is the best design for a "select all" feature honestly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, but until now I could not find a better, simple way to provide the functionality. Do you have a suggestion for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not completely sure but I was thinking about "Select All/Unselect All" buttons like those you have on that screen when you add points to the model from a thing: Though your approach of a "select all" checkbox isn't bad either, maybe it could be made clearer, but in any case we need a common approach. So I would suggest adding these buttons at the bottom of the list when the "select" mode is active. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||
</div> | ||||||||||||||||||||||||
<f7-list v-if="!ready" contacts-list class="col inbox-list"> | ||||||||||||||||||||||||
<f7-list-group> | ||||||||||||||||||||||||
|
@@ -131,6 +136,7 @@ export default { | |||||||||||||||||||||||
showIgnored: false, | ||||||||||||||||||||||||
groupBy: 'alphabetical', | ||||||||||||||||||||||||
showCheckboxes: false, | ||||||||||||||||||||||||
checkAll: false, | ||||||||||||||||||||||||
eventSource: null | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
}, | ||||||||||||||||||||||||
|
@@ -452,6 +458,15 @@ export default { | |||||||||||||||||||||||
console.error(err) | ||||||||||||||||||||||||
this.$f7.dialog.alert('An error occurred: ' + err) | ||||||||||||||||||||||||
}) | ||||||||||||||||||||||||
masterToggle() { | ||||||||||||||||||||||||
this.checkAll = !this.checkAll | ||||||||||||||||||||||||
for (let e in this.inbox) { | ||||||||||||||||||||||||
if (this.checkAll) { | ||||||||||||||||||||||||
this.selectedItems.push(this.inbox[e].thingUID) | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If an item is already in the selectedItems array it will be added again with this code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I´m a newbie in vue/javascript programming and contributing. Hopefully this explains a little bit why there are so many issues with my commit :O) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No worries, first-time contributions are welcome, we'll walk you through this 😃 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||
this.selectedItems = [] | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
}, | ||||||||||||||||||||||||
filterSelectedItems () { | ||||||||||||||||||||||||
return this.inbox.filter((e) => this.selectedItems.indexOf(e.thingUID) >= 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.
I'm not sure if there's enough room on a phone screen for 4 links at the bottom - that's why I left the unignore feature out. Unignore could however replace ignore if all checked items are already ignored.
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.
On my phone (Android10) there is enough space because the Text is not shown.
But this might be depending on the phone or theme.
When starting, the absence of an 'unignore'-button is not cruical, but over time one may add more and more things to the ignore-list, and then it makes much more sense to have 'unignore' in the multiselect-view, too.
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.
Yep but for instance on a iPhone 12 mini (which would have the iOS theme and a smallish screen), it would look like this:
this part of the code is for themes other than Material Design (i.e. Android) so adding a new function needs to account for those as well.