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

Add more personal information fields to the settings page for enhanced federated sharing #1946

Merged
merged 53 commits into from
Nov 21, 2016

Conversation

schiessle
Copy link
Member

@schiessle schiessle commented Oct 28, 2016

Continue to develop the advanced personal settings where people can add more personal information and publish them if they wish for internal use, public or for federated sharing

This is the PR @ChristophWurst and I worked on a few months ago. I just rebased it and had to resolve many merge conflicts. Also some UX part is broken now. 😢

  • fix avatar upload
  • allow to crop the avatar
  • drop down menus are not allign correctly
  • spinner next to "profile picture" doesn't disappear
  • drop down for avatar scope is broken
  • Don't fail when email is empty

@ChristophWurst do you have some time to have a look at this front-end issues, so that I can concentrate on the back-end stuff? This would be great!

@mention-bot
Copy link

@schiessle, thanks for your PR! By analyzing the history of the files in this pull request, we identified @MorrisJobke, @jancborchardt and @icewind1991 to be potential reviewers.

@ChristophWurst ChristophWurst self-assigned this Oct 30, 2016
@ChristophWurst
Copy link
Member

@jancborchardt @skjnldsv any idea how I could structure and style the HTML to show the popover menu underneath the icon in the header?

Currently it looks like this

<div class="personal-settings-setting-box">
        <form id="emailform" class="section">
            <h2>
                <label for="email">Email</label>
                <span class="icon-password">
            </span><div class="federationScopeMenu popovermenu bubble hidden open menu" style="right: 122px;"></div></h2>
            <input name="email" id="email" value="a@b.ca" placeholder="Your email address" autocomplete="on" autocapitalize="off" autocorrect="off" type="email">
            <input id="emailscope" value="private" type="hidden">
            <br>
            <em>For password recovery and notifications</em>
            <span class="icon-checkmark hidden">

    </span></form></div>

where I position it absolute and calculate the distance to the right side with js. That apparently does or does not work depending on the width of the header label (e.g. "Email" is shorter than "Phone number").

@ChristophWurst
Copy link
Member

ChristophWurst commented Oct 31, 2016

  • TODO: fix change password layout
    bildschirmfoto von 2016-10-31 16-09-50

@ChristophWurst
Copy link
Member

@jancborchardt I did not manage to fix it, even though you gave me some really good pointers.

My approach was

diff --git a/settings/css/settings.css b/settings/css/settings.css
index 19487d4..b35f1c5 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -86,9 +86,10 @@ input#openid, input#webdav { width:20em; }
 #personal-settings-container > div h2 {
    position: relative;
 }
-#personal-settings-container > div h2 span[class^="icon-"],
-#personal-settings-avatar-container h2 span[class^="icon-"] {
+#personal-settings-container > div span[class^="icon-"],
+#personal-settings-avatar-container span[class^="icon-"] {
    display: inline-block;
+   position: relative;
    margin-left: 5px;
    background-size: 110%;
    opacity: 0.3;
@@ -99,6 +100,9 @@ input#openid, input#webdav { width:20em; }
 .personal-settings-setting-box input[type="tel"] {
    width: 17em;
 }
+.personal-settings-setting-box h2 {
+   display: inline-block;
+}
 #personal-settings-container > div > form span[class^="icon-checkmark"] {
    position: absolute;
    left: 239px;
