diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-12-12 14:32:37 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-12-12 14:32:37 +0200 |
commit | 047e22571e39d0459ce53c765fdb19060d71756d (patch) | |
tree | 8e255f5f187e69d3659781b3f7eb027f8a51bd4f /client/components | |
parent | ed95542b675aa34dee1c6eaafb1fb3a157215039 (diff) | |
parent | f115e33f6672bfe6fa625b190a01514f8aaa8870 (diff) | |
download | wekan-047e22571e39d0459ce53c765fdb19060d71756d.tar.gz wekan-047e22571e39d0459ce53c765fdb19060d71756d.tar.bz2 wekan-047e22571e39d0459ce53c765fdb19060d71756d.zip |
Merge branch 'devel'
Diffstat (limited to 'client/components')
-rw-r--r-- | client/components/activities/activities.styl | 4 | ||||
-rw-r--r-- | client/components/boards/boardsList.js | 3 | ||||
-rw-r--r-- | client/components/cards/attachments.jade | 4 | ||||
-rw-r--r-- | client/components/cards/attachments.js | 8 | ||||
-rw-r--r-- | client/components/cards/cardDetails.jade | 11 | ||||
-rw-r--r-- | client/components/cards/cardDetails.js | 2 | ||||
-rw-r--r-- | client/components/cards/checklists.js | 4 | ||||
-rw-r--r-- | client/components/lists/list.styl | 1 | ||||
-rwxr-xr-x | client/components/main/editor.js | 2 | ||||
-rw-r--r-- | client/components/main/header.js | 3 | ||||
-rw-r--r-- | client/components/settings/peopleBody.jade | 7 | ||||
-rw-r--r-- | client/components/settings/peopleBody.js | 14 | ||||
-rw-r--r-- | client/components/settings/settingBody.js | 12 | ||||
-rw-r--r-- | client/components/users/userAvatar.js | 4 | ||||
-rw-r--r-- | client/components/users/userHeader.js | 10 |
15 files changed, 53 insertions, 36 deletions
diff --git a/client/components/activities/activities.styl b/client/components/activities/activities.styl index 36efd771..380e7b40 100644 --- a/client/components/activities/activities.styl +++ b/client/components/activities/activities.styl @@ -17,10 +17,14 @@ height: @width .activity-desc + word-wrap: break-word + overflow: hidden flex: 1 align-self: center margin: 0 margin-left: 3px + overflow: hidden; + word-break: break-word; .activity-comment display: block diff --git a/client/components/boards/boardsList.js b/client/components/boards/boardsList.js index 6c9600a1..1ed88146 100644 --- a/client/components/boards/boardsList.js +++ b/client/components/boards/boardsList.js @@ -2,10 +2,7 @@ const subManager = new SubsManager(); BlazeComponent.extendComponent({ onCreated() { - // Here is the only place that boards data needed, all boards data will stop sync when leaving this template. - Meteor.subscribe('boards'); Meteor.subscribe('setting'); - Meteor.subscribe('user-admin'); }, boards() { diff --git a/client/components/cards/attachments.jade b/client/components/cards/attachments.jade index c8442691..0f79323b 100644 --- a/client/components/cards/attachments.jade +++ b/client/components/cards/attachments.jade @@ -21,8 +21,8 @@ template(name="attachmentDeletePopup") template(name="attachmentsGalery") .attachments-galery each attachments - a.attachment-item.swipebox(href="{{url}}" title="{{name}}") - .attachment-thumbnail + .attachment-item + a.attachment-thumbnail.swipebox(href="{{url}}" title="{{name}}") if isUploaded if isImage img.attachment-thumbnail-img(src="{{url}}") diff --git a/client/components/cards/attachments.js b/client/components/cards/attachments.js index 36e8a5ec..b1f88bf1 100644 --- a/client/components/cards/attachments.js +++ b/client/components/cards/attachments.js @@ -60,7 +60,13 @@ Template.cardAttachmentsPopup.events({ file.boardId = card.boardId; file.cardId = card._id; file.userId = Meteor.userId(); - Attachments.insert(file); + + const attachment = Attachments.insert(file); + + if (attachment && attachment._id && attachment.isImage()) { + card.setCover(attachment._id); + } + Popup.close(); }); }, diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index 4c68c2f7..0a7a8cd6 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -85,13 +85,12 @@ template(name="cardDetails") hr +checklists(cardId = _id) - if attachments.count - hr - h2 - i.fa.fa-paperclip - | {{_ 'attachments'}} + hr + h2 + i.fa.fa-paperclip + | {{_ 'attachments'}} - +attachmentsGalery + +attachmentsGalery hr .activity-title diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index b62f31d4..f4e6e773 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -23,6 +23,8 @@ BlazeComponent.extendComponent({ this.parentComponent().showOverlay.set(true); this.parentComponent().mouseHasEnterCardDetails = false; this.calculateNextPeak(); + + Meteor.subscribe('unsaved-edits'); }, isWatching() { diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js index d3a946f0..5c0e3d2e 100644 --- a/client/components/cards/checklists.js +++ b/client/components/cards/checklists.js @@ -181,8 +181,8 @@ BlazeComponent.extendComponent({ Template.checklistDeleteDialog.onCreated(() => { const $cardDetails = this.$('.card-details'); this.scrollState = { position: $cardDetails.scrollTop(), //save current scroll position - top: false, //required for smooth scroll animation - }; + top: false, //required for smooth scroll animation + }; //Callback's purpose is to only prevent scrolling after animation is complete $cardDetails.animate({ scrollTop: 0 }, 500, () => { this.scrollState.top = true; }); diff --git a/client/components/lists/list.styl b/client/components/lists/list.styl index 04685137..d5800140 100644 --- a/client/components/lists/list.styl +++ b/client/components/lists/list.styl @@ -81,6 +81,7 @@ .list-header-plus-icon color: #a6a6a6 + margin-right: 10px .highlight color: #ce1414 diff --git a/client/components/main/editor.js b/client/components/main/editor.js index 5987b772..5f384ece 100755 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -6,7 +6,7 @@ Template.editor.onRendered(() => { $textarea.escapeableTextComplete([ // Emoji { - match: /\B:([\-+\w]*)$/, + match: /\B:([-+\w]*)$/, search(term, callback) { callback(Emoji.values.map((emoji) => { return emoji.includes(term) ? emoji : null; diff --git a/client/components/main/header.js b/client/components/main/header.js index b005775a..7fbc5716 100644 --- a/client/components/main/header.js +++ b/client/components/main/header.js @@ -1,3 +1,6 @@ +Meteor.subscribe('user-admin'); +Meteor.subscribe('boards'); + Template.header.helpers({ wrappedHeader() { return !Session.get('currentBoard'); diff --git a/client/components/settings/peopleBody.jade b/client/components/settings/peopleBody.jade index d6568720..a3506a24 100644 --- a/client/components/settings/peopleBody.jade +++ b/client/components/settings/peopleBody.jade @@ -68,9 +68,6 @@ template(name="editUserPopup") | {{_ 'error-username-taken'}} input.js-profile-username(type="text" value=user.username) label - | {{_ 'initials'}} - input.js-profile-initials(type="text" value=user.profile.initials) - label | {{_ 'email'}} span.error.hide.email-taken | {{_ 'error-email-taken'}} @@ -85,5 +82,9 @@ template(name="editUserPopup") select.select-active.js-profile-isactive option(value="false") {{_ 'yes'}} option(value="true" selected="{{user.loginDisabled}}") {{_ 'no'}} + hr + label + | {{_ 'password'}} + input.js-profile-password(type="password") input.primary.wide(type="submit" value="{{_ 'save'}}") diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js index d0da60d0..7cc992f2 100644 --- a/client/components/settings/peopleBody.js +++ b/client/components/settings/peopleBody.js @@ -87,24 +87,26 @@ Template.editUserPopup.events({ const user = Users.findOne(this.userId); const fullname = tpl.find('.js-profile-fullname').value.trim(); const username = tpl.find('.js-profile-username').value.trim(); - const initials = tpl.find('.js-profile-initials').value.trim(); + const password = tpl.find('.js-profile-password').value; const isAdmin = tpl.find('.js-profile-isadmin').value.trim(); const isActive = tpl.find('.js-profile-isactive').value.trim(); const email = tpl.find('.js-profile-email').value.trim(); - let isChangeUserName = false; - let isChangeEmail = false; + + const isChangePassword = password.length > 0; + const isChangeUserName = username !== user.username; + const isChangeEmail = email.toLowerCase() !== user.emails[0].address.toLowerCase(); Users.update(this.userId, { $set: { 'profile.fullname': fullname, - 'profile.initials': initials, 'isAdmin': isAdmin === 'true', 'loginDisabled': isActive === 'true', }, }); - isChangeUserName = username !== user.username; - isChangeEmail = email.toLowerCase() !== user.emails[0].address.toLowerCase(); + if(isChangePassword){ + Meteor.call('setPassword', password, this.userId); + } if (isChangeUserName && isChangeEmail) { Meteor.call('setUsernameAndEmail', username, email.toLowerCase(), this.userId, function (error) { diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js index 5b015918..8c1ff1c7 100644 --- a/client/components/settings/settingBody.js +++ b/client/components/settings/settingBody.js @@ -1,8 +1,3 @@ -Meteor.subscribe('setting'); -Meteor.subscribe('mailServer'); -Meteor.subscribe('accountSettings'); -Meteor.subscribe('announcements'); - BlazeComponent.extendComponent({ onCreated() { this.error = new ReactiveVar(''); @@ -11,6 +6,11 @@ BlazeComponent.extendComponent({ this.emailSetting = new ReactiveVar(false); this.accountSetting = new ReactiveVar(false); this.announcementSetting = new ReactiveVar(false); + + Meteor.subscribe('setting'); + Meteor.subscribe('mailServer'); + Meteor.subscribe('accountSettings'); + Meteor.subscribe('announcements'); }, setError(error) { @@ -116,7 +116,7 @@ BlazeComponent.extendComponent({ const from = this.checkField('#mail-server-from'); const tls = $('#mail-server-tls.is-checked').length > 0; Settings.update(Settings.findOne()._id, {$set:{'mailServer.host':host, 'mailServer.port': port, 'mailServer.username': username, - 'mailServer.password': password, 'mailServer.enableTLS': tls, 'mailServer.from': from}}); + 'mailServer.password': password, 'mailServer.enableTLS': tls, 'mailServer.from': from}}); } catch (e) { return; } finally { diff --git a/client/components/users/userAvatar.js b/client/components/users/userAvatar.js index 1066c632..be7a85d2 100644 --- a/client/components/users/userAvatar.js +++ b/client/components/users/userAvatar.js @@ -1,5 +1,3 @@ -Meteor.subscribe('my-avatars'); - Template.userAvatar.helpers({ userData() { // We need to handle a special case for the search results provided by the @@ -54,6 +52,8 @@ Template.userAvatarInitials.helpers({ BlazeComponent.extendComponent({ onCreated() { this.error = new ReactiveVar(''); + + Meteor.subscribe('my-avatars'); }, avatarUrlOptions() { diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js index 481b13c3..f8a1c8b7 100644 --- a/client/components/users/userHeader.js +++ b/client/components/users/userHeader.js @@ -35,10 +35,12 @@ Template.editProfilePopup.events({ const email = tpl.find('.js-profile-email').value.trim(); let isChangeUserName = false; let isChangeEmail = false; - Users.update(Meteor.userId(), {$set: { - 'profile.fullname': fullname, - 'profile.initials': initials, - }}); + Users.update(Meteor.userId(), { + $set: { + 'profile.fullname': fullname, + 'profile.initials': initials, + }, + }); isChangeUserName = username !== Meteor.user().username; isChangeEmail = email.toLowerCase() !== Meteor.user().emails[0].address.toLowerCase(); if (isChangeUserName && isChangeEmail) { |