summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorSam X. Chen <sam.xi.chen@gmail.com>2019-08-29 22:08:41 -0400
committerSam X. Chen <sam.xi.chen@gmail.com>2019-08-29 22:08:41 -0400
commit58155288fb27e0486f298b00798a550516d4d0ef (patch)
tree122b069c26cb41c4e607b462669033139282d2a9 /client
parentdd0682328bc26bbe852fb19a85131e4017c547b0 (diff)
parentd1ab787215adb83064a5be4678e7073ba71fbb22 (diff)
downloadwekan-58155288fb27e0486f298b00798a550516d4d0ef.tar.gz
wekan-58155288fb27e0486f298b00798a550516d4d0ef.tar.bz2
wekan-58155288fb27e0486f298b00798a550516d4d0ef.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'client')
-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.styl12
-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/sidebar/sidebarArchives.js2
-rw-r--r--client/components/sidebar/sidebarFilters.jade16
-rw-r--r--client/components/sidebar/sidebarFilters.js19
-rw-r--r--client/components/swimlanes/swimlanes.jade3
-rw-r--r--client/components/swimlanes/swimlanes.js18
-rw-r--r--client/lib/filter.js4
-rw-r--r--client/lib/popup.js2
18 files changed, 196 insertions, 27 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 242367b4..c4172572 100644
--- a/client/components/cards/minicard.styl
+++ b/client/components/cards/minicard.styl
@@ -81,6 +81,7 @@
.minicard-labels
float: right
display: flex
+ flex-wrap: wrap
.minicard-label
width: 11px
@@ -92,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;
@@ -111,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/sidebar/sidebarArchives.js b/client/components/sidebar/sidebarArchives.js
index 53fc29b9..a4846561 100644
--- a/client/components/sidebar/sidebarArchives.js
+++ b/client/components/sidebar/sidebarArchives.js
@@ -1,3 +1,4 @@
+archivedRequested = false;
const subManager = new SubsManager();
BlazeComponent.extendComponent({
@@ -12,6 +13,7 @@ BlazeComponent.extendComponent({
const currentBoardId = Session.get('currentBoard');
if (!currentBoardId) return;
const handle = subManager.subscribe('board', currentBoardId, true);
+ archivedRequested = true;
Tracker.nonreactive(() => {
Tracker.autorun(() => {
this.isArchiveReady.set(handle.ready());
diff --git a/client/components/sidebar/sidebarFilters.jade b/client/components/sidebar/sidebarFilters.jade
index f11528b1..55ab213a 100644
--- a/client/components/sidebar/sidebarFilters.jade
+++ b/client/components/sidebar/sidebarFilters.jade
@@ -56,6 +56,22 @@ template(name="filterSidebar")
if Filter.customFields.isSelected _id
i.fa.fa-check
hr
+ ul.sidebar-list
+ li(class="{{#if Filter.archive.isSelected _id}}active{{/if}}")
+ a.name.js-toggle-archive-filter
+ span.sidebar-list-item-description
+ | {{_ 'filter-show-archive'}}
+ if Filter.archive.isSelected _id
+ i.fa.fa-check
+ hr
+ ul.sidebar-list
+ li(class="{{#if Filter.hideEmpty.isSelected _id}}active{{/if}}")
+ a.name.js-toggle-hideEmpty-filter
+ span.sidebar-list-item-description
+ | {{_ 'filter-hide-empty'}}
+ if Filter.hideEmpty.isSelected _id
+ i.fa.fa-check
+ hr
span {{_ 'advanced-filter-label'}}
input.js-field-advanced-filter(type="text")
span {{_ 'advanced-filter-description'}}
diff --git a/client/components/sidebar/sidebarFilters.js b/client/components/sidebar/sidebarFilters.js
index 88438a7a..3483d00c 100644
--- a/client/components/sidebar/sidebarFilters.js
+++ b/client/components/sidebar/sidebarFilters.js
@@ -1,3 +1,5 @@
+const subManager = new SubsManager();
+
BlazeComponent.extendComponent({
events() {
return [
@@ -12,6 +14,23 @@ BlazeComponent.extendComponent({
Filter.members.toggle(this.currentData()._id);
Filter.resetExceptions();
},
+ 'click .js-toggle-archive-filter'(evt) {
+ evt.preventDefault();
+ Filter.archive.toggle(this.currentData()._id);
+ Filter.resetExceptions();
+ const currentBoardId = Session.get('currentBoard');
+ if (!currentBoardId) return;
+ subManager.subscribe(
+ 'board',
+ currentBoardId,
+ Filter.archive.isSelected(),
+ );
+ },
+ 'click .js-toggle-hideEmpty-filter'(evt) {
+ evt.preventDefault();
+ Filter.hideEmpty.toggle(this.currentData()._id);
+ Filter.resetExceptions();
+ },
'click .js-toggle-custom-fields-filter'(evt) {
evt.preventDefault();
Filter.customFields.toggle(this.currentData()._id);
diff --git a/client/components/swimlanes/swimlanes.jade b/client/components/swimlanes/swimlanes.jade
index 485b2ffc..3ad43777 100644
--- a/client/components/swimlanes/swimlanes.jade
+++ b/client/components/swimlanes/swimlanes.jade
@@ -33,7 +33,8 @@ template(name="listsGroup")
+addListForm
else
each lists
- +list(this)
+ if visible this
+ +list(this)
if currentCardIsInThisList _id null
+cardDetails(currentCard)
if currentUser.isBoardMember
diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js
index 568c0bbe..e0857003 100644
--- a/client/components/swimlanes/swimlanes.js
+++ b/client/components/swimlanes/swimlanes.js
@@ -246,6 +246,24 @@ BlazeComponent.extendComponent({
currentCardIsInThisList(listId, swimlaneId) {
return currentCardIsInThisList(listId, swimlaneId);
},
+ visible(list) {
+ if (list.archived) {
+ // Show archived list only when filter archive is on or archive is selected
+ if (!(Filter.archive.isSelected() || archivedRequested)) {
+ return false;
+ }
+ }
+ if (Filter.hideEmpty.isSelected()) {
+ const swimlaneId = this.parentComponent()
+ .parentComponent()
+ .data()._id;
+ const cards = list.cards(swimlaneId);
+ if (cards.count() === 0) {
+ return false;
+ }
+ }
+ return true;
+ },
onRendered() {
const boardComponent = this.parentComponent();
const $listsDom = this.$('.js-lists');
diff --git a/client/lib/filter.js b/client/lib/filter.js
index f19dc617..1ca3a280 100644
--- a/client/lib/filter.js
+++ b/client/lib/filter.js
@@ -451,10 +451,12 @@ Filter = {
// before changing the schema.
labelIds: new SetFilter(),
members: new SetFilter(),
+ archive: new SetFilter(),
+ hideEmpty: new SetFilter(),
customFields: new SetFilter('_id'),
advanced: new AdvancedFilter(),
- _fields: ['labelIds', 'members', 'customFields'],
+ _fields: ['labelIds', 'members', 'archive', 'hideEmpty', 'customFields'],
// We don't filter cards that have been added after the last filter change. To
// implement this we keep the id of these cards in this `_exceptions` fields
diff --git a/client/lib/popup.js b/client/lib/popup.js
index 6c294d32..8095fbd2 100644
--- a/client/lib/popup.js
+++ b/client/lib/popup.js
@@ -67,7 +67,7 @@ window.Popup = new (class {
title: self._getTitle(popupName),
depth: self._stack.length,
offset: self._getOffset(openerElement),
- dataContext: (this.currentData && this.currentData()) || this,
+ dataContext: (this && this.currentData && this.currentData()) || this,
});
// If there are no popup currently opened we use the Blaze API to render