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
Feature/condensed labels #13
Feature/condensed labels #13
Conversation
very nice 👍 |
nice! 👍 |
Vielen Dank für den Pull Request und die ausführliche Beschreibung. Damit das Feature für alle interessant ist, braucht es wohl noch einen anderen Einstiegspunkt ausser dem Query Parameter (sonst weiss das ausser uns niemand ;) ). Leider ist dieser nicht gerade offensichtlich. Eine weitere Sub-Menu Ebene beim Export Button wäre möglich, würde wohl aber anderen Hitobito Instanzen in die Quere kommen. Hast du dafür noch Ideen? Du hängst die Logik in die Methode Könntest du zudem |
Der Einstiegspunkt ist absichtlich so gewählt, weil ich das Feature niemandem aufzwingen wollte. Diejenigen die es brauchen, sollten es aber können. In einem zweiten Schritt habe ich mir überlegt, dass es einen Export-Wizard geben sollte, bei dem man dann auch die Sortierung und (wie auf ideascale schon jemand gewünscht hat) die Auswahl der angezeigten Felder. Ich bin auch nicht der Ansicht, dass das das wichtigste Feature ist, aber ich wollte mal sehen, ob ich auch etwas beitragen kann. Die Klasse habe ich verschoben, und zusätzliche Tests geschrieben. Danke für den Hinweis. |
Aufzwingen wollen wir das sicher niemandem, aber jedem die Möglichkeit bieten. Ich finde das Feature durchaus praktisch, deshalb sollte es auch für alle im GUI auffindbar sein. |
Hallo Diego Tausend Dank, cool, dass wir jetzt Contributions erhalten. Das ist grandios! Ich präferiere etwas in Richtung B oder D. Fände das gut. Aber ich denke es wäre auch Ok, das zuerst als Power User feature festzuhalten und vielleicht zu messsen, wie oft, das dann gebraucht wird. Was meint ihr hierzu? Gruäss |
Wau, vielen Dank für das tolle Feature! Der nächste PBS-Release ist im Januar 2016 geplant. Frage an dich, Diego: Findest du bis dann Zeit, eine der genannten GUI-Varianten umzusetzen? Gruss |
Hallo zusammen Ich finde die Vorschläge gut, mir gefällt die Variante C am besten, weil es den jetztigen Workflow am wenigsten durcheinanderbringt. Ich kann das umsetzten, sobald wir uns für eine Variante entschieden haben. lg Filou |
Variante C ist wohl einfacher zu implementieren, da bisher noch kein "Schieber Widget" wie in D existiert (oder gibt's das doch schon, @RolandStuder?). Ein paar Hints noch:
Bei weiteren Fragen kannst du dich gerne melden. |
Wir sind definitiv für Variante C (oder B, Widget werden wir nächstens einbauen). @diegosteiner, hast du Zeit, das zu umzusetzen? |
* added option to export dropdown menu * ran rubocop/coffeelint # 50-character subject line # # 72-character wrapped longer description. This should answer: # # * Why was this change necessary? # * How does it address the problem? # * Are there any side effects? # # Include a link to the ticket, if any.
# 50-character subject line # # 72-character wrapped longer description. This should answer: # # * Why was this change necessary? # * How does it address the problem? # * Are there any side effects? # # Include a link to the ticket, if any.
# 50-character subject line # # 72-character wrapped longer description. This should answer: # # * Why was this change necessary? # * How does it address the problem? # * Are there any side effects? # # Include a link to the ticket, if any.
293a8fb
to
acbcc3d
Compare
Ich habe das Feedback umgesetzt. Ich hoffe das passt euch so. Einige Hinweise:
|
Sieht super aus, merci! Ich werde die Änderungen so rasch als möglich integrieren. Der hitobito_youth wagon war nicht auf dem neusten Stand. Sollte jetzt funktionieren. |
Gemerged und das Parameter Handling verschoben, damit das Feature auch bei Anlässen und Abos funktioniert. |
👍 Danke! |
Danke Filou! |
Abstract
This PR includes the implementation of a feature that has been requested on ideascale here: http://midata.ideascale.com/a/dtd/Nur-eine-Etikette-pro-Haushalt/94704-26593. It states that it should be possible for multiple people living at the same household to only print one, condensed label.
Usage
To make use of this feature either check the checkbox located in the "Export > Labels"-Menu or add
condense_labels=true
to the query parameters when calling the export.Implementation
To implement this feature a wrapper class for contactables
CondensedContact
was created. The 'merge-strategy' is conservative and only allows contactables with matching country, town, zip-code, address, and last_name to be merged. The CondensedContact class acts to implement the same interface as any other contactable, but will raise an error when an ambivalent field is accessed (e.g. id or first_name)Performance
The condensation of a list runs with O(n^2), as it has to compare every item with another in the list. This is necessary, as it can not be asserted that the list has been sorted correctly.
Conventions
It has been tried to follow the established conventions of the project, which includes testing with rspec and asserting code style with
rubocop -c rubocup-must.yml
Contact
Diego Steiner / Filou, Pfadi Züri