summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
Diffstat (limited to 'client/components')
-rw-r--r--client/components/boards/boardBody.js7
-rw-r--r--client/components/boards/boardsList.jade5
-rw-r--r--client/components/cards/cardDetails.js20
-rwxr-xr-xclient/components/main/editor.js5
-rw-r--r--client/components/main/layouts.jade1
-rw-r--r--client/components/main/layouts.js41
-rw-r--r--client/components/settings/connectionMethod.jade6
-rw-r--r--client/components/settings/connectionMethod.js34
8 files changed, 113 insertions, 6 deletions
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js
index b68c9b12..ccbd0f23 100644
--- a/client/components/boards/boardBody.js
+++ b/client/components/boards/boardBody.js
@@ -147,6 +147,13 @@ BlazeComponent.extendComponent({
});
},
+ scrollTop(position = 0) {
+ const swimlanes = this.$('.js-swimlanes');
+ swimlanes && swimlanes.animate({
+ scrollTop: position,
+ });
+ },
+
}).register('boardBody');
BlazeComponent.extendComponent({
diff --git a/client/components/boards/boardsList.jade b/client/components/boards/boardsList.jade
index 95ce3678..89852570 100644
--- a/client/components/boards/boardsList.jade
+++ b/client/components/boards/boardsList.jade
@@ -1,6 +1,8 @@
template(name="boardList")
.wrapper
ul.board-list.clearfix
+ li.js-add-board
+ a.board-list-item.label {{_ 'add-board'}}
each boards
li(class="{{#if isStarred}}starred{{/if}}" class=colorClass)
if isInvited
@@ -27,9 +29,6 @@ template(name="boardList")
title="{{#if hasOvertimeCards}}{{_ 'has-overtime-cards'}}{{else}}{{_ 'has-spenttime-cards'}}{{/if}}")
p.board-list-item-desc= description
- li.js-add-board
- a.board-list-item.label {{_ 'add-board'}}
-
template(name="boardListHeaderBar")
h1 {{_ 'my-boards'}}
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 2cd399c1..da0f126a 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -69,6 +69,20 @@ BlazeComponent.extendComponent({
if (offset) {
bodyBoardComponent.scrollLeft(cardContainerScroll + offset);
}
+
+ //Scroll top
+ const cardViewStartTop = $cardView.offset().top;
+ const cardContainerScrollTop = $cardContainer.scrollTop();
+ let topOffset = false;
+ if(cardViewStartTop < 0){
+ topOffset = 0;
+ } else if(cardViewStartTop - cardContainerScrollTop > 100) {
+ topOffset = cardViewStartTop - cardContainerScrollTop - 100;
+ }
+ if(topOffset !== false) {
+ bodyBoardComponent.scrollTop(topOffset);
+ }
+
},
presentParentTask() {
@@ -96,7 +110,11 @@ BlazeComponent.extendComponent({
},
onRendered() {
- if (!Utils.isMiniScreen()) this.scrollParentContainer();
+ if (!Utils.isMiniScreen()) {
+ Meteor.setTimeout(() => {
+ this.scrollParentContainer();
+ }, 500);
+ }
const $checklistsDom = this.$('.card-checklist-items');
$checklistsDom.sortable({
diff --git a/client/components/main/editor.js b/client/components/main/editor.js
index 888fbe00..20ece562 100755
--- a/client/components/main/editor.js
+++ b/client/components/main/editor.js
@@ -38,7 +38,10 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() {
const view = this;
const currentBoard = Boards.findOne(Session.get('currentBoard'));
const knowedUsers = currentBoard.members.map((member) => {
- member.username = Users.findOne(member.userId).username;
+ const u = Users.findOne(member.userId);
+ if(u){
+ member.username = u.username;
+ }
return member;
});
const mentionRegex = /\B@([\w.]*)/gi;
diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade
index ac7da3af..68876dc5 100644
--- a/client/components/main/layouts.jade
+++ b/client/components/main/layouts.jade
@@ -18,6 +18,7 @@ template(name="userFormsLayout")
img(src="{{pathFor '/wekan-logo.png'}}" alt="Wekan")
section.auth-dialog
+Template.dynamic(template=content)
+ +connectionMethod
if isCas
.at-form
button#cas(class='at-btn submit' type='submit') {{casSignInLabel}}
diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js
index 6d6e616d..1d3c3690 100644
--- a/client/components/main/layouts.js
+++ b/client/components/main/layouts.js
@@ -39,7 +39,7 @@ Template.userFormsLayout.helpers({
const curLang = T9n.getLanguage() || 'en';
return t9nTag === curLang;
},
-
+/*
isCas() {
return Meteor.settings.public &&
Meteor.settings.public.cas &&
@@ -49,6 +49,7 @@ Template.userFormsLayout.helpers({
casSignInLabel() {
return TAPi18n.__('casSignIn', {}, T9n.getLanguage() || 'en');
},
+*/
});
Template.userFormsLayout.events({
@@ -64,6 +65,44 @@ Template.userFormsLayout.events({
}
});
},
+ 'submit form'(event) {
+ const connectionMethod = $('.select-connection').val();
+
+ // Local account
+ if (connectionMethod === 'default') {
+ return;
+ }
+
+ // TODO : find a way to block "submit #at-pwd-form" of the at_pwd_form.js
+
+ const inputs = event.target.getElementsByTagName('input');
+
+ const email = inputs.namedItem('at-field-username_and_email').value;
+ const password = inputs.namedItem('at-field-password').value;
+
+ // Ldap account
+ if (connectionMethod === 'ldap') {
+ // Check if the user can use the ldap connection
+ Meteor.subscribe('user-connection-method', email, {
+ onReady() {
+ const ldap = Users.findOne();
+
+ if (ldap) {
+ // Use the ldap connection package
+ Meteor.loginWithLDAP(email, password, function(error) {
+ if (!error) {
+ // Connection
+ return FlowRouter.go('/');
+ } else {
+ return error;
+ }
+ });
+ }
+ return this.stop();
+ },
+ });
+ }
+ },
});
Template.defaultLayout.events({
diff --git a/client/components/settings/connectionMethod.jade b/client/components/settings/connectionMethod.jade
new file mode 100644
index 00000000..598dd9dd
--- /dev/null
+++ b/client/components/settings/connectionMethod.jade
@@ -0,0 +1,6 @@
+template(name='connectionMethod')
+ div.at-form-connection
+ label Authentication method
+ select.select-connection
+ each connections
+ option(value="{{value}}") {{_ value}}
diff --git a/client/components/settings/connectionMethod.js b/client/components/settings/connectionMethod.js
new file mode 100644
index 00000000..4983a3ef
--- /dev/null
+++ b/client/components/settings/connectionMethod.js
@@ -0,0 +1,34 @@
+Template.connectionMethod.onCreated(function() {
+ this.connectionMethods = new ReactiveVar([]);
+
+ Meteor.call('getConnectionsEnabled', (_, result) => {
+ if (result) {
+ // TODO : add a management of different languages
+ // (ex {value: ldap, text: TAPi18n.__('ldap', {}, T9n.getLanguage() || 'en')})
+ this.connectionMethods.set([
+ {value: 'default'},
+ // Gets only the connection methods availables
+ ...Object.entries(result).filter((e) => e[1]).map((e) => ({value: e[0]})),
+ ]);
+ }
+
+ // If only the default authentication available, hides the select boxe
+ const content = $('.at-form-connection');
+ if (!(this.connectionMethods.get().length > 1)) {
+ content.hide();
+ } else {
+ content.show();
+ }
+ });
+});
+
+Template.connectionMethod.onRendered(() => {
+ // Moves the select boxe in the first place of the at-pwd-form div
+ $('.at-form-connection').detach().prependTo('.at-pwd-form');
+});
+
+Template.connectionMethod.helpers({
+ connections() {
+ return Template.instance().connectionMethods.get();
+ },
+});