summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
Diffstat (limited to 'client/components')
-rw-r--r--client/components/activities/activities.js2
-rw-r--r--client/components/boards/boardBody.js1
-rw-r--r--client/components/boards/boardBody.styl78
-rw-r--r--client/components/boards/boardColors.styl1
-rw-r--r--client/components/cards/cardDetails.styl4
-rw-r--r--client/components/cards/checklists.styl3
-rw-r--r--client/components/cards/labels.styl3
-rw-r--r--client/components/cards/minicard.styl11
-rw-r--r--client/components/import/import.js22
-rw-r--r--client/components/lists/listBody.js31
-rw-r--r--client/components/main/layouts.styl2
-rw-r--r--client/components/settings/peopleBody.js4
-rw-r--r--client/components/settings/settingBody.jade8
-rw-r--r--client/components/settings/settingBody.js3
-rw-r--r--client/components/sidebar/sidebar.jade36
-rw-r--r--client/components/sidebar/sidebar.js86
16 files changed, 225 insertions, 70 deletions
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js
index 05149826..b082273a 100644
--- a/client/components/activities/activities.js
+++ b/client/components/activities/activities.js
@@ -85,7 +85,7 @@ BlazeComponent.extendComponent({
const lastLabel = Boards.findOne(Session.get('currentBoard')).getLabelById(
lastLabelId,
);
- if (lastLabel.name === undefined || lastLabel.name === '') {
+ if (lastLabel && (lastLabel.name === undefined || lastLabel.name === '')) {
return lastLabel.color;
} else {
return lastLabel.name;
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js
index 6cff5ab1..07cd306a 100644
--- a/client/components/boards/boardBody.js
+++ b/client/components/boards/boardBody.js
@@ -326,6 +326,7 @@ BlazeComponent.extendComponent({
slug: currentBoard.slug,
cardId: card._id,
}),
+ className: card.color ? `calendar-event-${card.color}` : null,
});
});
callback(events);
diff --git a/client/components/boards/boardBody.styl b/client/components/boards/boardBody.styl
index dfaaa050..32207d82 100644
--- a/client/components/boards/boardBody.styl
+++ b/client/components/boards/boardBody.styl
@@ -53,3 +53,81 @@ position()
padding: 0 0px 0px 0
overflow-x: hidden
overflow-y: auto
+
+calendar-event-color(background, borderColor, color...)
+ background: background !important
+ border-color: borderColor
+ if color
+ color: color !important //overwrite text for better visibility
+
+.calendar-event-green
+ calendar-event-color(#3cb500, #2a8000, #ffffff) //White text for better visibility
+
+.calendar-event-yellow
+ calendar-event-color(#fad900, #c7ac00, #000) //Black text for better visibility
+
+.calendar-event-orange
+ calendar-event-color(#ff9f19, #cc7c14, #000) //Black text for better visibility
+
+.calendar-event-red
+ calendar-event-color(#eb4646, #b83737, #ffffff) //White text for better visibility
+
+.calendar-event-purple
+ calendar-event-color(#a632db, #7d26a6, #ffffff) //White text for better visibility
+
+.calendar-event-blue
+ calendar-event-color(#0079bf, #005a8a, #ffffff) //White text for better visibility
+
+.calendar-event-pink
+ calendar-event-color(#ff78cb, #cc62a3, #000) //Black text for better visibility
+
+.calendar-event-sky
+ calendar-event-color(#00c2e0, #0094ab, #ffffff) //White text for better visibility
+
+.calendar-event-black
+ calendar-event-color(#4d4d4d, #1a1a1a, #ffffff) //White text for better visibility
+
+.calendar-event-lime
+ calendar-event-color(#51e898, #3eb375, #000) //Black text for better visibility
+
+.calendar-event-silver
+ calendar-event-color(#c0c0c0, #8c8c8c, #000) //Black text for better visibility
+
+.calendar-event-peachpuff
+ calendar-event-color(#ffdab9, #ccaf95, #000) //Black text for better visibility
+
+.calendar-event-crimson
+ calendar-event-color(#dc143c, #a8112f, #ffffff) //White text for better visibility
+
+.calendar-event-plum
+ calendar-event-color(#dda0dd, #a87ba8, #000) //Black text for better visibility
+
+.calendar-event-darkgreen
+ calendar-event-color(#006400, #003000, #ffffff) //White text for better visibility
+
+.calendar-event-slateblue
+ calendar-event-color(#6a5acd, #4f4399, #ffffff) //White text for better visibility
+
+.calendar-event-magenta
+ calendar-event-color(#ff00ff, #cc00cc, #ffffff) //White text for better visibility
+
+.calendar-event-gold
+ calendar-event-color(#ffd700, #ccaa00, #000) //Black text for better visibility
+
+.calendar-event-navy
+ calendar-event-color(#000080, #000033, #ffffff) //White text for better visibility
+
+.calendar-event-gray
+ calendar-event-color(#808080, #333333, #ffffff) //White text for better visibility
+
+.calendar-event-saddlebrown
+ calendar-event-color(#8b4513, #572b0c, #ffffff) //White text for better visibility
+
+.calendar-event-paleturquoise
+ calendar-event-color(#afeeee, #8ababa, #000) //Black text for better visibility
+
+.calendar-event-mistyrose
+ calendar-event-color(#ffe4e1, #ccb8b6, #000) //Black text for better visibility
+
+.calendar-event-indigo
+ calendar-event-color(#4b0082, #2b004d, #ffffff) //White text for better visibility
diff --git a/client/components/boards/boardColors.styl b/client/components/boards/boardColors.styl
index efd4367e..3be9c0c3 100644
--- a/client/components/boards/boardColors.styl
+++ b/client/components/boards/boardColors.styl
@@ -241,6 +241,7 @@ setBoardColor(color)
background-color #ffffff !important
padding 15px !important
border 1px solid #000000 !important
+ word-wrap: break-word
// When card has comment, emphasis on minicard:
// bigger red comment icon and number of comments,
diff --git a/client/components/cards/cardDetails.styl b/client/components/cards/cardDetails.styl
index 4bba2d4d..cd475072 100644
--- a/client/components/cards/cardDetails.styl
+++ b/client/components/cards/cardDetails.styl
@@ -99,7 +99,9 @@
&.card-details-item-end,
&.card-details-item-customfield,
&.card-details-item-name
- max-width: 50%
+ display: block
+ word-wrap: break-word
+ max-width: 48%
flex-grow: 1
.card-details-item-title
diff --git a/client/components/cards/checklists.styl b/client/components/cards/checklists.styl
index d48c1851..8ac37a15 100644
--- a/client/components/cards/checklists.styl
+++ b/client/components/cards/checklists.styl
@@ -128,6 +128,9 @@ textarea.js-add-checklist-item, textarea.js-edit-checklist-item
& .viewer
p
margin-bottom: 2px
+ display: block
+ word-wrap: break-word
+ max-width: 420px
.js-delete-checklist-item
margin: 0 0 0.5em 1.33em
diff --git a/client/components/cards/labels.styl b/client/components/cards/labels.styl
index 3b481d93..9d7c7553 100644
--- a/client/components/cards/labels.styl
+++ b/client/components/cards/labels.styl
@@ -10,9 +10,10 @@
margin-right: 4px
margin-bottom: 5px
padding: 3px 8px
- max-width: 100%
+ max-width: 210px
min-width: 8px
overflow: ellipsis
+ word-wrap: break-word
height: 18px
vertical-align: bottom
diff --git a/client/components/cards/minicard.styl b/client/components/cards/minicard.styl
index f0bb0b39..c4172572 100644
--- a/client/components/cards/minicard.styl
+++ b/client/components/cards/minicard.styl
@@ -93,8 +93,11 @@
.minicard-custom-field
display:flex;
.minicard-custom-field-item
- max-width:50%;
- flex-grow:1;
+ flex-grow: 1
+ display: block
+ word-wrap: break-word
+ max-width: 100px
+ margin-right: 4px
.handle
width: 20px;
height: 20px;
@@ -112,7 +115,9 @@
p:last-child
margin-bottom: 0
.viewer
- display: inline-block
+ display: block
+ word-wrap: break-word
+ max-width: 230px
.dates
display: flex;
flex-direction: row;
diff --git a/client/components/import/import.js b/client/components/import/import.js
index 62c7e525..6368885b 100644
--- a/client/components/import/import.js
+++ b/client/components/import/import.js
@@ -211,22 +211,20 @@ BlazeComponent.extendComponent({
this.parentComponent().nextStep();
},
- onMapMember(evt) {
- const memberToMap = this.currentData();
- if (memberToMap.wekan) {
- // todo xxx ask for confirmation?
- this.unmapMember(memberToMap.id);
- } else {
- this.setSelectedMember(memberToMap.id);
- Popup.open('importMapMembersAdd')(evt);
- }
- },
-
events() {
return [
{
submit: this.onSubmit,
- 'click .js-select-member': this.onMapMember,
+ 'click .js-select-member'(evt) {
+ const memberToMap = this.currentData();
+ if (memberToMap.wekan) {
+ // todo xxx ask for confirmation?
+ this.unmapMember(memberToMap.id);
+ } else {
+ this.setSelectedMember(memberToMap.id);
+ Popup.open('importMapMembersAdd')(evt);
+ }
+ },
},
];
},
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index 7d9e358b..c8e41a0b 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -701,12 +701,31 @@ BlazeComponent.extendComponent({
this.listId = this.parentComponent().data()._id;
this.swimlaneId = '';
- const boardView = (Meteor.user().profile || {}).boardView;
- if (boardView === 'board-view-swimlanes')
- this.swimlaneId = this.parentComponent()
- .parentComponent()
- .parentComponent()
- .data()._id;
+ const isSandstorm =
+ Meteor.settings &&
+ Meteor.settings.public &&
+ Meteor.settings.public.sandstorm;
+
+ if (isSandstorm) {
+ const user = Meteor.user();
+ if (user) {
+ const boardView = (Meteor.user().profile || {}).boardView;
+ if (boardView === 'board-view-swimlanes') {
+ this.swimlaneId = this.parentComponent()
+ .parentComponent()
+ .parentComponent()
+ .data()._id;
+ }
+ }
+ } else {
+ const boardView = (Meteor.user().profile || {}).boardView;
+ if (boardView === 'board-view-swimlanes') {
+ this.swimlaneId = this.parentComponent()
+ .parentComponent()
+ .parentComponent()
+ .data()._id;
+ }
+ }
},
onRendered() {
diff --git a/client/components/main/layouts.styl b/client/components/main/layouts.styl
index 0955a352..56c35284 100644
--- a/client/components/main/layouts.styl
+++ b/client/components/main/layouts.styl
@@ -378,6 +378,8 @@ a
.viewer
min-height: 18px
+ display: block
+ word-wrap: break-word
ol
list-style-type: decimal
diff --git a/client/components/settings/peopleBody.js b/client/components/settings/peopleBody.js
index a9f2247c..8610034e 100644
--- a/client/components/settings/peopleBody.js
+++ b/client/components/settings/peopleBody.js
@@ -17,7 +17,7 @@ BlazeComponent.extendComponent({
this.autorun(() => {
const limit = this.page.get() * usersPerPage;
- this.subscribe('people', limit, () => {
+ this.subscribe('people', this.findUsersOptions.get(), limit, () => {
this.loadNextPageLocked = false;
const nextPeakBefore = this.callFirstWith(null, 'getNextPeak');
this.calculateNextPeak();
@@ -85,7 +85,7 @@ BlazeComponent.extendComponent({
const users = Users.find(this.findUsersOptions.get(), {
fields: { _id: true },
});
- this.number.set(users.count());
+ this.number.set(users.count(false));
return users;
},
peopleNumber() {
diff --git a/client/components/settings/settingBody.jade b/client/components/settings/settingBody.jade
index 8eb584dc..04b635e8 100644
--- a/client/components/settings/settingBody.jade
+++ b/client/components/settings/settingBody.jade
@@ -18,6 +18,8 @@ template(name="setting")
a.js-setting-menu(data-id="announcement-setting") {{_ 'admin-announcement'}}
li
a.js-setting-menu(data-id="layout-setting") {{_ 'layout'}}
+ li
+ a.js-setting-menu(data-id="webhook-setting") {{_ 'global-webhook'}}
.main-body
if loading.get
+spinner
@@ -31,6 +33,12 @@ template(name="setting")
+announcementSettings
else if layoutSetting.get
+layoutSettings
+ else if webhookSetting.get
+ +webhookSettings
+
+template(name="webhookSettings")
+ span
+ +outgoingWebhooksPopup
template(name="general")
ul#registration-setting.setting-detail
diff --git a/client/components/settings/settingBody.js b/client/components/settings/settingBody.js
index f9b5c08d..4ff5aedd 100644
--- a/client/components/settings/settingBody.js
+++ b/client/components/settings/settingBody.js
@@ -7,11 +7,13 @@ BlazeComponent.extendComponent({
this.accountSetting = new ReactiveVar(false);
this.announcementSetting = new ReactiveVar(false);
this.layoutSetting = new ReactiveVar(false);
+ this.webhookSetting = new ReactiveVar(false);
Meteor.subscribe('setting');
Meteor.subscribe('mailServer');
Meteor.subscribe('accountSettings');
Meteor.subscribe('announcements');
+ Meteor.subscribe('globalwebhooks');
},
setError(error) {
@@ -83,6 +85,7 @@ BlazeComponent.extendComponent({
this.accountSetting.set('account-setting' === targetID);
this.announcementSetting.set('announcement-setting' === targetID);
this.layoutSetting.set('layout-setting' === targetID);
+ this.webhookSetting.set('webhook-setting' === targetID);
}
},
diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade
index 2dfe41b3..ccfadc0c 100644
--- a/client/components/sidebar/sidebar.jade
+++ b/client/components/sidebar/sidebar.jade
@@ -135,22 +135,30 @@ template(name="archiveBoardPopup")
template(name="outgoingWebhooksPopup")
each integrations
form.integration-form
- if title
- h4 {{title}}
- else
- h4 {{_ 'no-name'}}
- label
- | URL
- input.js-outgoing-webhooks-url(type="text" name="url" value=url)
- input(type="hidden" value=_id name="id")
+ a.flex
+ span {{_ 'disable-webhook'}}
+ b  
+ .materialCheckBox(class="{{#unless enabled}}is-checked{{/unless}}")
+ input.js-outgoing-webhooks-title(placeholder="{{_ 'webhook-title'}}" type="text" name="title" value=title)
+ input.js-outgoing-webhooks-url(type="text" name="url" value=url autofocus)
+ input.js-outgoing-webhooks-token(placeholder="{{_ 'webhook-token' }}" type="text" value=token name="token")
+ select.js-outgoing-webhooks-type(name="type")
+ each _type in types
+ if($eq _type this.type)
+ option(value=_type selected="selected") {{_ _type}}
+ else
+ option(value=_type) {{_ _type}}
+ input(type="hidden" value=this.type name="_type")
+ input(type="hidden" value=_id name="id")
input.primary.wide(type="submit" value="{{_ 'save'}}")
form.integration-form
- h4
- | {{_ 'new-outgoing-webhook'}}
- label
- | URL
- input.js-outgoing-webhooks-url(type="text" name="url" autofocus)
- input.primary.wide(type="submit" value="{{_ 'save'}}")
+ input.js-outgoing-webhooks-title(placeholder="{{_ 'webhook-title'}}" type="text" name="title" autofocus)
+ input.js-outgoing-webhooks-url(placeholder="{{_ 'URL' }}" type="text" name="url")
+ input.js-outgoing-webhooks-token(placeholder="{{_ 'webhook-token' }}" type="text" name="token")
+ select.js-outgoing-webhooks-type(name="type")
+ each _type in types
+ option(value=_type) {{_ _type}}
+ input.primary.wide(type="submit" value="{{_ 'create'}}")
template(name="boardMenuPopup")
ul.pop-over-list
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index f7efb1e8..f1ccfb1e 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -1,6 +1,8 @@
Sidebar = null;
const defaultView = 'home';
+const MCB = '.materialCheckBox';
+const CKCLS = 'is-checked';
const viewTitles = {
filter: 'filter-cards',
@@ -280,44 +282,71 @@ Template.membersWidget.events({
});
BlazeComponent.extendComponent({
+ boardId() {
+ return Session.get('currentBoard') || Integrations.Const.GLOBAL_WEBHOOK_ID;
+ },
integrations() {
- const boardId = Session.get('currentBoard');
+ const boardId = this.boardId();
return Integrations.find({ boardId: `${boardId}` }).fetch();
},
-
- integration(id) {
- const boardId = Session.get('currentBoard');
- return Integrations.findOne({ _id: id, boardId: `${boardId}` });
+ types() {
+ return Integrations.Const.WEBHOOK_TYPES;
+ },
+ integration(cond) {
+ const boardId = this.boardId();
+ const condition = { boardId, ...cond };
+ for (const k in condition) {
+ if (!condition[k]) delete condition[k];
+ }
+ return Integrations.findOne(condition);
+ },
+ onCreated() {
+ this.disabled = new ReactiveVar(false);
},
-
events() {
return [
{
+ 'click a.flex'(evt) {
+ this.disabled.set(!this.disabled.get());
+ $(evt.target).toggleClass(CKCLS, this.disabled.get());
+ },
submit(evt) {
evt.preventDefault();
const url = evt.target.url.value;
- const boardId = Session.get('currentBoard');
+ const boardId = this.boardId();
let id = null;
let integration = null;
+ const title = evt.target.title.value;
+ const token = evt.target.token.value;
+ const type = evt.target.type.value;
+ const enabled = !this.disabled.get();
+ let remove = false;
+ const values = {
+ url,
+ type,
+ token,
+ title,
+ enabled,
+ };
if (evt.target.id) {
id = evt.target.id.value;
- integration = this.integration(id);
- if (url) {
- Integrations.update(integration._id, {
- $set: {
- url: `${url}`,
- },
- });
- } else {
- Integrations.remove(integration._id);
- }
+ integration = this.integration({ _id: id });
+ remove = !url;
+ } else if (url) {
+ integration = this.integration({ url, token });
+ }
+ if (remove) {
+ Integrations.remove(integration._id);
+ } else if (integration && integration._id) {
+ Integrations.update(integration._id, {
+ $set: values,
+ });
} else if (url) {
Integrations.insert({
+ ...values,
userId: Meteor.userId(),
enabled: true,
- type: 'outgoing-webhooks',
- url: `${url}`,
- boardId: `${boardId}`,
+ boardId,
activities: ['all'],
});
}
@@ -474,12 +503,12 @@ BlazeComponent.extendComponent({
evt.preventDefault();
this.currentBoard.allowsSubtasks = !this.currentBoard.allowsSubtasks;
this.currentBoard.setAllowsSubtasks(this.currentBoard.allowsSubtasks);
- $('.js-field-has-subtasks .materialCheckBox').toggleClass(
- 'is-checked',
+ $(`.js-field-has-subtasks ${MCB}`).toggleClass(
+ CKCLS,
this.currentBoard.allowsSubtasks,
);
$('.js-field-has-subtasks').toggleClass(
- 'is-checked',
+ CKCLS,
this.currentBoard.allowsSubtasks,
);
$('.js-field-deposit-board').prop(
@@ -515,15 +544,12 @@ BlazeComponent.extendComponent({
];
options.forEach(function(element) {
if (element !== value) {
- $(`#${element} .materialCheckBox`).toggleClass(
- 'is-checked',
- false,
- );
- $(`#${element}`).toggleClass('is-checked', false);
+ $(`#${element} ${MCB}`).toggleClass(CKCLS, false);
+ $(`#${element}`).toggleClass(CKCLS, false);
}
});
- $(`#${value} .materialCheckBox`).toggleClass('is-checked', true);
- $(`#${value}`).toggleClass('is-checked', true);
+ $(`#${value} ${MCB}`).toggleClass(CKCLS, true);
+ $(`#${value}`).toggleClass(CKCLS, true);
this.currentBoard.setPresentParentTask(value);
evt.preventDefault();
},