diff --git a/settings/js/federationsettingsview.js b/settings/js/federationsettingsview.js
index 73b9f85..dc21768 100644
--- a/settings/js/federationsettingsview.js
+++ b/settings/js/federationsettingsview.js
@@ -62,7 +62,7 @@
            var self = this;
            _.each(this._inputFields, function(field) {
                var $heading = self.$('#' + field + 'form h2');
-               var $icon = self.$('#' + field + 'form h2 > span');
+               var $icon = self.$('#' + field + 'form > span');
                var scopeMenu = new OC.Settings.FederationScopeMenu();

                self.listenTo(scopeMenu, 'select:scope', function(scope) {
@@ -71,12 +71,6 @@
                $heading.append(scopeMenu.$el);
                $icon.on('click', _.bind(scopeMenu.show, scopeMenu));

-               // Fix absolute position according to the heading text length
-               // TODO: find alternative to those magic number
-               var diff = field === 'avatar' ? 104 : 68;
-               var pos = ($heading.width() - $heading.find('label').width()) - diff;
-               scopeMenu.$el.css('right', pos);
-
                // Restore initial state
                self._setFieldScopeIcon(field, self._config.get(field + 'Scope'));
            });
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 432b05a..40572fc 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -71,13 +71,15 @@ if($_['displayNameChangeSupported']) {
        <form id="displaynameform" class="section">
            <h2>
                <label for="displayname"><?php p($l->t('Full name')); ?></label>
-               <span class="icon-password"/>
            </h2>
-           <input type="text" id="displayname" name="displayname"
-                  value="<?php p($_['displayName']) ?>"
-                  autocomplete="on" autocapitalize="off" autocorrect="off" />
-           <span class="icon-checkmark hidden"/>
-           <input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
+           <span class="icon-password"></span>
+           <div>
+               <input type="text" id="displayname" name="displayname"
+                      value="<?php p($_['displayName']) ?>"
+                      autocomplete="on" autocapitalize="off" autocorrect="off" />
+               <span class="icon-checkmark hidden"/>
+               <input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>">
+           </div>
        </form>
    </div>
    <div class="personal-settings-setting-box">

which works kind of, but the menu's width is then based on the parent's width - the h2. For short heading text this makes the popover menu too narrow :-/
bildschirmfoto von 2016-10-31 17-58-26

@ChristophWurst ChristophWurst force-pushed the federated-sharing-persona-settings branch from d39365f to 2332cc7 Compare November 7, 2016 08:31
@skjnldsv skjnldsv force-pushed the federated-sharing-persona-settings branch from 36af885 to c34d0b6 Compare November 7, 2016 14:56
@jancborchardt
Copy link
Member

jancborchardt commented Nov 7, 2016

@skjnldsv thanks a lot for your flexbox magic! :)

@skjnldsv skjnldsv force-pushed the federated-sharing-persona-settings branch from fc418e5 to f2f5774 Compare November 7, 2016 16:58
}

.popovermenu.hidden {
display: none;
}

.popovermenu .menuitem {
display: block;
display: flex !important;
Copy link
Member

Choose a reason for hiding this comment

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

I hate to do that, but since files use the action class, and because files/css/files.css has a lot of related values, this is the easier way.

Copy link
Member

Choose a reason for hiding this comment

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

@skjnldsv yeah, let it be forgiven ;)

@skjnldsv skjnldsv force-pushed the federated-sharing-persona-settings branch from f2f5774 to 131b389 Compare November 7, 2016 17:01
@schiessle
Copy link
Member Author

@skjnldsv looks good, thanks for your help!

@schiessle
Copy link
Member Author

As already said, the menus look great now. But what is still broken is the profile picture upload. @skjnldsv @ChristophWurst maybe you can have a look at it? Thanks!

@skjnldsv
Copy link
Member

skjnldsv commented Nov 9, 2016

@schiessle what doesn't work exactly?

@schiessle
Copy link
Member Author

If you upload a profile picture you should get a preview which allows you to select the region you want to use. This works on master but is for some reasons broken on this branch (which is beside our commits here the same as master)

This is how it looks at master:

profile picture1

And this is how it looks on this branch:

profile picture 2

@schiessle
Copy link
Member Author

@icewind1991 can you have a look at the avatar upload issue? Thanks!

@schiessle
Copy link
Member Author

@skjnldsv I just saw that the drop-down for the avatar is not positioned correctly, it shows up at the top left. All other drop downs work fine. Maybe you can have another look? Thanks a lot!

@skjnldsv
Copy link
Member

It's related tot the js handling the popup, I don't know what is causing this :/

@schiessle schiessle force-pushed the federated-sharing-persona-settings branch from 50c5925 to e08a533 Compare November 16, 2016 11:53
@rullzer rullzer force-pushed the federated-sharing-persona-settings branch from a8b7b0c to cbda15c Compare November 16, 2016 15:38
rullzer and others added 16 commits November 21, 2016 11:30
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
@rullzer rullzer force-pushed the federated-sharing-persona-settings branch from 75986ba to a1ca54a Compare November 21, 2016 10:30
@schiessle
Copy link
Member Author

schiessle commented Nov 21, 2016

👍 for all the stuff not done by me... second reviewer... Let's get this in. 😉

PS: It is OK, that not every commit is signed, some of them are already older than the rule

@LukasReschke
Copy link
Member

@LukasReschke Just to double check: Did the look up server now stored every test I did with my dev instance? I assume not, because the signature couldn't be verified, right?

Correct.

@LukasReschke
Copy link
Member

LGTM

@LukasReschke LukasReschke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Nov 21, 2016
@LukasReschke LukasReschke merged commit 94004cf into master Nov 21, 2016
@LukasReschke LukasReschke deleted the federated-sharing-persona-settings branch November 21, 2016 12:50
@jancborchardt
Copy link
Member

Awesome stuff, good work all around :)

@@ -57,7 +69,129 @@ public function __construct(array $urlParams=[]){

// Register Middleware
$container->registerAlias('SubadminMiddleware', SubadminMiddleware::class);
$container->registerMiddleWare('SubadminMiddleware');
Copy link
Member

@nickvergessen nickvergessen Nov 22, 2016

Choose a reason for hiding this comment

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

This here is quite crucial, needs to be fixed in a new PR and we should drop all the registerService calls from here again, as mentioned below by Christoph

Copy link
Member

Choose a reason for hiding this comment

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

🙈

Copy link
Member

Choose a reason for hiding this comment

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

=> #2234

LukasReschke added a commit that referenced this pull request Nov 22, 2016
Removed by mistake in #1946

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
MorrisJobke added a commit that referenced this pull request Nov 16, 2018
This setting was introduced with f489fd9 in #1946. I could not find any hint that this was ever working local only. Thus this should be changed to "private" to properly reflect what it is doing.

Background is that the properties aren't synced to the system address book if the setting is "private".

Fixes #10317

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement feature: settings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants