From 5430bebe03d038541d79a5941744894875c6a2b7 Mon Sep 17 00:00:00 2001 From: Felix Heidecke Date: Mon, 26 Feb 2018 13:47:40 +0100 Subject: [PATCH] Add Tagging support for email Update select2 to 3.5.4 Also update yarn.lock Add tags functionality for email input Fix code formatting Start searching @ three chars Validate mails as they are typed allow adding and removing addresses, toggle mail body Move [x] to the right Remove artificial delay Adapt js tests Add new unit tests Remove select2 autocomplete from share dialog Show send message for a minimum of 2 secs Remove delay from sendMail promise return --- apps/systemtags/appinfo/app.php | 3 +- build/package.json | 2 +- build/yarn.lock | 6 +- core/css/global.css | 9 +- core/css/share.css | 104 ++++++++++++------ core/js/sharedialogmailview.js | 70 +++++++++--- .../js/tests/specs/sharedialogmailviewSpec.js | 28 ++++- lib/private/legacy/template.php | 1 + 8 files changed, 162 insertions(+), 61 deletions(-) diff --git a/apps/systemtags/appinfo/app.php b/apps/systemtags/appinfo/app.php index d29d1f09c3fb..9ee631f992b2 100644 --- a/apps/systemtags/appinfo/app.php +++ b/apps/systemtags/appinfo/app.php @@ -31,6 +31,7 @@ function() { // FIXME: no public API for these ? \OC_Util::addVendorScript('select2/select2'); \OC_Util::addVendorStyle('select2/select2'); + \OCP\Util::addScript('select2-toggleselect'); \OCP\Util::addScript('oc-backbone-webdav'); \OCP\Util::addScript('systemtags/systemtags'); @@ -85,4 +86,4 @@ function() { 'order' => 25, 'name' => $l->t('Tags') ]; -}); \ No newline at end of file +}); diff --git a/build/package.json b/build/package.json index 8638cc5d6e5f..37a4db35960b 100644 --- a/build/package.json +++ b/build/package.json @@ -29,7 +29,7 @@ "@bower_components/jsTimezoneDetect": "HenningM/jstimezonedetect#1.0.5", "@bower_components/jstzdetect": "HenningM/jstimezonedetect#1.0.6", "@bower_components/moment": "moment/moment#2.19.4", - "@bower_components/select2": "ivaynberg/select2#3.5.3", + "@bower_components/select2": "ivaynberg/select2#3.5.4", "@bower_components/showdown": "showdownjs/showdown#1.8.5", "@bower_components/snapjs": "jakiestfu/Snap.js#2.0.0-rc1", "@bower_components/strengthify": "MorrisJobke/strengthify#0.5.2", diff --git a/build/yarn.lock b/build/yarn.lock index 562dac06d315..2f477e42d063 100644 --- a/build/yarn.lock +++ b/build/yarn.lock @@ -84,9 +84,9 @@ version "2.19.4" resolved "https://codeload.github.com/moment/moment/tar.gz/fea48bb69eda8c0459915d6aa66a910a4d43a55b" -"@bower_components/select2@ivaynberg/select2#3.5.3": - version "3.5.3" - resolved "https://codeload.github.com/ivaynberg/select2/tar.gz/a0ddc8c9466cb94a026e80b20264e8feacc4345b" +"@bower_components/select2@ivaynberg/select2#3.5.4": + version "3.5.4" + resolved "https://codeload.github.com/ivaynberg/select2/tar.gz/95a977f674b6938af55ec5f28b7772df93786c5c" "@bower_components/showdown@showdownjs/showdown#1.8.5": version "1.8.5" diff --git a/core/css/global.css b/core/css/global.css index f2408944b320..b50a734faa0f 100644 --- a/core/css/global.css +++ b/core/css/global.css @@ -13,6 +13,11 @@ transform: translate(-50%, -50%); } +.full-width { + width: 100%; + max-width: 100%; +} + .pull-left { float: left; } @@ -39,7 +44,7 @@ .hidden-visually { position: absolute; - left:-10000px; + left: -10000px; top: auto; width: 1px; height: 1px; @@ -47,7 +52,7 @@ } .bold { - font-weight:600; + font-weight: 600; } .text-small { diff --git a/core/css/share.css b/core/css/share.css index 76eabdbcef61..3204205638bd 100644 --- a/core/css/share.css +++ b/core/css/share.css @@ -27,16 +27,18 @@ margin-top: 1px; } -.shareTabView .shareWithLoading, -.shareTabView .linkShare .icon-loading-small { +.shareTabView .linkShare .icon-loading-small, +.shareTabView .shareWithLoading { display: inline-block !important; padding-left: 10px; } + .shareTabView .shareWithLoading { position: relative; right: 70px; top: 2px; } + .shareTabView .icon-loading-small.hidden { display: none !important; } @@ -79,14 +81,14 @@ flex-shrink: 0; } -.share-autocomplete-item .autocomplete-item-additional-info, -#shareWithList .user-additional-info { +#shareWithList .user-additional-info, +.share-autocomplete-item .autocomplete-item-additional-info { color: #888; } #shareWithList { - list-style-type:none; - padding:8px; + list-style-type: none; + padding: 8px; } #shareWithList li { @@ -102,15 +104,18 @@ display: inline-block; } -#shareWithList .unshare img, #shareWithList .showCruds img { - vertical-align:text-bottom; /* properly align icons */ +#shareWithList .showCruds img, +#shareWithList .unshare img { + vertical-align: text-bottom; + /* properly align icons */ } -#shareWithList label input[type=checkbox]{ +#shareWithList label input[type=checkbox] { margin-left: 0; position: relative; } -#shareWithList .username{ + +#shareWithList .username { padding-right: 8px; white-space: nowrap; text-overflow: ellipsis; @@ -119,36 +124,38 @@ overflow: hidden; vertical-align: middle; } -#shareWithList li label{ + +#shareWithList li label { margin-right: 8px; } + .shareTabView label { - font-weight:400; + font-weight: 400; white-space: nowrap; } .shareTabView input[type="checkbox"] { - margin:0 3px 0 8px; + margin: 0 3px 0 8px; vertical-align: middle; } a.showCruds { - display:inline; - opacity:.5; + display: inline; + opacity: 0.5; } a.unshare { - display:inline; - float:right; - opacity:.5; + display: inline; + float: right; + opacity: 0.5; padding: 10px; margin-top: -5px; margin-right: -10px; } #link { - border-top:1px solid #ddd; - padding-top:8px; + border-top: 1px solid #ddd; + padding-top: 8px; } .shareTabView input[type="submit"] { @@ -167,41 +174,48 @@ a.unshare { box-shadow: 0 0 6px #f8b9b7; } -.shareTabView .localShareView, .shareTabView .linkShareView { +.shareTabView .linkShareView, +.shareTabView .localShareView { clear: left; } #link #showPassword img { - padding-left:5px; - width:12px; + padding-left: 5px; + width: 12px; } -.fileowner,.reshare,#link label, -#expiration label { +#expiration label, +#link label, +.fileowner, +.reshare { display: inline-block; padding: 6px 4px; } -a.showCruds:hover,a.unshare:hover { - opacity:1; +a.showCruds:hover, +a.unshare:hover { + opacity: 1; } - -#defaultExpireMessage, /* fix expire message going out of box */ -.reshare { /* fix shared by text going out of box */ - white-space:normal; +#defaultExpireMessage, +/* fix expire message going out of box */ +.reshare { + /* fix shared by text going out of box */ + white-space: normal; } -#defaultExpireMessage { /* show message on new line */ +#defaultExpireMessage { + /* show message on new line */ display: block; padding-left: 4px; /* TODO: style the dropdown in a proper way - border-box, etc. */ width: 90%; } -.ui-autocomplete { /* limit dropdown height to 4 1/2 entries */ - max-height:103px; - overflow-y:auto; - overflow-x:hidden; +.ui-autocomplete { + /* limit dropdown height to 4 1/2 entries */ + max-height: 103px; + overflow-y: auto; + overflow-x: hidden; } .notCreatable { @@ -229,3 +243,21 @@ a.showCruds:hover,a.unshare:hover { z-index: 1; color: #999; } + +.emailPrivateLinkForm--dropDown > .select2-choices { + border-color: #ddd; + background-image: none; +} + +.select2-search-choice { + text-transform: lowercase; +} + +.select2-container-multi .select2-search-choice-close { + left: inherit; + right: 3px; +} + +.select2-container-multi .select2-choices .select2-search-choice { + padding: 3px 18px 3px 5px; +} diff --git a/core/js/sharedialogmailview.js b/core/js/sharedialogmailview.js index 042e75013743..9bd7bc81c958 100644 --- a/core/js/sharedialogmailview.js +++ b/core/js/sharedialogmailview.js @@ -17,7 +17,7 @@ '