Skip to content
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

gluon-config-mode-contact-info: better message if contact field is empty #909

Closed
wants to merge 1 commit into from

Conversation

rubo77
Copy link
Contributor

@rubo77 rubo77 commented Oct 20, 2016

If you don't enter a contact in config mode and obligatory is set to true you get this warning:

Ein oder mehr benötigte Felder sind nicht korrekt ausgefüllt!

siehe freifunk-kiel/ffki-packages#2

Klingt sehr harsch. und erweckt den Eindruck, dass man Freifunk nicht anonym beitreten dürfe. Besser wäre hier

Du hast keine Kontaktmöglichkeit angegeben! Wenn du deinen Knoten wirklich anonym betreiben willst, kannst du hier ein Leerzeichen eingeben. Bitte teilte uns dann auf anderem Wege mit, wie wir dich erreichen könnten falls wegen deines Knotens ein Problem bestehen sollte.

@rubo77
Copy link
Contributor Author

rubo77 commented Oct 20, 2016

Die Frage ist, wie man die Warnung bearbeiten kann, ist so etwas vorgesehen in Lua?

@@ -20,6 +20,13 @@ function M.section(form)
o.datatype = "string"
o.description = i18n.translate("e.g. E-mail or phone number")
o.maxlen = 140
if uci:get_first("gluon-node-info", "owner", "contact", "") == "" then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kann mir jemand einen Tipp geben, wie man das formulieren muss um abzufragen ob das formular schon einmal übertragen wurde? Nur dann soll die zusatz warning erscheinen. Im moment erscheint die immer

@rotanid rotanid added 0. type: enhancement The changeset is an enhancement needs work labels Nov 6, 2016
@rubo77
Copy link
Contributor Author

rubo77 commented Nov 7, 2016

@TobleMiner hat da was geschrieben: freifunk-kiel/ffki-packages#7

@rubo77
Copy link
Contributor Author

rubo77 commented Nov 7, 2016

Scheint zu funktionieren, zumindest, wenn man die Änderung so direkt auf enem Router im Config Mode in der Datei /lib/gluon/config-mode/wizard/0500-contact-info.lua macht.

Werde nachher mal eine 2016.2.x Firmware damit bauen.

Der Branch ist rebased und kann gemerged werden.

@rubo77
Copy link
Contributor Author

rubo77 commented Nov 9, 2016

Ich habe damit erfolgreich eine Firmware gebaut
kein-kontakt

@christf
Copy link
Member

christf commented Nov 21, 2016

@rubo77 ich fänd es gut, wenn der Default-Text vorsieht dass anonymer Betrieb ok ist und schlage vor
anstelle von "wenn Du deinen Knoten wirklich anonym betreiben willst"
wenn Du Deinen Knoten anonym betreiben willst"
zu verwenden.

Außerdem möchte ich anregen, dass die Reihenfolge der Punkte vom Allgemeinen zum Besonderen gehen sollte, konkret "Ein oder mehr benötigte Felder sind nicht ausgefüllt" sollte m.M.n. oben stehen.

@rubo77
Copy link
Contributor Author

rubo77 commented Nov 22, 2016

Über die Reihenfolge der Punkte habe ich keinen Einfluss, der Punkt "Ein oder mehr benötigte Felder sind nicht ausgefüllt" ist eine Standard-Message, die direkt aus LUA kommt und ist hier leider nicht weiter individualisierbar, sonst würde ich die ganz weglassen. Zumindest habe ich keine Idee, wie man die Reihenfolge ändern könnte.

Ich glaube, das "wirklich" wegzulassen spricht gegen den eigendtlichen Zweck der Option contact obligatory=true: Wenn eine Community sich dafür entschließt dies in ihre site.conf reinzunehmen, dann ja um das Pico Peering Agreement genauer durchzusetzen (in dem man sich als Knotenbetreigber ja erklärt, erreichbar zu sein).

Das "wirklich" in dem Satz macht noch mal deutlich, dass es in der Community ungewöhnlich ist, wenn jemand einen Knoten anonym betreibt.

Wenn eine Community gerne anonyme Knotenbetreiber unterstützen will, dann müssen sie die Option contact obligatory ja nicht auf true setzen und dieser ganze text wird nicht angezeigt (obligatory wurde hier eingeführt: #843 )

o.validate = function(self, val)
if val == nil then
self.section.error = {
[1] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The [1] = is redundant, as you assign a single table element, it will have the key 1 by default.

i18n.translate(
'You didn\'t provide any contact information! If you really want to run your '
.. 'node anonymously, you can enter a blank here. Please tell us an alternative '
.. 'how we could contact you in case there is anything wrong with your node.'
Copy link
Member

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 I like this text. The exclamation mark seems a bit over the top; I'm not sure how common the word "blank" is, and recommending a way around our own restrictions is somewhat weird.

"alternative how we could contact you" -> "alternative way to contact you"

Also, using " quotation marks instead of ' would be better here, as you wouldn't need to escape the ' in the text. In contrast to other languages, " and ' strings aren't interpreted differently in Lua, the only difference is which quotationn marks need to be escaped in the text.

@rubo77
Copy link
Contributor Author

rubo77 commented Nov 29, 2016

it's not about showing a way to circumvent our own restrictions but more an effect of psychology:

users tend to just skip this step of entering a contact informations with the thought that they will do it later. But then they forget about how important it is for our community.

this is the main reason for adding the option to make the contact field obligatory .

on the other hand we don't want to urge people To not being Anonimus anymore, if they really want this

@rubo77
Copy link
Contributor Author

rubo77 commented Nov 29, 2016

but you are right, maybe some Community don't want to allow anonymous Nodes, then we have to add a third option for obligatory showing this warning.d

@SimJoSt
Copy link
Contributor

SimJoSt commented Nov 29, 2016

I would like this "you did not fill out the contact field"-notification, even though our community doesn't plan on forcing users to publish a way of contact for everyone to see.
My preferred solution would not be to force someone to enter a space in the contact field but click on the "Submit and Restart" button again, after he clicked it the first time and the message appeared. In my opinion, that would be the most user-friendly solution, while also forcing users to acknowledge the existence of the contact field and their desire not to fill it.

Using the solution with a space would lead to unnecessary "owner" entries in the nodes.json.

@rotanid
Copy link
Member

rotanid commented Nov 29, 2016

i implemented something similar, a javascript message "are you sure to leave this blank?":
tecff@806d8c1
really hacky though

@rubo77
Copy link
Contributor Author

rubo77 commented Nov 29, 2016

I don't like popup questions, and I know many others don't either. so an inbound warning is more suiting. I like it like this PR is now. only one change would enhance it, if it would be possible to get rid of the sentence "Ein oder mehr benötigte Felder sind nicht korrekt ausgefüllt!".

I could think of hide it with javascript if that is an ok solution?

@rubo77
Copy link
Contributor Author

rubo77 commented Nov 30, 2016

Maybe here is a solution, how to just change the error message instead of adding a second:

http://luci.subsignal.org/trac/wiki/Documentation/LuCI-0.10#TranslationFileFormat
the Paragraph Validation

opt = section:option(Value, "optname", "Title Text")

function opt.validate(self, value, section)
    if input_is_valid(value) then
        return value
    else
        return nil, "The value is invalid because ..."
    end
end

the question is, how do I connect this code to the variable owner.contact?

@rubo77 rubo77 force-pushed the patch-10 branch 2 times, most recently from fbaf6fa to 7f5404d Compare November 30, 2016 23:30
@rubo77
Copy link
Contributor Author

rubo77 commented Nov 30, 2016

I solved it with that new function, so there is only one message now with this code: https://github.com/freifunk-gluon/gluon/pull/909/files#diff-3e120acf3433fa3168afa4f9995f2c5eR25

@neocturne
Copy link
Member

Still, this is telling people to enter a space, which is really ugly and cluttering the respondd data. I really don't like it.

@rubo77
Copy link
Contributor Author

rubo77 commented Dec 1, 2016

It is not complete "clutter". It is an extra information about the node-user, that he wants to be anonymous.

Maybe we should not tell to enter a space, but crreate a checkbox:

I want to run the node anonymous and will contact the community on another medium [ x ]

And when clicked, the box hides the input field with javascript and enters the string in the hidden field ~anonymous~

(We would have to find out, how to use the value of a checkbox to manipulate the input value before the save action)

@neocturne
Copy link
Member

neocturne commented Dec 1, 2016

I like the idea of adding a checkbox.

Edit: The checkbox would just remove the text field and allow submitting the form.

@rubo77
Copy link
Contributor Author

rubo77 commented Dec 1, 2016

We have to keep in mind, that making it too easy to circumvent adding a contact will annullate the effect of the obligatory setting. If it is too easy, people just click the checkbox to get rid of that contact field so they can continue really fast :-) And they won't even read the notice how important it would have been to enter something.

I like the way it is now, with a red warning, that draws the attention. Can we keep this while also adding a checkbox? hmm – Maybe the checkbox has to be inside the html code of the warning message.

I think a checkbox will need a completely new kind of validation. the built-in validation can only handle required or not, but it cannot be changed from required to not on the fly, can it?

@neocturne
Copy link
Member

A hidden field will be extempt from validation.

We can even add a warning that is shown as soon as the user checks the box (thus replace the text field with the warning).

@rubo77
Copy link
Contributor Author

rubo77 commented Dec 10, 2016

Ok. I will add a message then:

"Wir respektieren deinen Wunsch, den Knoten anonym zu betreiben. Um einen Freifunk Netz zu betreiben, ist es notwendig, dass wir die Betreiber der Knoten erreichen können. Deshalb teile uns bitte auf anderem Wege mit, wie wir dich erreichen können, falls mit deinem Knoten etwas sein sollte."

Und eine zweite checkBox, die erst dann auftaucht, die man ankreuzen muss mit dieserm Label:
"Ich erkläre mich mit dem Pico peering agreement einverstanden" und dies verlinken

@rotanid
Copy link
Member

rotanid commented Mar 10, 2017

@rubo77 do you still plan to work on this, as there was no activity for 3 months now?

@rubo77
Copy link
Contributor Author

rubo77 commented Mar 11, 2017

Yes. But I wait for the final gluon-web specification

@Adorfer
Copy link
Contributor

Adorfer commented Mar 11, 2017

I would appreciate a scaled level selection for the PPA checkbox and the contact fields.
like for PPA "no feedback/reminder" do you really.. ?" /Force" to agree.
and for the contact "Accept emty", "Force nonempty", "Force valid Email syntax" (via regex)

@rubo77 rubo77 changed the base branch from master to v2016.2.x June 6, 2017 21:51
@neocturne neocturne added the 2. status: blocked Marked as blocked because it's waiting on something label Jun 19, 2017
@rubo77 rubo77 changed the base branch from v2016.2.x to master June 29, 2017 22:29
@rubo77
Copy link
Contributor Author

rubo77 commented Jun 29, 2017

You can remove the flag blocked.

I pushed an untested version now, will continue tomorrow...


contact_field:depends(no_name, false)

-- TODO: this should only be shown, if no_name is true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should only be shown, if no_name is true. Someone has an idea how to solve this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, one option would be to use a value with a custom template instead of a section, but I guess it's a better idea to add dependency support for sections to gluon-web.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: #1349

@rotanid rotanid added 2. status: merge conflict The merge has a conflict and needs rebasing and removed 2. status: blocked Marked as blocked because it's waiting on something labels Feb 3, 2018
@rotanid
Copy link
Member

rotanid commented Feb 15, 2018

do you plan to work on this significantly, soon? otherwise i would rather close this PR and you open a new one as soon as you want to work on it again...

@rubo77
Copy link
Contributor Author

rubo77 commented Feb 15, 2018

I am waiting for @NeoRaider to add dependency support for sections to gluon-web.

@rubo77
Copy link
Contributor Author

rubo77 commented Mar 22, 2018

I created an issue: #1349

@rotanid rotanid added the 2. status: blocked Marked as blocked because it's waiting on something label Mar 23, 2018
@rotanid
Copy link
Member

rotanid commented Jun 7, 2018

closing this, as there's no obligatory anymore.
even if we will re-add it ( #1403 ) there's still the dependency support missing ( #1349 )
so IF those other two issues are ever fixed, please open a new PR for this.

@rotanid rotanid closed this Jun 7, 2018
@rubo77
Copy link
Contributor Author

rubo77 commented Jun 4, 2020

#1349 is added now, so dependable sections could be used.

@rotanid : why did you mention 1408 ? you probably meant #1403 (which was rejected by now)

@rotanid
Copy link
Member

rotanid commented Jun 5, 2020

yes, corrected 1408 to 1403. but 1403 is still rejected, so this doesn't change?

@rubo77
Copy link
Contributor Author

rubo77 commented Jun 5, 2020

I think it would be worth, adding some comments, if someone leaves the contact field empty.

I don't suggest to make it mandatory again, but just an info, that a contact would serve the ppa.

With the new sections functionality, this would be possible now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: enhancement The changeset is an enhancement 2. status: blocked Marked as blocked because it's waiting on something 2. status: merge conflict The merge has a conflict and needs rebasing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants