Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b05f8e5251 | ||
|
|
31c2afb072 | ||
|
|
863f0fc5db | ||
|
|
055b528532 | ||
|
|
fda392e662 | ||
|
|
e5f9d0a4dd | ||
|
|
3f16bf6054 | ||
|
|
6774b9e905 | ||
|
|
00a38b36a4 | ||
|
|
de365ad62a | ||
|
|
fe631ff75b | ||
|
|
eed649fbe6 | ||
|
|
8ddbc622db | ||
|
|
24b21d23ba | ||
|
|
64fa02cdf5 | ||
|
|
3b50b2c59f | ||
|
|
921460db40 | ||
|
|
4156073b1a | ||
|
|
af7c74b2d3 | ||
|
|
4064f3f406 | ||
|
|
94e47401cb | ||
|
|
5ef83ab236 | ||
|
|
c22eaa26cd | ||
|
|
060b9acd86 | ||
|
|
213b7b4819 | ||
|
|
7a576f9ae4 | ||
|
|
62f06a792f | ||
|
|
1ac11d92ba | ||
|
|
0c299e3225 | ||
|
|
bcc3a39c06 | ||
|
|
13dffca055 | ||
|
|
68ee88a041 | ||
|
|
3718dd4d45 | ||
|
|
506a747fce | ||
|
|
98e255ccec | ||
|
|
45dea737bf | ||
|
|
b80396f627 | ||
|
|
0735981366 | ||
|
|
5d8cca40d2 | ||
|
|
09ce3e464f | ||
|
|
4c5a2fbd1f | ||
|
|
012ca39a8d | ||
|
|
c3458855bd | ||
|
|
cfcc73724f | ||
|
|
4448488767 | ||
|
|
7dc0bbd7b2 | ||
|
|
269698ba78 | ||
|
|
0a1bfd37b3 | ||
|
|
5899b9366c | ||
|
|
4b196d5378 | ||
|
|
b34ed58289 | ||
|
|
617fdaeb74 | ||
|
|
d26bf04bfa | ||
|
|
a365899312 | ||
|
|
6ebd6defe9 | ||
|
|
93337c20f8 | ||
|
|
6cdd464f54 | ||
|
|
3e0bedd8c7 | ||
|
|
4dcdec0084 | ||
|
|
05c53ca01d |
No files matched your search
@@ -98,3 +98,4 @@ percolate:synced-cron
|
||||
easylogic:summernote
|
||||
cfs:filesystem
|
||||
ostrio:cookies
|
||||
ostrio:files
|
||||
@@ -134,6 +134,7 @@ observe-sequence@1.0.16
|
||||
ongoworks:speakingurl@1.1.0
|
||||
ordered-dict@1.1.0
|
||||
ostrio:cookies@2.6.0
|
||||
ostrio:files@1.14.2
|
||||
peerlibrary:assert@0.3.0
|
||||
peerlibrary:base-component@0.16.0
|
||||
peerlibrary:blaze-components@0.15.1
|
||||
|
||||
@@ -1,3 +1,43 @@
|
||||
# v4.04 2020-05-24 Wekan release
|
||||
|
||||
This release adds the following features:
|
||||
|
||||
- [Found Time Tracking GPLv3 software "Titra" with integration to Wekan](https://github.com/wekan/wekan/wiki/Time-Tracking).
|
||||
Thanks to willhseitz.
|
||||
- [Theme: Natural](https://github.com/wekan/wekan/pull/3098).
|
||||
You can select it from Board Settings / Change color / natural.
|
||||
Thanks to compumatter and helioguardabaxo.
|
||||
- [Theme: Modern](https://github.com/wekan/wekan/pull/3106).
|
||||
Thanks to jeroenstoker com and helioguardabaxo.
|
||||
- [Export board to HTML static page .zip archive](https://github.com/wekan/wekan/pull/3043).
|
||||
Thanks to Lewiscowles1986.
|
||||
|
||||
and fixes the following bugs:
|
||||
|
||||
- [Change the swimlaneid of a card only if a new target swimlaneid is selected](https://github.com/wekan/wekan/pull/3108).
|
||||
Thanks to marc1006.
|
||||
- [Set '*' as default value for swimlane and list name in card move action](https://github.com/wekan/wekan/pull/3109).
|
||||
Thanks to hickorysb and marc1006.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v4.03 2020-05-16 Wekan release
|
||||
|
||||
This release adds the following features:
|
||||
|
||||
- [Theme: Clearblue](https://github.com/wekan/wekan/pull/3093).
|
||||
You can select it from Board Settings / Change color / clearblue.
|
||||
Thanks to CidKramer.
|
||||
|
||||
and fixes the following bugs:
|
||||
|
||||
- [Fix Can't Scroll on All Boards on mobile phone. Added drag handles](https://github.com/wekan/wekan/issues/3096).
|
||||
Thanks to xet7.
|
||||
- [Try to fix Sandstorm Wekan Export menu](https://github.com/wekan/wekan/commit/1ac11d92ba8f38981c87db25e5b5e1fa2adb6968).
|
||||
Thanks to xet7.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v4.02 2020-05-15 Wekan release
|
||||
|
||||
This release adds the following server platforms:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
appId: wekan-public/apps/77b94f60-dec9-0136-304e-16ff53095928
|
||||
appVersion: "v4.02.0"
|
||||
appVersion: "v4.04.0"
|
||||
files:
|
||||
userUploads:
|
||||
- README.md
|
||||
|
||||
@@ -152,17 +152,18 @@ BlazeComponent.extendComponent({
|
||||
|
||||
attachmentLink() {
|
||||
const attachment = this.currentData().activity.attachment();
|
||||
const link = attachment.link('original', '/');
|
||||
// trying to display url before file is stored generates js errors
|
||||
return (
|
||||
(attachment &&
|
||||
attachment.url({ download: true }) &&
|
||||
link &&
|
||||
Blaze.toHTML(
|
||||
HTML.A(
|
||||
{
|
||||
href: attachment.url({ download: true }),
|
||||
href: link,
|
||||
target: '_blank',
|
||||
},
|
||||
attachment.name(),
|
||||
attachment.name,
|
||||
),
|
||||
)) ||
|
||||
this.currentData().activity.attachmentName
|
||||
|
||||
@@ -293,3 +293,418 @@ setBoardColor(color)
|
||||
|
||||
//.header-quick-access
|
||||
// backgroud-color: #568ba2
|
||||
|
||||
|
||||
/*
|
||||
Alternate "Clear" Styling
|
||||
*/
|
||||
setBoardClear(color1,color2)
|
||||
//color1: The quick access color
|
||||
//color2: The main bar color
|
||||
|
||||
&.sk-spinner div,
|
||||
.board-backgrounds-list &.background-box,
|
||||
.board-list & a
|
||||
background: linear-gradient(180deg, color1 0%, color2 100%)
|
||||
//background: linear-gradient(180deg, rgb(73, 155, 234) 0%, rgb(0, 174, 204) 100%)
|
||||
|
||||
.is-selected .minicard
|
||||
border-left: 3px solid color1
|
||||
|
||||
&.pop-over .pop-over-list li a:not(.disabled):hover,
|
||||
.sidebar .sidebar-content .sidebar-btn:hover,
|
||||
.sidebar-list li a:hover
|
||||
background-color: lighten(color1, 10%)
|
||||
|
||||
&#header ul li.current, &#header-quick-access ul li.current
|
||||
border-bottom: 4px solid lighten(color2, 10%)
|
||||
|
||||
&#header-quick-access
|
||||
background: darken(color1, 10%)
|
||||
//background: rgba(66,137,204,1)
|
||||
color: #FFF
|
||||
|
||||
&#header-quick-access #header-new-board-icon,
|
||||
&#header-quick-access #header-user-bar,
|
||||
&#header-quick-access ul li
|
||||
color: rgba(255,255,255,0.5)
|
||||
|
||||
// The background-color value here is not seen,
|
||||
// its covered by the background of #header-main-bar
|
||||
// it's just to aid transitions between boards
|
||||
&#header
|
||||
background-color: color2
|
||||
border-bottom: 1px solid darken(color2, 20%)
|
||||
border-top: 1px solid darken(color2, 40%)
|
||||
|
||||
// Since the theme uses a gradient for the header
|
||||
// and gradients break transitions, it has to be set here
|
||||
&#header #header-main-bar
|
||||
background: linear-gradient(180deg, color1 0%, color2 100%)
|
||||
|
||||
&#header #header-main-bar p
|
||||
margin-bottom: 6px
|
||||
|
||||
&#header #header-main-bar .board-header-btn.emphasis
|
||||
background: lighten(color2, 10%)
|
||||
|
||||
&:hover,
|
||||
.board-header-btn-close
|
||||
background: rgba(0,0,0,0.2)
|
||||
|
||||
&:hover .board-header-btn-close
|
||||
background: rgba(0,0,0,0.2)
|
||||
|
||||
.materialCheckBox.is-checked
|
||||
border-bottom: 2px solid color1
|
||||
border-right: 2px solid color1
|
||||
|
||||
.is-multiselection-active .multi-selection-checkbox
|
||||
&.is-checked + .minicard
|
||||
background: lighten(color2, 90%)
|
||||
|
||||
&:not(.is-checked) + .minicard:hover:not(.minicard-composer)
|
||||
background: lighten(color2, 97%)
|
||||
|
||||
.toggle-switch:checked ~ .toggle-label
|
||||
background-color: lighten(color1, 20%)
|
||||
|
||||
&:after
|
||||
background-color: darken(color1, 20%)
|
||||
|
||||
.board-canvas
|
||||
background: linear-gradient(135deg, color1 0%, color2 100%)
|
||||
|
||||
.swimlane
|
||||
background: none
|
||||
|
||||
.list:first-child
|
||||
margin-left: 15px
|
||||
|
||||
.list
|
||||
background: rgba(255,255,255,0.35)
|
||||
margin: 10px
|
||||
border: 0
|
||||
border-radius: 14px
|
||||
|
||||
.list.list-composer
|
||||
background: rgba(255,255,255,0.1)
|
||||
height: min-content
|
||||
flex: unset
|
||||
width: 270px
|
||||
padding-bottom: 16px
|
||||
|
||||
.list.list-composer .open-list-composer
|
||||
border-radius: 7px
|
||||
color: rgba(0,0,0,0.3)
|
||||
padding: 7px 10px
|
||||
display: block
|
||||
|
||||
.list.list-composer .open-list-composer:hover
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.2)
|
||||
background: rgba(255,255,255,0.7)
|
||||
color: rgba(0,0,0,0.6)
|
||||
|
||||
.list-header
|
||||
background-color: rgba(255,255,255,0.25)
|
||||
border-radius: 14px 14px 0 0
|
||||
|
||||
.list-header:not([class*="list-header-"])
|
||||
border-bottom: 6px solid rgba(255,255,255,0)
|
||||
|
||||
.list-header .list-header-name
|
||||
color: rgba(0,0,0,0.6)
|
||||
|
||||
.list-body
|
||||
padding: 11px
|
||||
|
||||
.minicard
|
||||
border-radius: 7px
|
||||
padding: 10px 10px 4px 10px
|
||||
box-shadow: 2px 2px 4px 0px rgba(0,0,0,0.15)
|
||||
color: #222
|
||||
|
||||
.card-details
|
||||
border-radius: 0 0 14px 14px
|
||||
box-shadow: 0 0 7px 0 rgba(0,0,0,0.5)
|
||||
margin-left: -10px
|
||||
|
||||
.list-body .open-minicard-composer
|
||||
border-radius: 7px
|
||||
color: rgba(0,0,0,.3)
|
||||
margin-bottom: 11px
|
||||
|
||||
.list-body .open-minicard-composer:hover
|
||||
background: rgba(255,255,255,0.7)
|
||||
color: rgba(0,0,0,0.6)
|
||||
|
||||
button[type=submit].primary, input[type=submit].primary
|
||||
box-shadow: none
|
||||
background-color: rgba(255,255,255,0.5)
|
||||
color: rgba(0,0,0,0.55)
|
||||
border-radius: 7px
|
||||
border: 0
|
||||
|
||||
button[type="submit"].primary:hover, input[type="submit"].primary:hover
|
||||
background-color: rgba(255,255,255,0.7)
|
||||
color: rgba(0,0,0,0.8)
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.2)
|
||||
|
||||
.quiet, .quiet a
|
||||
color: rgba(0,0,0,0.4)
|
||||
|
||||
.list-header .list-header-watch-icon
|
||||
color: rgba(0,0,0,0.5)
|
||||
position: absolute
|
||||
margin-top: -34px
|
||||
margin-let: -11px
|
||||
|
||||
a.fa, a i.fa
|
||||
color: rgba(0,0,0,0.3)
|
||||
|
||||
a:not(.disabled).is-active.fa, a:not(.disabled).is-active i.fa, a:not(.disabled):hover.fa, a:not(.disabled):hover i.fa
|
||||
color: rgba(0,0,0,0.6)
|
||||
|
||||
input[type="email"], input[type="password"], input[type="text"]
|
||||
border: 0
|
||||
border-radius: 7px
|
||||
|
||||
.sidebar-shadow
|
||||
box-shadow: none
|
||||
border-left: 9px solid color2
|
||||
|
||||
.is-open .sidebar-shadow
|
||||
box-shadow: -10px 0 8px rgba(0,0,0,0.3)
|
||||
|
||||
.list.ui-sortable-helper
|
||||
transform:rotate(0deg)
|
||||
|
||||
.minicard-wrapper.placeholder
|
||||
background: rgba(0,0,0,0.1)
|
||||
|
||||
.minicard-wrapper.ui-sortable-helper
|
||||
transform:rotate(0deg)
|
||||
opacity: 0.8
|
||||
|
||||
.list-body .open-minicard-composer
|
||||
color: rgba(0,0,0,.3)
|
||||
|
||||
.swinlane.ui-sortable-helper
|
||||
transform:rotate(0deg)
|
||||
|
||||
.swimlane .swimlane-header-wrap
|
||||
background: linear-gradient(0deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.25) 100%)
|
||||
|
||||
.swimlane-header-wrap .inlined-form
|
||||
width: 100%
|
||||
|
||||
.swimlane-header-wrap .list-composer
|
||||
text-align: center
|
||||
margin: 5px
|
||||
|
||||
.swimlane-header-wrap .list-name-input.full-line
|
||||
margin: 0
|
||||
display: inline-block
|
||||
width: 270px
|
||||
|
||||
.swimlane-header-wrap .edit-controls
|
||||
display: inline-block
|
||||
vertical-align: middle
|
||||
|
||||
.swimlane-header-wrap .primary.confirm
|
||||
margin-right: 0
|
||||
|
||||
.swimlane-header-wrap .fa.fa-times-thin
|
||||
margin-top: 2px
|
||||
|
||||
// This is a general fix so that the little grabby hand appears when dragging the list via the title
|
||||
.list.ui-sortable-helper,
|
||||
.list.ui-sortable-helper .list-header.ui-sortable-handle,
|
||||
.list.ui-sortable-helper .viewer
|
||||
cursor:-webkit-grabbing;
|
||||
cursor:grabbing
|
||||
|
||||
.board-color-clearblue
|
||||
setBoardClear(rgb(73, 155, 234),rgb(0, 174, 204))
|
||||
|
||||
/*
|
||||
Alternate "Natural" Styling
|
||||
*/
|
||||
.board-color-natural
|
||||
setBoardColor(#596557)
|
||||
|
||||
&#header-quick-access
|
||||
background-color: #2d392b
|
||||
|
||||
.ui-sortable
|
||||
background-color:#dedede
|
||||
|
||||
.list-header
|
||||
background-color: #c9cfc3
|
||||
border-bottom: 6px solid #c9cfc3
|
||||
|
||||
.swimlane .swimlane-header-wrap
|
||||
background-color: #c2c0ab
|
||||
|
||||
/*
|
||||
Alternate "Modern" Styling
|
||||
*/
|
||||
.board-color-modern
|
||||
setBoardColor(#2A80B8)
|
||||
|
||||
/* General */
|
||||
body
|
||||
background: #f5f5f5
|
||||
|
||||
&#header-quick-access
|
||||
padding: 10px
|
||||
font-size: 14px
|
||||
background: #333 !important
|
||||
|
||||
&#header-quick-access ul
|
||||
overflow: visible
|
||||
|
||||
&#header-quick-access ul li.current
|
||||
border: 0 !important
|
||||
font-weight: bold
|
||||
|
||||
&#header-quick-access ul li.separator
|
||||
display: none
|
||||
|
||||
&#header-quick-access ul li:nth-child(3)
|
||||
margin-right: 10px
|
||||
|
||||
&#header-quick-access ul li a
|
||||
padding: 5px 10px
|
||||
border-radius: 2px
|
||||
|
||||
&#header-quick-access ul li.current a
|
||||
border-radius: 2px
|
||||
background: rgba(255,255,255,.2)
|
||||
|
||||
&#header #header-main-bar h1
|
||||
font-family: Poppins
|
||||
font-weight: bold
|
||||
&#header-quick-access #header-user-bar
|
||||
position relative
|
||||
|
||||
&#header-quick-access #header-user-bar .header-user-bar-name
|
||||
margin: 5px 3px 0 0;
|
||||
|
||||
section#notifications-drawer
|
||||
top: 46px;
|
||||
box-shadow: 0 4px 20px rgba(0,0,0,.1)
|
||||
max-width: 100%
|
||||
|
||||
section#notifications-drawer .header
|
||||
top: 46px;
|
||||
border-radius: 0 3px
|
||||
height: 21px
|
||||
background: #f7f7f7
|
||||
|
||||
/* Swimlane */
|
||||
.swimlane
|
||||
background: #f5f5f5
|
||||
|
||||
.swimlane .swimlane-header-wrap .swimlane-header
|
||||
font-family: Poppins
|
||||
|
||||
/* All board views */
|
||||
.board-list .board-list-item
|
||||
padding: 20px
|
||||
|
||||
.board-list-item-name
|
||||
font-family: Poppins
|
||||
|
||||
/* Board */
|
||||
.list
|
||||
background: transparent
|
||||
border-left: 0
|
||||
margin: 10px 0
|
||||
padding: 0px
|
||||
border-radius: 5px
|
||||
min-width: 300px
|
||||
|
||||
.list-body .open-minicard-composer:hover /*me*/
|
||||
background: none
|
||||
box-shadow: none
|
||||
|
||||
.list:first-child
|
||||
margin-left: 5px
|
||||
|
||||
.list.list-composer.js-list-composer
|
||||
transition: all .3s ease
|
||||
min-width: 80px
|
||||
|
||||
.open-list-composer.js-open-inlined-form:hover
|
||||
color: #222
|
||||
|
||||
.list-header
|
||||
background: none
|
||||
border-bottom-width: 0px
|
||||
|
||||
.list-header .list-header-name
|
||||
font-family: Poppins
|
||||
color: #000
|
||||
font-weight: 500
|
||||
|
||||
/* Card changes */
|
||||
.minicard
|
||||
background: #FFF
|
||||
padding: 15px 15px 10px
|
||||
box-shadow: 0 3px 8px rgba(0,0,0,.05)
|
||||
|
||||
.minicard-plum:hover:not(.minicard-composer), .is-selected .minicard-plum, .draggable-hover-card .minicard-plum
|
||||
background: none
|
||||
|
||||
.minicard-title
|
||||
line-height: 1.5em
|
||||
|
||||
.minicard .minicard-cover
|
||||
background-size: cover
|
||||
margin: -15px -15px 10px
|
||||
height: 100px
|
||||
|
||||
.card-label-orange
|
||||
color: #fff
|
||||
|
||||
.card-date
|
||||
font-size: 12px
|
||||
padding: 3px 5px
|
||||
|
||||
/* Pop over */
|
||||
.header-title
|
||||
font-family: Poppins
|
||||
font-size: 16px
|
||||
color: #333
|
||||
|
||||
.pop-over
|
||||
box-shadow: 0 4px 20px rgba(0,0,0,.1)
|
||||
border: 0
|
||||
border-radius: 5px
|
||||
|
||||
.pop-over .header
|
||||
padding: 10px
|
||||
border-bottom: 0
|
||||
border-radius: 5px 5px 0 0
|
||||
|
||||
.pop-over .content-container .content
|
||||
padding: 5px 20px 20px
|
||||
width: 260px
|
||||
|
||||
.pop-over-list li > a
|
||||
border-radius: 5px
|
||||
|
||||
.pop-over-list li > a > i
|
||||
margin-right: 5px
|
||||
|
||||
.pop-over-list li>a .sub-name
|
||||
margin-bottom: 8px
|
||||
|
||||
/* Sidebar */
|
||||
.sidebar .sidebar-shadow
|
||||
box-shadow: 0 0 60px rgba(0,0,0,.2)
|
||||
|
||||
.sidebar .sidebar-content
|
||||
padding: 30px
|
||||
|
||||
@@ -31,6 +31,10 @@ template(name="boardList")
|
||||
i.fa.js-has-spenttime-cards(
|
||||
class="fa-circle{{#if hasOvertimeCards}} has-overtime-card-active{{else}} no-overtime-card-active{{/if}}"
|
||||
title="{{#if hasOvertimeCards}}{{_ 'has-overtime-cards'}}{{else}}{{_ 'has-spenttime-cards'}}{{/if}}")
|
||||
if isMiniScreen
|
||||
i.fa.board-handle(
|
||||
class="fa-arrows"
|
||||
title="{{_ 'Drag board'}}")
|
||||
unless isMiniScreen
|
||||
if isSandstorm
|
||||
i.fa.js-clone-board(
|
||||
|
||||
@@ -72,6 +72,12 @@ BlazeComponent.extendComponent({
|
||||
|
||||
// Disable drag-dropping if the current user is not a board member or is comment only
|
||||
this.autorun(() => {
|
||||
if (Utils.isMiniScreen()) {
|
||||
$boards.sortable({
|
||||
handle: '.board-handle',
|
||||
});
|
||||
}
|
||||
|
||||
$boards.sortable('option', 'disabled', !userIsAllowedToMove());
|
||||
});
|
||||
},
|
||||
|
||||
@@ -208,6 +208,22 @@ $spaceBetweenTiles = 16px
|
||||
top: -100px
|
||||
left: -100px
|
||||
|
||||
.board-handle
|
||||
position: absolute
|
||||
padding: 7px
|
||||
top: 50%
|
||||
transform: translateY(-50%)
|
||||
right: 10px
|
||||
font-size: 24px
|
||||
|
||||
@media screen and (max-width: 360px)
|
||||
li
|
||||
width: 100%
|
||||
|
||||
.board-handle
|
||||
position: absolute
|
||||
padding: 7px
|
||||
top: 50%
|
||||
transform: translateY(-50%)
|
||||
right: 10px
|
||||
font-size: 24px
|
||||
@@ -18,12 +18,19 @@ template(name="attachmentDeletePopup")
|
||||
p {{_ "attachment-delete-pop"}}
|
||||
button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
|
||||
|
||||
template(name="uploadingPopup")
|
||||
.uploading-info
|
||||
span.upload-percentage {{progress}}%
|
||||
.upload-progress-frame
|
||||
.upload-progress-bar(style="width: {{progress}}%;")
|
||||
span.upload-size {{fileSize}}
|
||||
|
||||
template(name="attachmentsGalery")
|
||||
.attachments-galery
|
||||
each attachments
|
||||
.attachment-item
|
||||
a.attachment-thumbnail.swipebox(href="{{url}}" title="{{name}}")
|
||||
if isUploaded
|
||||
a.attachment-thumbnail.swipebox(href="{{url}}" download="{{name}}" title="{{name}}")
|
||||
if isUploaded
|
||||
if isImage
|
||||
img.attachment-thumbnail-img(src="{{url}}")
|
||||
else
|
||||
@@ -33,7 +40,7 @@ template(name="attachmentsGalery")
|
||||
p.attachment-details
|
||||
= name
|
||||
span.attachment-details-actions
|
||||
a.js-download(href="{{url download=true}}")
|
||||
a.js-download(href="{{url download=true}}" download="{{name}}")
|
||||
i.fa.fa-download
|
||||
| {{_ 'download'}}
|
||||
if currentUser.isBoardMember
|
||||
|
||||
@@ -13,10 +13,10 @@ Template.attachmentsGalery.events({
|
||||
event.stopPropagation();
|
||||
},
|
||||
'click .js-add-cover'() {
|
||||
Cards.findOne(this.cardId).setCover(this._id);
|
||||
Cards.findOne(this.meta.cardId).setCover(this._id);
|
||||
},
|
||||
'click .js-remove-cover'() {
|
||||
Cards.findOne(this.cardId).unsetCover();
|
||||
Cards.findOne(this.meta.cardId).unsetCover();
|
||||
},
|
||||
'click .js-preview-image'(event) {
|
||||
Popup.open('previewAttachedImage').call(this, event);
|
||||
@@ -45,22 +45,63 @@ Template.attachmentsGalery.events({
|
||||
},
|
||||
});
|
||||
|
||||
Template.attachmentsGalery.helpers({
|
||||
url() {
|
||||
return Attachments.link(this, 'original', '/');
|
||||
},
|
||||
isUploaded() {
|
||||
return !this.meta.uploading;
|
||||
},
|
||||
isImage() {
|
||||
return !!this.isImage;
|
||||
},
|
||||
});
|
||||
|
||||
Template.previewAttachedImagePopup.events({
|
||||
'click .js-large-image-clicked'() {
|
||||
Popup.close();
|
||||
},
|
||||
});
|
||||
|
||||
Template.previewAttachedImagePopup.helpers({
|
||||
url() {
|
||||
return Attachments.link(this, 'original', '/');
|
||||
}
|
||||
});
|
||||
|
||||
// For uploading popup
|
||||
|
||||
let uploadFileSize = new ReactiveVar('');
|
||||
let uploadProgress = new ReactiveVar(0);
|
||||
|
||||
Template.cardAttachmentsPopup.events({
|
||||
'change .js-attach-file'(event) {
|
||||
'change .js-attach-file'(event, instance) {
|
||||
const card = this;
|
||||
const processFile = f => {
|
||||
Utils.processUploadedAttachment(card, f, attachment => {
|
||||
if (attachment && attachment._id && attachment.isImage()) {
|
||||
card.setCover(attachment._id);
|
||||
const callbacks = {
|
||||
onBeforeUpload: (err, fileData) => {
|
||||
Popup.open('uploading')(this.clickEvent);
|
||||
uploadFileSize.set('...');
|
||||
uploadProgress.set(0);
|
||||
return true;
|
||||
},
|
||||
onUploaded: (err, attachment) => {
|
||||
if (attachment && attachment._id && attachment.isImage) {
|
||||
card.setCover(attachment._id);
|
||||
}
|
||||
Popup.close();
|
||||
},
|
||||
onStart: (error, fileData) => {
|
||||
uploadFileSize.set(formatBytes(fileData.size));
|
||||
},
|
||||
onError: (err, fileObj) => {
|
||||
console.log('Error!', err);
|
||||
},
|
||||
onProgress: (progress, fileData) => {
|
||||
uploadProgress.set(progress);
|
||||
}
|
||||
Popup.close();
|
||||
});
|
||||
};
|
||||
const processFile = f => {
|
||||
Utils.processUploadedAttachment(card, f, callbacks);
|
||||
};
|
||||
|
||||
FS.Utility.eachFile(event, f => {
|
||||
@@ -100,12 +141,22 @@ Template.cardAttachmentsPopup.events({
|
||||
});
|
||||
},
|
||||
'click .js-computer-upload'(event, templateInstance) {
|
||||
this.clickEvent = event;
|
||||
templateInstance.find('.js-attach-file').click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'click .js-upload-clipboard-image': Popup.open('previewClipboardImage'),
|
||||
});
|
||||
|
||||
Template.uploadingPopup.helpers({
|
||||
fileSize: () => {
|
||||
return uploadFileSize.get();
|
||||
},
|
||||
progress: () => {
|
||||
return uploadProgress.get();
|
||||
}
|
||||
});
|
||||
|
||||
const MAX_IMAGE_PIXEL = Utils.MAX_IMAGE_PIXEL;
|
||||
const COMPRESS_RATIO = Utils.IMAGE_COMPRESS_RATIO;
|
||||
let pastedResults = null;
|
||||
@@ -149,20 +200,26 @@ Template.previewClipboardImagePopup.events({
|
||||
if (results && results.file) {
|
||||
window.oPasted = pastedResults;
|
||||
const card = this;
|
||||
const file = new FS.File(results.file);
|
||||
const settings = {
|
||||
file: results.file,
|
||||
streams: 'dynamic',
|
||||
chunkSize: 'dynamic',
|
||||
};
|
||||
if (!results.name) {
|
||||
// if no filename, it's from clipboard. then we give it a name, with ext name from MIME type
|
||||
if (typeof results.file.type === 'string') {
|
||||
file.name(results.file.type.replace('image/', 'clipboard.'));
|
||||
settings.fileName =
|
||||
new Date().getTime() + results.file.type.replace('.+/', '');
|
||||
}
|
||||
}
|
||||
file.updatedAt(new Date());
|
||||
file.boardId = card.boardId;
|
||||
file.cardId = card._id;
|
||||
file.userId = Meteor.userId();
|
||||
const attachment = Attachments.insert(file);
|
||||
settings.meta = {};
|
||||
settings.meta.updatedAt = new Date().getTime();
|
||||
settings.meta.boardId = card.boardId;
|
||||
settings.meta.cardId = card._id;
|
||||
settings.meta.userId = Meteor.userId();
|
||||
const attachment = Attachments.insert(settings);
|
||||
|
||||
if (attachment && attachment._id && attachment.isImage()) {
|
||||
if (attachment && attachment._id && attachment.isImage) {
|
||||
card.setCover(attachment._id);
|
||||
}
|
||||
|
||||
@@ -172,3 +229,15 @@ Template.previewClipboardImagePopup.events({
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
function formatBytes(bytes, decimals = 2) {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
@@ -64,6 +64,17 @@
|
||||
border: 1px solid black
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.2)
|
||||
|
||||
.uploading-info
|
||||
.upload-progress-frame
|
||||
background-color: grey;
|
||||
border: 1px solid;
|
||||
height: 22px;
|
||||
|
||||
.upload-progress-bar
|
||||
background-color: blue;
|
||||
height: 20px;
|
||||
padding: 1px;
|
||||
|
||||
@media screen and (max-width: 800px)
|
||||
.attachments-galery
|
||||
flex-direction
|
||||
|
||||
@@ -11,7 +11,7 @@ template(name="minicard")
|
||||
.handle
|
||||
.fa.fa-arrows
|
||||
if cover
|
||||
.minicard-cover(style="background-image: url('{{cover.url}}');")
|
||||
.minicard-cover(style="background-image: url('{{coverUrl}}');")
|
||||
if labels
|
||||
.minicard-labels
|
||||
each labels
|
||||
|
||||
@@ -52,4 +52,7 @@ Template.minicard.helpers({
|
||||
return false;
|
||||
}
|
||||
},
|
||||
coverUrl() {
|
||||
return Attachments.findOne(this.coverId).link('original', '/');
|
||||
},
|
||||
});
|
||||
@@ -74,18 +74,16 @@ BlazeComponent.extendComponent({
|
||||
const sortIndex = calculateIndex(prevCardDom, nextCardDom, nCards);
|
||||
const listId = Blaze.getData(ui.item.parents('.list').get(0))._id;
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
let swimlaneId = '';
|
||||
const defaultSwimlaneId = currentBoard.getDefaultSwimline()._id;
|
||||
let targetSwimlaneId = null;
|
||||
|
||||
// only set a new swimelane ID if the swimlanes view is active
|
||||
if (
|
||||
Utils.boardView() === 'board-view-swimlanes' ||
|
||||
currentBoard.isTemplatesBoard()
|
||||
)
|
||||
swimlaneId = Blaze.getData(ui.item.parents('.swimlane').get(0))._id;
|
||||
else if (
|
||||
Utils.boardView() === 'board-view-lists' ||
|
||||
Utils.boardView() === 'board-view-cal' ||
|
||||
!Utils.boardView
|
||||
)
|
||||
swimlaneId = currentBoard.getDefaultSwimline()._id;
|
||||
targetSwimlaneId = Blaze.getData(ui.item.parents('.swimlane').get(0))
|
||||
._id;
|
||||
|
||||
// Normally the jquery-ui sortable library moves the dragged DOM element
|
||||
// to its new position, which disrupts Blaze reactive updates mechanism
|
||||
@@ -98,9 +96,12 @@ BlazeComponent.extendComponent({
|
||||
|
||||
if (MultiSelection.isActive()) {
|
||||
Cards.find(MultiSelection.getMongoSelector()).forEach((card, i) => {
|
||||
const newSwimlaneId = targetSwimlaneId
|
||||
? targetSwimlaneId
|
||||
: card.swimlaneId || defaultSwimlaneId;
|
||||
card.move(
|
||||
currentBoard._id,
|
||||
swimlaneId,
|
||||
newSwimlaneId,
|
||||
listId,
|
||||
sortIndex.base + i * sortIndex.increment,
|
||||
);
|
||||
@@ -108,7 +109,10 @@ BlazeComponent.extendComponent({
|
||||
} else {
|
||||
const cardDomElement = ui.item.get(0);
|
||||
const card = Blaze.getData(cardDomElement);
|
||||
card.move(currentBoard._id, swimlaneId, listId, sortIndex.base);
|
||||
const newSwimlaneId = targetSwimlaneId
|
||||
? targetSwimlaneId
|
||||
: card.swimlaneId || defaultSwimlaneId;
|
||||
card.move(currentBoard._id, newSwimlaneId, listId, sortIndex.base);
|
||||
}
|
||||
boardComponent.setIsDragging(false);
|
||||
},
|
||||
|
||||
@@ -152,33 +152,31 @@ Template.editor.onRendered(() => {
|
||||
const processData = function(fileObj) {
|
||||
Utils.processUploadedAttachment(
|
||||
currentCard,
|
||||
fileObj,
|
||||
attachment => {
|
||||
if (
|
||||
attachment &&
|
||||
attachment._id &&
|
||||
attachment.isImage()
|
||||
) {
|
||||
attachment.one('uploaded', function() {
|
||||
const maxTry = 3;
|
||||
const checkItvl = 500;
|
||||
let retry = 0;
|
||||
const checkUrl = function() {
|
||||
// even though uploaded event fired, attachment.url() is still null somehow //TODO
|
||||
const url = attachment.url();
|
||||
if (url) {
|
||||
insertImage(
|
||||
`${location.protocol}//${location.host}${url}`,
|
||||
);
|
||||
} else {
|
||||
retry++;
|
||||
if (retry < maxTry) {
|
||||
setTimeout(checkUrl, checkItvl);
|
||||
fileObj,
|
||||
{ onUploaded:
|
||||
attachment => {
|
||||
if (attachment && attachment._id && attachment.isImage) {
|
||||
attachment.one('uploaded', function() {
|
||||
const maxTry = 3;
|
||||
const checkItvl = 500;
|
||||
let retry = 0;
|
||||
const checkUrl = function() {
|
||||
// even though uploaded event fired, attachment.url() is still null somehow //TODO
|
||||
const url = Attachments.link(attachment, 'original', '/');
|
||||
if (url) {
|
||||
insertImage(
|
||||
`${location.protocol}//${location.host}${url}`,
|
||||
);
|
||||
} else {
|
||||
retry++;
|
||||
if (retry < maxTry) {
|
||||
setTimeout(checkUrl, checkItvl);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
checkUrl();
|
||||
});
|
||||
};
|
||||
checkUrl();
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@@ -15,3 +15,27 @@
|
||||
local('Roboto-Bold'),
|
||||
url('/fonts/roboto-bold.woff2') format('woff2'),
|
||||
url('/fonts/roboto-bold.woff') format('woff')
|
||||
|
||||
@font-face
|
||||
font-family: 'Poppins'
|
||||
font-style: normal
|
||||
font-weight: 400
|
||||
src: local('Poppins'),
|
||||
local('Poppins-Regular'),
|
||||
url('/fonts/poppins-regular.woff') format('woff')
|
||||
|
||||
@font-face
|
||||
font-family: 'Poppins'
|
||||
font-style: normal
|
||||
font-weight: 500
|
||||
src: local('Poppins Medium'),
|
||||
local('Poppins-Medium'),
|
||||
url('/fonts/poppins-medium.woff') format('woff')
|
||||
|
||||
@font-face
|
||||
font-family: 'Poppins'
|
||||
font-style: normal
|
||||
font-weight: 700
|
||||
src: local('Poppins Bold'),
|
||||
local('Poppins-Bold'),
|
||||
url('/fonts/poppins-bold.woff') format('woff')
|
||||
@@ -32,7 +32,7 @@ a:hover,a:focus
|
||||
border-radius: unset
|
||||
|
||||
html, body, input, select, textarea, button
|
||||
font: 14px Roboto, "Helvetica Neue", Arial, Helvetica, sans-serif
|
||||
font: 14px Roboto, Poppins, "Helvetica Neue", Arial, Helvetica, sans-serif
|
||||
line-height: 18px
|
||||
color: #4d4d4d
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ BlazeComponent.extendComponent({
|
||||
const ruleName = this.data().ruleName.get();
|
||||
const trigger = this.data().triggerVar.get();
|
||||
const actionSelected = this.find('#move-spec-action').value;
|
||||
const swimlaneName = this.find('#swimlaneName').value;
|
||||
const listName = this.find('#listName').value;
|
||||
const swimlaneName = this.find('#swimlaneName').value || '*';
|
||||
const listName = this.find('#listName').value || '*';
|
||||
const boardId = Session.get('currentBoard');
|
||||
const destBoardId = this.find('#board-id').value;
|
||||
const desc = Utils.getTriggerActionDesc(event, this);
|
||||
|
||||
@@ -329,12 +329,10 @@ template(name="boardMenuPopup")
|
||||
if isSandstorm
|
||||
hr
|
||||
ul.pop-over-list
|
||||
if withApi
|
||||
li
|
||||
a(href="{{exportUrl}}", download="{{exportFilename}}")
|
||||
i.fa.fa-share-alt
|
||||
i.fa.fa-sign-out
|
||||
| {{_ 'export-board'}}
|
||||
li
|
||||
a.js-export-board
|
||||
i.fa.fa-share-alt
|
||||
| {{_ 'export-board'}}
|
||||
li
|
||||
a.js-import-board
|
||||
i.fa.fa-share-alt
|
||||
@@ -365,7 +363,7 @@ template(name="boardMenuPopup")
|
||||
template(name="exportBoard")
|
||||
ul.pop-over-list
|
||||
li
|
||||
a(href="{{exportUrl}}", download="{{exportJsonFilename}}")
|
||||
a.download-json-link(href="{{exportUrl}}", download="{{exportJsonFilename}}")
|
||||
i.fa.fa-share-alt
|
||||
| {{_ 'export-board-json'}}
|
||||
li
|
||||
@@ -376,6 +374,10 @@ template(name="exportBoard")
|
||||
a(href="{{exportTsvUrl}}", download="{{exportTsvFilename}}")
|
||||
i.fa.fa-share-alt
|
||||
| {{_ 'export-board-tsv'}}
|
||||
li
|
||||
a.html-export-board
|
||||
i.fa.fa-archive
|
||||
| {{_ 'export-board-html'}}
|
||||
|
||||
template(name="labelsWidget")
|
||||
.board-widget.board-widget-labels
|
||||
|
||||
@@ -463,6 +463,13 @@ BlazeComponent.extendComponent({
|
||||
},
|
||||
}).register('exportBoardPopup');
|
||||
|
||||
Template.exportBoard.events({
|
||||
'click .html-export-board': async event => {
|
||||
event.preventDefault();
|
||||
await ExportHtml(Popup)();
|
||||
}
|
||||
});
|
||||
|
||||
Template.labelsWidget.events({
|
||||
'click .js-label': Popup.open('editLabel'),
|
||||
'click .js-add-label': Popup.open('createLabel'),
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
const JSZip = require('jszip');
|
||||
|
||||
window.ExportHtml = (Popup) => {
|
||||
const saveAs = function(blob, filename) {
|
||||
let dl = document.createElement('a');
|
||||
dl.href = window.URL.createObjectURL(blob);
|
||||
dl.onclick = event => document.body.removeChild(event.target);
|
||||
dl.style.display = 'none';
|
||||
dl.target = '_blank';
|
||||
dl.download = filename;
|
||||
document.body.appendChild(dl);
|
||||
dl.click();
|
||||
};
|
||||
|
||||
const asyncForEach = async function (array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
};
|
||||
|
||||
const getPageHtmlString = () => {
|
||||
return `<!doctype html>${
|
||||
window.document.querySelector('html').outerHTML
|
||||
}`;
|
||||
};
|
||||
|
||||
const removeAnchors = htmlString => {
|
||||
const replaceOpenAnchor = htmlString.replace(new RegExp('<a ', 'gim'), '<span ');
|
||||
return replaceOpenAnchor.replace(new RegExp('<\/a', 'gim'), '</span');
|
||||
};
|
||||
|
||||
const ensureSidebarRemoved = () => {
|
||||
document.querySelector('.board-sidebar.sidebar').remove();
|
||||
};
|
||||
|
||||
const addJsonExportToZip = async (zip, boardSlug) => {
|
||||
const downloadJSONLink = document.querySelector('.download-json-link');
|
||||
const downloadJSONURL = downloadJSONLink.href;
|
||||
const response = await fetch(downloadJSONURL);
|
||||
const responseBody = await response.text();
|
||||
zip.file(`data/${boardSlug}.json`, responseBody);
|
||||
};
|
||||
|
||||
const closeSidebar = () => {
|
||||
document.querySelector('.board-header-btn.js-toggle-sidebar').click();
|
||||
};
|
||||
|
||||
const cleanBoardHtml = () => {
|
||||
Array.from(document.querySelectorAll('script')).forEach(elem =>
|
||||
elem.remove(),
|
||||
);
|
||||
Array.from(
|
||||
document.querySelectorAll('link:not([rel="stylesheet"])'),
|
||||
).forEach(elem => elem.remove());
|
||||
document.querySelector('#header-quick-access').remove();
|
||||
Array.from(
|
||||
document.querySelectorAll('#header-main-bar .board-header-btns'),
|
||||
).forEach(elem => elem.remove());
|
||||
Array.from(document.querySelectorAll('.list-composer')).forEach(elem =>
|
||||
elem.remove(),
|
||||
);
|
||||
Array.from(
|
||||
document.querySelectorAll(
|
||||
'.list-composer,.js-card-composer, .js-add-card',
|
||||
),
|
||||
).forEach(elem => elem.remove());
|
||||
Array.from(
|
||||
document.querySelectorAll('.js-perfect-scrollbar > div:nth-of-type(n+2)'),
|
||||
).forEach(elem => elem.remove());
|
||||
Array.from(document.querySelectorAll('.js-perfect-scrollbar')).forEach(
|
||||
elem => {
|
||||
elem.style = 'overflow-y: auto !important;';
|
||||
elem.classList.remove('js-perfect-scrollbar');
|
||||
},
|
||||
);
|
||||
Array.from(document.querySelectorAll('[href]:not(link)')).forEach(elem =>
|
||||
elem.attributes.removeNamedItem('href'),
|
||||
);
|
||||
Array.from(document.querySelectorAll('[href]')).forEach(elem => {
|
||||
// eslint-disable-next-line no-self-assign
|
||||
elem.href = elem.href;
|
||||
// eslint-disable-next-line no-self-assign
|
||||
elem.src = elem.src;
|
||||
});
|
||||
Array.from(document.querySelectorAll('.is-editable')).forEach(elem => {
|
||||
elem.classList.remove('is-editable')
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
const getBoardSlug = () => {
|
||||
return window.location.href.split('/').pop();
|
||||
};
|
||||
|
||||
const getStylesheetList = () => {
|
||||
return Array.from(
|
||||
document.querySelectorAll('link[href][rel="stylesheet"]'),
|
||||
);
|
||||
};
|
||||
|
||||
const downloadStylesheets = async (stylesheets, zip) => {
|
||||
await asyncForEach(stylesheets, async elem => {
|
||||
const response = await fetch(elem.href);
|
||||
const responseBody = await response.text();
|
||||
|
||||
const finalResponse = responseBody.replace(
|
||||
new RegExp('packages\/[^\/]+\/upstream\/', 'gim'), '../'
|
||||
);
|
||||
|
||||
const filename = elem.href
|
||||
.split('/')
|
||||
.pop()
|
||||
.split('?')
|
||||
.shift();
|
||||
const fileFullPath = `style/${filename}`;
|
||||
zip.file(fileFullPath, finalResponse);
|
||||
elem.href = `../${fileFullPath}`;
|
||||
});
|
||||
};
|
||||
|
||||
const getSrcAttached = () => {
|
||||
return Array.from(document.querySelectorAll('[src]'));
|
||||
};
|
||||
|
||||
const downloadSrcAttached = async (elements, zip, boardSlug) => {
|
||||
await asyncForEach(elements, async elem => {
|
||||
const response = await fetch(elem.src);
|
||||
const responseBody = await response.blob();
|
||||
const filename = elem.src
|
||||
.split('/')
|
||||
.pop()
|
||||
.split('?')
|
||||
.shift();
|
||||
const fileFullPath = `${boardSlug}/${elem.tagName.toLowerCase()}/${filename}`;
|
||||
zip.file(fileFullPath, responseBody);
|
||||
elem.src = `./${elem.tagName.toLowerCase()}/${filename}`;
|
||||
});
|
||||
};
|
||||
|
||||
const removeCssUrlSurround = url => {
|
||||
const working = url || "";
|
||||
return working
|
||||
.split("url(")
|
||||
.join("")
|
||||
.split("\")")
|
||||
.join("")
|
||||
.split("\"")
|
||||
.join("")
|
||||
.split("')")
|
||||
.join("")
|
||||
.split("'")
|
||||
.join("")
|
||||
.split(")")
|
||||
.join("");
|
||||
};
|
||||
|
||||
const getCardCovers = () => {
|
||||
return Array.from(document.querySelectorAll('.minicard-cover'))
|
||||
.filter(elem => elem.style['background-image'])
|
||||
}
|
||||
|
||||
const downloadCardCovers = async (elements, zip, boardSlug) => {
|
||||
await asyncForEach(elements, async elem => {
|
||||
const response = await fetch(removeCssUrlSurround(elem.style['background-image']));
|
||||
const responseBody = await response.blob();
|
||||
const filename = removeCssUrlSurround(elem.style['background-image'])
|
||||
.split('/')
|
||||
.pop()
|
||||
.split('?')
|
||||
.shift()
|
||||
.split('#')
|
||||
.shift();
|
||||
const fileFullPath = `${boardSlug}/covers/${filename}`;
|
||||
zip.file(fileFullPath, responseBody);
|
||||
elem.style = "background-image: url('" + `covers/${filename}` + "')";
|
||||
});
|
||||
};
|
||||
|
||||
const addBoardHTMLToZip = (boardSlug, zip) => {
|
||||
ensureSidebarRemoved();
|
||||
const htmlOutputPath = `${boardSlug}/index.html`;
|
||||
zip.file(htmlOutputPath, new Blob([
|
||||
removeAnchors(getPageHtmlString())
|
||||
], { type: 'application/html' }));
|
||||
};
|
||||
|
||||
return async () => {
|
||||
const zip = new JSZip();
|
||||
const boardSlug = getBoardSlug();
|
||||
|
||||
await addJsonExportToZip(zip, boardSlug);
|
||||
Popup.close();
|
||||
closeSidebar();
|
||||
cleanBoardHtml();
|
||||
|
||||
await downloadStylesheets(getStylesheetList(), zip);
|
||||
await downloadSrcAttached(getSrcAttached(), zip, boardSlug);
|
||||
await downloadCardCovers(getCardCovers(), zip, boardSlug);
|
||||
|
||||
addBoardHTMLToZip(boardSlug, zip);
|
||||
|
||||
const content = await zip.generateAsync({ type: 'blob' });
|
||||
saveAs(content, `${boardSlug}.zip`);
|
||||
window.location.reload();
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -49,7 +49,7 @@ window.Popup = new (class {
|
||||
// has one. This allows us to position a sub-popup exactly at the same
|
||||
// position than its parent.
|
||||
let openerElement;
|
||||
if (clickFromPopup(evt)) {
|
||||
if (clickFromPopup(evt) && self._getTopStack()) {
|
||||
openerElement = self._getTopStack().openerElement;
|
||||
} else {
|
||||
self._stack = [];
|
||||
|
||||
+26
-18
@@ -61,30 +61,38 @@ Utils = {
|
||||
},
|
||||
MAX_IMAGE_PIXEL: Meteor.settings.public.MAX_IMAGE_PIXEL,
|
||||
COMPRESS_RATIO: Meteor.settings.public.IMAGE_COMPRESS_RATIO,
|
||||
processUploadedAttachment(card, fileObj, callback) {
|
||||
const next = attachment => {
|
||||
if (typeof callback === 'function') {
|
||||
callback(attachment);
|
||||
}
|
||||
};
|
||||
processUploadedAttachment(card, fileObj, callbacks) {
|
||||
if (!card) {
|
||||
return next();
|
||||
return onUploaded();
|
||||
}
|
||||
const file = new FS.File(fileObj);
|
||||
let settings = {
|
||||
file: fileObj,
|
||||
streams: 'dynamic',
|
||||
chunkSize: 'dynamic',
|
||||
};
|
||||
settings.meta = {
|
||||
uploading: true
|
||||
};
|
||||
if (card.isLinkedCard()) {
|
||||
file.boardId = Cards.findOne(card.linkedId).boardId;
|
||||
file.cardId = card.linkedId;
|
||||
settings.meta.boardId = Cards.findOne(card.linkedId).boardId;
|
||||
settings.meta.cardId = card.linkedId;
|
||||
} else {
|
||||
file.boardId = card.boardId;
|
||||
file.swimlaneId = card.swimlaneId;
|
||||
file.listId = card.listId;
|
||||
file.cardId = card._id;
|
||||
settings.meta.boardId = card.boardId;
|
||||
settings.meta.swimlaneId = card.swimlaneId;
|
||||
settings.meta.listId = card.listId;
|
||||
settings.meta.cardId = card._id;
|
||||
}
|
||||
file.userId = Meteor.userId();
|
||||
if (file.original) {
|
||||
file.original.name = fileObj.name;
|
||||
settings.meta.userId = Meteor.userId();
|
||||
if (typeof callbacks === 'function') {
|
||||
settings.onEnd = callbacks;
|
||||
} else {
|
||||
for (const key in callbacks) {
|
||||
if (key.substring(0, 2) === 'on') {
|
||||
settings[key] = callbacks[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
return next(Attachments.insert(file));
|
||||
Attachments.insert(settings);
|
||||
},
|
||||
shrinkImage(options) {
|
||||
// shrink image to certain size
|
||||
|
||||
+21
-21
@@ -164,15 +164,15 @@
|
||||
"cardStartVotingPopup-title": "Abstimmung starten",
|
||||
"positiveVoteMembersPopup-title": "Befürworter",
|
||||
"negativeVoteMembersPopup-title": "Gegner",
|
||||
"card-edit-voting": "Edit voting",
|
||||
"editVoteEndDatePopup-title": "Change vote end date",
|
||||
"allowNonBoardMembers": "Allow all logged in users",
|
||||
"card-edit-voting": "Abstimmung editieren",
|
||||
"editVoteEndDatePopup-title": "Enddatum der Abstimmung ändern",
|
||||
"allowNonBoardMembers": "Alle eingeloggte Nutzer erlauben",
|
||||
"vote-question": "Abstimmen über",
|
||||
"vote-public": "Zeigen, wer was gewählt hat",
|
||||
"vote-for-it": "Dafür",
|
||||
"vote-against": "Dagegen",
|
||||
"deleteVotePopup-title": "Delete vote?",
|
||||
"vote-delete-pop": "Deleting is permanent. You will lose all actions associated with this vote.",
|
||||
"deleteVotePopup-title": "Wahl löschen?",
|
||||
"vote-delete-pop": "Löschen ist unwiderruflich. Alle Aktionen die dieser Karte zugeordnet sind werden ebenfalls gelöscht.",
|
||||
"cardDeletePopup-title": "Karte löschen?",
|
||||
"cardDetailsActionsPopup-title": "Kartenaktionen",
|
||||
"cardLabelsPopup-title": "Labels",
|
||||
@@ -309,7 +309,7 @@
|
||||
"error-board-notAMember": "Um das zu tun, müssen Sie Mitglied dieses Boards sein",
|
||||
"error-json-malformed": "Ihre Eingabe ist kein gültiges JSON",
|
||||
"error-json-schema": "Ihre JSON-Daten enthalten nicht die gewünschten Informationen im richtigen Format",
|
||||
"error-csv-schema": "Your CSV(Comma Separated Values)/TSV (Tab Separated Values) does not include the proper information in the correct format",
|
||||
"error-csv-schema": "hre CSV (Comma Separated Values)/TSV (Tab Separated Values) enthalten nicht die gewünschten Informationen im richtigen Format",
|
||||
"error-list-doesNotExist": "Diese Liste existiert nicht",
|
||||
"error-user-doesNotExist": "Dieser Nutzer existiert nicht",
|
||||
"error-user-notAllowSelf": "Sie können sich nicht selbst einladen.",
|
||||
@@ -317,10 +317,10 @@
|
||||
"error-username-taken": "Dieser Benutzername ist bereits vergeben",
|
||||
"error-email-taken": "E-Mail wird schon verwendet",
|
||||
"export-board": "Board exportieren",
|
||||
"export-board-json": "Export board to JSON",
|
||||
"export-board-csv": "Export board to CSV",
|
||||
"export-board-tsv": "Export board to TSV",
|
||||
"export-board-html": "Export board to HTML",
|
||||
"export-board-json": "Board als JSON exportieren",
|
||||
"export-board-csv": "Board als CSV exportieren",
|
||||
"export-board-tsv": "Board als TSV exportieren",
|
||||
"export-board-html": "Board als HTML exportieren",
|
||||
"exportBoardPopup-title": "Board exportieren",
|
||||
"sort": "Sortieren",
|
||||
"sort-desc": "Zum Sortieren der Liste klicken",
|
||||
@@ -357,16 +357,16 @@
|
||||
"import-board-c": "Board importieren",
|
||||
"import-board-title-trello": "Board von Trello importieren",
|
||||
"import-board-title-wekan": "Board aus vorherigem Export importieren",
|
||||
"import-board-title-csv": "Import board from CSV/TSV",
|
||||
"import-board-title-csv": "Board von CSV/TSV importieren",
|
||||
"from-trello": "Von Trello",
|
||||
"from-wekan": "Aus vorherigem Export",
|
||||
"from-csv": "From CSV/TSV",
|
||||
"from-csv": "Aus CSV/TSV",
|
||||
"import-board-instruction-trello": "Gehen Sie in ihrem Trello-Board auf 'Menü', dann 'Mehr', 'Drucken und Exportieren', 'JSON-Export' und kopieren Sie den dort angezeigten Text",
|
||||
"import-board-instruction-csv": "Paste in your Comma Separated Values(CSV)/ Tab Separated Values (TSV) .",
|
||||
"import-board-instruction-csv": "Fügen Sie die Ihre Comma-Separated- (CSV) / bzw. Tab-Separated-Values (TSV) ein.",
|
||||
"import-board-instruction-wekan": "Gehen Sie in Ihrem Board auf 'Menü', danach auf 'Board exportieren' und kopieren Sie den Text aus der heruntergeladenen Datei.",
|
||||
"import-board-instruction-about-errors": "Treten beim importieren eines Board Fehler auf, so kann der Import dennoch erfolgreich abgeschlossen sein und das Board ist auf der Seite \"Alle Boards\" zusehen.",
|
||||
"import-json-placeholder": "Fügen Sie die korrekten JSON-Daten hier ein",
|
||||
"import-csv-placeholder": "Paste your valid CSV/TSV data here",
|
||||
"import-csv-placeholder": "Fügen Sie die korrekten CSV/TSV-Daten hier ein ",
|
||||
"import-map-members": "Mitglieder zuordnen",
|
||||
"import-members-map": "Das importierte Board hat einige Mitglieder. Bitte ordnen sie die Mitglieder, die Sie importieren wollen, Ihren Benutzern zu.",
|
||||
"import-show-user-mapping": "Mitgliederzuordnung überprüfen",
|
||||
@@ -399,7 +399,7 @@
|
||||
"swimlaneActionPopup-title": "Swimlaneaktionen",
|
||||
"swimlaneAddPopup-title": "Swimlane unterhalb einfügen",
|
||||
"listImportCardPopup-title": "Eine Trello-Karte importieren",
|
||||
"listImportCardsTsvPopup-title": "Import Excel CSV/TSV",
|
||||
"listImportCardsTsvPopup-title": "CSV/TSV importieren",
|
||||
"listMorePopup-title": "Mehr",
|
||||
"link-list": "Link zu dieser Liste",
|
||||
"list-delete-pop": "Alle Aktionen werden aus dem Verlauf gelöscht und die Liste kann nicht wiederhergestellt werden.",
|
||||
@@ -639,7 +639,7 @@
|
||||
"r-when-a-card": "Wenn Karte",
|
||||
"r-is": "wird",
|
||||
"r-is-moved": "verschoben wird",
|
||||
"r-added-to": "Added to",
|
||||
"r-added-to": "Hinzugefügt zu",
|
||||
"r-removed-from": "entfernt von",
|
||||
"r-the-board": "das Board",
|
||||
"r-list": "Liste",
|
||||
@@ -800,11 +800,11 @@
|
||||
"sunday": "Sonntag",
|
||||
"status": "Status",
|
||||
"swimlane": "Swimlane",
|
||||
"owner": "Owner",
|
||||
"last-modified-at": "Last modified at",
|
||||
"last-activity": "Last activity",
|
||||
"voting": "Voting",
|
||||
"archived": "Archived",
|
||||
"owner": "Eigentümer",
|
||||
"last-modified-at": "Zuletzt geändert um",
|
||||
"last-activity": "Letzte Aktivität",
|
||||
"voting": "Abstimunng",
|
||||
"archived": "Archiviert",
|
||||
"delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
|
||||
"delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
|
||||
}
|
||||
+5
-5
@@ -43,7 +43,7 @@
|
||||
"act-withBoardTitle": "__board__",
|
||||
"act-withCardTitle": "[__board__] __card__",
|
||||
"actions": "Ενέργειες",
|
||||
"activities": "Activities",
|
||||
"activities": "Δραστηριότητες",
|
||||
"activity": "Δραστηριότητα",
|
||||
"activity-added": "added %s to %s",
|
||||
"activity-archived": "%s μετακινήθηκε στο Αρχείο",
|
||||
@@ -55,7 +55,7 @@
|
||||
"activity-imported-board": "imported %s from %s",
|
||||
"activity-joined": "joined %s",
|
||||
"activity-moved": "moved %s from %s to %s",
|
||||
"activity-on": "on %s",
|
||||
"activity-on": "στό %s",
|
||||
"activity-removed": "removed %s from %s",
|
||||
"activity-sent": "sent %s to %s",
|
||||
"activity-unjoined": "unjoined %s",
|
||||
@@ -76,18 +76,18 @@
|
||||
"activity-editComment": "edited comment %s",
|
||||
"activity-deleteComment": "deleted comment %s",
|
||||
"add-attachment": "Add Attachment",
|
||||
"add-board": "Add Board",
|
||||
"add-board": "Προσθήκη Πίνακα",
|
||||
"add-card": "Προσθήκη Κάρτας",
|
||||
"add-swimlane": "Add Swimlane",
|
||||
"add-subtask": "Add Subtask",
|
||||
"add-checklist": "Add Checklist",
|
||||
"add-checklist": "Προσθήκη Λίστας ελέγχου",
|
||||
"add-checklist-item": "Add an item to checklist",
|
||||
"add-cover": "Add Cover",
|
||||
"add-label": "Προσθήκη Ετικέτας",
|
||||
"add-list": "Προσθήκη Λίστας",
|
||||
"add-members": "Προσθήκη Μελών",
|
||||
"added": "Προστέθηκε",
|
||||
"addMemberPopup-title": "Μέλοι",
|
||||
"addMemberPopup-title": "Μέλη",
|
||||
"admin": "Διαχειριστής",
|
||||
"admin-desc": "Can view and edit cards, remove members, and change settings for the board.",
|
||||
"admin-announcement": "Announcement",
|
||||
|
||||
+16
-16
@@ -320,7 +320,7 @@
|
||||
"export-board-json": "Exportar tablero a JSON",
|
||||
"export-board-csv": "Exportar tablero a CSV",
|
||||
"export-board-tsv": "Exportar tablero a TSV",
|
||||
"export-board-html": "Export board to HTML",
|
||||
"export-board-html": "Exportar tablero a HTML",
|
||||
"exportBoardPopup-title": "Exportar el tablero",
|
||||
"sort": "Ordenar",
|
||||
"sort-desc": "Click para ordenar la lista",
|
||||
@@ -366,7 +366,7 @@
|
||||
"import-board-instruction-wekan": "En tu tablero, vete a 'Menú', luego 'Exportar tablero', y copia el texto en el archivo descargado.",
|
||||
"import-board-instruction-about-errors": "Aunque obtengas errores cuando importes el tablero, a veces la importación funciona igualmente, y el tablero se encontrará en la página de tableros.",
|
||||
"import-json-placeholder": "Pega tus datos JSON válidos aquí",
|
||||
"import-csv-placeholder": "Paste your valid CSV/TSV data here",
|
||||
"import-csv-placeholder": "Pega tus datos CSV/TSV válidos aquí",
|
||||
"import-map-members": "Mapa de miembros",
|
||||
"import-members-map": "Tu tablero importado tiene algunos miembros. Por favor, mapea los miembros que quieres importar con tus usuarios.",
|
||||
"import-show-user-mapping": "Revisión de la asignación de miembros",
|
||||
@@ -399,7 +399,7 @@
|
||||
"swimlaneActionPopup-title": "Acciones del carril de flujo",
|
||||
"swimlaneAddPopup-title": "Añadir un carril de flujo debajo",
|
||||
"listImportCardPopup-title": "Importar una tarjeta de Trello",
|
||||
"listImportCardsTsvPopup-title": "Import Excel CSV/TSV",
|
||||
"listImportCardsTsvPopup-title": "Importar CSV/TSV",
|
||||
"listMorePopup-title": "Más",
|
||||
"link-list": "Enlazar a esta lista",
|
||||
"list-delete-pop": "Todas las acciones serán eliminadas del historial de actividades y no se podrá recuperar la lista. Esta acción no puede deshacerse.",
|
||||
@@ -639,7 +639,7 @@
|
||||
"r-when-a-card": "Cuando una tarjeta",
|
||||
"r-is": "es",
|
||||
"r-is-moved": "es movida",
|
||||
"r-added-to": "Added to",
|
||||
"r-added-to": "Añadido a",
|
||||
"r-removed-from": "eliminado de",
|
||||
"r-the-board": "el tablero",
|
||||
"r-list": "la lista",
|
||||
@@ -687,7 +687,7 @@
|
||||
"r-of-checklist": "de la lista de verificación",
|
||||
"r-send-email": "Enviar un email",
|
||||
"r-to": "a",
|
||||
"r-of": "of",
|
||||
"r-of": "de",
|
||||
"r-subject": "asunto",
|
||||
"r-rule-details": "Detalle de la regla",
|
||||
"r-d-move-to-top-gen": "Mover la tarjeta al inicio de su lista",
|
||||
@@ -787,10 +787,10 @@
|
||||
"view-all": "Ver todo",
|
||||
"filter-by-unread": "Filtrar por no leído",
|
||||
"mark-all-as-read": "Marcar todo como leido",
|
||||
"remove-all-read": "Remove all read",
|
||||
"remove-all-read": "Eliminar todos los leídos",
|
||||
"allow-rename": "Permitir renombrar",
|
||||
"allowRenamePopup-title": "Permitir renombrar",
|
||||
"start-day-of-week": "Set day of the week start",
|
||||
"start-day-of-week": "Establecer el dia de comienzo de la semana",
|
||||
"monday": "Lunes",
|
||||
"tuesday": "Martes",
|
||||
"wednesday": "Miércoles",
|
||||
@@ -798,13 +798,13 @@
|
||||
"friday": "Viernes",
|
||||
"saturday": "Sábado",
|
||||
"sunday": "Domingo",
|
||||
"status": "Status",
|
||||
"swimlane": "Swimlane",
|
||||
"owner": "Owner",
|
||||
"last-modified-at": "Last modified at",
|
||||
"last-activity": "Last activity",
|
||||
"voting": "Voting",
|
||||
"archived": "Archived",
|
||||
"delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
|
||||
"delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
|
||||
"status": "Estado",
|
||||
"swimlane": "Carril",
|
||||
"owner": "Propietario",
|
||||
"last-modified-at": "Última modificación ",
|
||||
"last-activity": "Última actividad",
|
||||
"voting": "Votar",
|
||||
"archived": "Archivado",
|
||||
"delete-linked-card-before-this-card": "No puede borrar esta tarjeta antes de borrar la tarjeta enlazada que tiene",
|
||||
"delete-linked-cards-before-this-list": "No puede borrar esta lista antes de borrar las tarjetas enlazadas que apuntan a tarjetas en esta lista"
|
||||
}
|
||||
+1
-1
@@ -805,6 +805,6 @@
|
||||
"last-activity": "פעילות אחרונה",
|
||||
"voting": "הצבעה",
|
||||
"archived": "בארכיון",
|
||||
"delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
|
||||
"delete-linked-card-before-this-card": "לא ניתן למחוק את הכרטיס הזה לפני שמוחקים את הכרטיס המקושר שיש לו",
|
||||
"delete-linked-cards-before-this-list": "לא ניתן למחוק את הרשימה הזו לפני שמוחקים את הכרטיסים שמצביעים לכרטיסים ברשימה הזו"
|
||||
}
|
||||
+24
-24
@@ -164,15 +164,15 @@
|
||||
"cardStartVotingPopup-title": "Inizia una votazione",
|
||||
"positiveVoteMembersPopup-title": "Favorevoli",
|
||||
"negativeVoteMembersPopup-title": "Contrari",
|
||||
"card-edit-voting": "Edit voting",
|
||||
"editVoteEndDatePopup-title": "Change vote end date",
|
||||
"allowNonBoardMembers": "Allow all logged in users",
|
||||
"card-edit-voting": "Modifica la votazione",
|
||||
"editVoteEndDatePopup-title": "Cambia data di termine voto",
|
||||
"allowNonBoardMembers": "Consenti tutti gli utenti registrati",
|
||||
"vote-question": "Domanda di votazione",
|
||||
"vote-public": "Mostrare chi ha votato cosa",
|
||||
"vote-for-it": "a favore",
|
||||
"vote-against": "contro",
|
||||
"deleteVotePopup-title": "Delete vote?",
|
||||
"vote-delete-pop": "Deleting is permanent. You will lose all actions associated with this vote.",
|
||||
"deleteVotePopup-title": "Eliminare il voto?",
|
||||
"vote-delete-pop": "L'eliminazione è permanente. Tutte le azioni associate a questa votazione andranno perse.",
|
||||
"cardDeletePopup-title": "Elimina scheda?",
|
||||
"cardDetailsActionsPopup-title": "Azioni scheda",
|
||||
"cardLabelsPopup-title": "Etichette",
|
||||
@@ -309,7 +309,7 @@
|
||||
"error-board-notAMember": "Devi essere un membro di questa bacheca per poterlo fare",
|
||||
"error-json-malformed": "Il tuo testo non è un JSON valido",
|
||||
"error-json-schema": "Il tuo file JSON non contiene le giuste informazioni nel formato corretto",
|
||||
"error-csv-schema": "Your CSV(Comma Separated Values)/TSV (Tab Separated Values) does not include the proper information in the correct format",
|
||||
"error-csv-schema": "Il tuo file CSV(Comma Separated Values)/TSV (Tab Separated Values) non contiene le giuste informazioni nel formato corretto ",
|
||||
"error-list-doesNotExist": "Questa lista non esiste",
|
||||
"error-user-doesNotExist": "Questo utente non esiste",
|
||||
"error-user-notAllowSelf": "Non puoi invitare te stesso",
|
||||
@@ -317,10 +317,10 @@
|
||||
"error-username-taken": "Questo username è già utilizzato",
|
||||
"error-email-taken": "L'email è già stata presa",
|
||||
"export-board": "Esporta bacheca",
|
||||
"export-board-json": "Export board to JSON",
|
||||
"export-board-csv": "Export board to CSV",
|
||||
"export-board-tsv": "Export board to TSV",
|
||||
"export-board-html": "Export board to HTML",
|
||||
"export-board-json": "Esporta bacheca in JSON",
|
||||
"export-board-csv": "Esporta bacheca in CSV",
|
||||
"export-board-tsv": "Esporta bacheca in TSV",
|
||||
"export-board-html": "Esporta bacheca in HTML",
|
||||
"exportBoardPopup-title": "Esporta bacheca",
|
||||
"sort": "Ordina",
|
||||
"sort-desc": "Clicca per ordinare la lista",
|
||||
@@ -357,16 +357,16 @@
|
||||
"import-board-c": "Importa bacheca",
|
||||
"import-board-title-trello": "Importa una bacheca da Trello",
|
||||
"import-board-title-wekan": "Importa bacheca dall'esportazione precedente",
|
||||
"import-board-title-csv": "Import board from CSV/TSV",
|
||||
"import-board-title-csv": "Importa bacheca da CSV/TSV",
|
||||
"from-trello": "Da Trello",
|
||||
"from-wekan": "Dall'esportazione precedente",
|
||||
"from-csv": "From CSV/TSV",
|
||||
"from-csv": "Da CSV/TSV",
|
||||
"import-board-instruction-trello": "Nella tua bacheca Trello vai a 'Menu', poi 'Altro', 'Stampa ed esporta', 'Esporta JSON', e copia il testo che compare.",
|
||||
"import-board-instruction-csv": "Paste in your Comma Separated Values(CSV)/ Tab Separated Values (TSV) .",
|
||||
"import-board-instruction-csv": "Incolla in Comma Separated Values (CSV) / Tab Separated Values (TSV) .",
|
||||
"import-board-instruction-wekan": "Nella tua bacheca vai su \"Menu\", poi \"Esporta la bacheca\", e copia il testo nel file scaricato",
|
||||
"import-board-instruction-about-errors": "Se hai degli errori quando importi una bacheca, qualche volta l'importazione funziona comunque, e la bacheca si trova nella pagina \"Tutte le bacheche\"",
|
||||
"import-json-placeholder": "Incolla un JSON valido qui",
|
||||
"import-csv-placeholder": "Paste your valid CSV/TSV data here",
|
||||
"import-csv-placeholder": "Incolla un CSV/TSV valido qui",
|
||||
"import-map-members": "Mappatura dei membri",
|
||||
"import-members-map": "La bacheca che hai importato contiene alcuni membri. Per favore scegli i membri che vuoi importare tra i tuoi utenti",
|
||||
"import-show-user-mapping": "Rivedi la mappatura dei membri",
|
||||
@@ -399,7 +399,7 @@
|
||||
"swimlaneActionPopup-title": "Azioni diagramma Swimlane",
|
||||
"swimlaneAddPopup-title": "Aggiungi un diagramma Swimlane di seguito",
|
||||
"listImportCardPopup-title": "Importa una scheda di Trello",
|
||||
"listImportCardsTsvPopup-title": "Import Excel CSV/TSV",
|
||||
"listImportCardsTsvPopup-title": "Importa CSV/TSV",
|
||||
"listMorePopup-title": "Altro",
|
||||
"link-list": "Link a questa lista",
|
||||
"list-delete-pop": "Tutte le azioni saranno rimosse dal flusso attività e non sarai in grado di recuperare la lista. Non potrai tornare indietro.",
|
||||
@@ -639,7 +639,7 @@
|
||||
"r-when-a-card": "Quando una scheda",
|
||||
"r-is": "è",
|
||||
"r-is-moved": "viene spostata",
|
||||
"r-added-to": "Added to",
|
||||
"r-added-to": "Aggiunto/a a",
|
||||
"r-removed-from": "Rimosso da",
|
||||
"r-the-board": "La bacheca",
|
||||
"r-list": "lista",
|
||||
@@ -798,13 +798,13 @@
|
||||
"friday": "Venerdi",
|
||||
"saturday": "Sabato",
|
||||
"sunday": "Domenica",
|
||||
"status": "Status",
|
||||
"status": "Stato",
|
||||
"swimlane": "Swimlane",
|
||||
"owner": "Owner",
|
||||
"last-modified-at": "Last modified at",
|
||||
"last-activity": "Last activity",
|
||||
"voting": "Voting",
|
||||
"archived": "Archived",
|
||||
"delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
|
||||
"delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
|
||||
"owner": "Proprietario",
|
||||
"last-modified-at": "Ultima modifica il",
|
||||
"last-activity": "Ultima attività",
|
||||
"voting": "Votazione",
|
||||
"archived": "Archiviato",
|
||||
"delete-linked-card-before-this-card": "Non puoi eliminare questa scheda prima di avere eliminato una scheda collegata che ha",
|
||||
"delete-linked-cards-before-this-list": "Non puoi eliminare questa lista prima di avere eliminato le schede collegate che puntano su schede in questa lista"
|
||||
}
|
||||
+24
-24
@@ -164,15 +164,15 @@
|
||||
"cardStartVotingPopup-title": "Zacznij głosowanie",
|
||||
"positiveVoteMembersPopup-title": "Zwolennicy",
|
||||
"negativeVoteMembersPopup-title": "Przeciwnicy",
|
||||
"card-edit-voting": "Edit voting",
|
||||
"editVoteEndDatePopup-title": "Change vote end date",
|
||||
"allowNonBoardMembers": "Allow all logged in users",
|
||||
"card-edit-voting": "Edytuj głosowanie",
|
||||
"editVoteEndDatePopup-title": "Zmień głos oraz datę",
|
||||
"allowNonBoardMembers": "Pozwól wszystkim zalogowanym użytkownikom",
|
||||
"vote-question": "Pytanie do głosowania",
|
||||
"vote-public": "Pokaż, kto głosował na wybrane opcje",
|
||||
"vote-for-it": "za",
|
||||
"vote-against": "przeciwko",
|
||||
"deleteVotePopup-title": "Delete vote?",
|
||||
"vote-delete-pop": "Deleting is permanent. You will lose all actions associated with this vote.",
|
||||
"deleteVotePopup-title": "Usunąć głos?",
|
||||
"vote-delete-pop": "Usuwanie jest nieodwracalne. Stracisz wszystkie czynności związane z tym głosem.",
|
||||
"cardDeletePopup-title": "Usunąć kartę?",
|
||||
"cardDetailsActionsPopup-title": "Czynności kart",
|
||||
"cardLabelsPopup-title": "Etykiety",
|
||||
@@ -309,7 +309,7 @@
|
||||
"error-board-notAMember": "Musisz być członkiem tej tablicy, żeby wykonać tę czynność",
|
||||
"error-json-malformed": "Twoja fraza nie jest w formacie JSON",
|
||||
"error-json-schema": "Twoje dane JSON nie zawierają prawidłowych informacji w poprawnym formacie",
|
||||
"error-csv-schema": "Your CSV(Comma Separated Values)/TSV (Tab Separated Values) does not include the proper information in the correct format",
|
||||
"error-csv-schema": "Twój plik CSV(plik oddzielony przecinkami)/TSV (plik oddzielony tabulatorami) nie zawiera danych w poprawnym formacie",
|
||||
"error-list-doesNotExist": "Ta lista nie isnieje",
|
||||
"error-user-doesNotExist": "Ten użytkownik nie istnieje",
|
||||
"error-user-notAllowSelf": "Nie możesz zaprosić samego siebie",
|
||||
@@ -317,10 +317,10 @@
|
||||
"error-username-taken": "Ta nazwa jest już zajęta",
|
||||
"error-email-taken": "Adres email jest już zarezerwowany",
|
||||
"export-board": "Eksportuj tablicę",
|
||||
"export-board-json": "Export board to JSON",
|
||||
"export-board-csv": "Export board to CSV",
|
||||
"export-board-tsv": "Export board to TSV",
|
||||
"export-board-html": "Export board to HTML",
|
||||
"export-board-json": "Eksportuj tablicę do JSON",
|
||||
"export-board-csv": "Eksportuj tablicę do CSV",
|
||||
"export-board-tsv": "Eksportuj tablicę do TSV",
|
||||
"export-board-html": "Eksportuj tablicę do HTML",
|
||||
"exportBoardPopup-title": "Eksportuj tablicę",
|
||||
"sort": "Sortuj",
|
||||
"sort-desc": "Kliknij by sortować listę",
|
||||
@@ -357,16 +357,16 @@
|
||||
"import-board-c": "Import tablicy",
|
||||
"import-board-title-trello": "Importuj tablicę z Trello",
|
||||
"import-board-title-wekan": "Importuj tablicę z poprzedniego eksportu",
|
||||
"import-board-title-csv": "Import board from CSV/TSV",
|
||||
"import-board-title-csv": "Importuj tablicę z CSV/TSV",
|
||||
"from-trello": "Z Trello",
|
||||
"from-wekan": "Z poprzedniego eksportu",
|
||||
"from-csv": "From CSV/TSV",
|
||||
"from-csv": "Z CSV/TSV",
|
||||
"import-board-instruction-trello": "W twojej tablicy na Trello przejdź do 'Menu', następnie 'Więcej', 'Drukuj i eksportuj', 'Eksportuj jako JSON' i skopiuj wynik",
|
||||
"import-board-instruction-csv": "Paste in your Comma Separated Values(CSV)/ Tab Separated Values (TSV) .",
|
||||
"import-board-instruction-csv": "Wklej swoje dane w postaci wartości oddzielanych przecinkiem (CSV) lub tabulatorem (TSV)",
|
||||
"import-board-instruction-wekan": "Na Twojej tablicy przejdź do 'Menu', a następnie wybierz 'Eksportuj tablicę' i skopiuj tekst w pobranym pliku.",
|
||||
"import-board-instruction-about-errors": "W przypadku, gdy otrzymujesz błędy importowania tablicy, czasami importowanie pomimo wszystko działa poprawnie i tablica znajduje się w oknie Wszystkie tablice.",
|
||||
"import-json-placeholder": "Wklej Twoje dane JSON tutaj",
|
||||
"import-csv-placeholder": "Paste your valid CSV/TSV data here",
|
||||
"import-csv-placeholder": "Wklej swoje dane z pliku CSV/TSV tutaj",
|
||||
"import-map-members": "Przypisz członków",
|
||||
"import-members-map": "Twoje zaimportowane tablice mają kilku członków. Proszę wybierz członków których chcesz zaimportować dla Twoich użytkowników",
|
||||
"import-show-user-mapping": "Przejrzyj wybranych członków",
|
||||
@@ -399,7 +399,7 @@
|
||||
"swimlaneActionPopup-title": "Opcje diagramu czynności",
|
||||
"swimlaneAddPopup-title": "Dodaj diagram czynności poniżej",
|
||||
"listImportCardPopup-title": "Zaimportuj kartę z Trello",
|
||||
"listImportCardsTsvPopup-title": "Import Excel CSV/TSV",
|
||||
"listImportCardsTsvPopup-title": "Importuj CSV/TSV z Excela",
|
||||
"listMorePopup-title": "Więcej",
|
||||
"link-list": "Podepnij do tej listy",
|
||||
"list-delete-pop": "Wszystkie czynności zostaną usunięte z Aktywności i nie będziesz w stanie przywrócić listy. Nie ma możliwości cofnięcia tej operacji.",
|
||||
@@ -639,7 +639,7 @@
|
||||
"r-when-a-card": "Gdy karta",
|
||||
"r-is": "jest",
|
||||
"r-is-moved": "jest przenoszona",
|
||||
"r-added-to": "Added to",
|
||||
"r-added-to": "Dodany do",
|
||||
"r-removed-from": "usunął z",
|
||||
"r-the-board": "tablicy",
|
||||
"r-list": "lista",
|
||||
@@ -799,12 +799,12 @@
|
||||
"saturday": "Sobota",
|
||||
"sunday": "Niedziela",
|
||||
"status": "Status",
|
||||
"swimlane": "Swimlane",
|
||||
"owner": "Owner",
|
||||
"last-modified-at": "Last modified at",
|
||||
"last-activity": "Last activity",
|
||||
"voting": "Voting",
|
||||
"archived": "Archived",
|
||||
"delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
|
||||
"delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
|
||||
"swimlane": "Diagram czynności",
|
||||
"owner": "Właściciel",
|
||||
"last-modified-at": "Ostatnio zmodyfikowano",
|
||||
"last-activity": "Ostatnia aktywność",
|
||||
"voting": "Głosowanie",
|
||||
"archived": "Zarchiwizowany",
|
||||
"delete-linked-card-before-this-card": "Nie możesz usunąć tej karty, dopóki nie usuniesz podpiętej karty, w której są",
|
||||
"delete-linked-cards-before-this-list": "Nie możesz usunąć tej karty, dopóki nie usuniesz podpiętych kart, które wskazują na karty w tej liście"
|
||||
}
|
||||
+2
-2
@@ -805,6 +805,6 @@
|
||||
"last-activity": "Последние действия",
|
||||
"voting": "Голосование",
|
||||
"archived": "Архивировано",
|
||||
"delete-linked-card-before-this-card": "You can not delete this card before first deleting linked card that has",
|
||||
"delete-linked-cards-before-this-list": "You can not delete this list before first deleting linked cards that are pointing to cards in this list"
|
||||
"delete-linked-card-before-this-card": "Вы не можете удалить карточку, не удалив связанную c ней карточку, которая имеет ",
|
||||
"delete-linked-cards-before-this-list": "Вы не можете удалить этот список, не удалив карточки, которые указывают на карточки в этом списке"
|
||||
}
|
||||
@@ -747,7 +747,7 @@
|
||||
"error-ldap-login": "嘗試登入時出現錯誤",
|
||||
"display-authentication-method": "顯示認證方式",
|
||||
"default-authentication-method": "預設認證方式",
|
||||
"duplicate-board": "重複的看板",
|
||||
"duplicate-board": "複製看板",
|
||||
"people-number": "人數是:",
|
||||
"swimlaneDeletePopup-title": "是否刪除泳道?",
|
||||
"swimlane-delete-pop": "所有動作將從活動來源中刪除,您將無法恢復泳道。此操作無法還原。",
|
||||
|
||||
@@ -217,7 +217,7 @@ if (Meteor.isServer) {
|
||||
}
|
||||
if (activity.attachmentId) {
|
||||
const attachment = activity.attachment();
|
||||
params.attachment = attachment.original.name;
|
||||
params.attachment = attachment.name;
|
||||
params.attachmentId = attachment._id;
|
||||
}
|
||||
if (activity.checklistId) {
|
||||
|
||||
+109
-245
@@ -1,263 +1,127 @@
|
||||
const localFSStore = process.env.ATTACHMENTS_STORE_PATH;
|
||||
const storeName = 'attachments';
|
||||
const defaultStoreOptions = {
|
||||
beforeWrite: fileObj => {
|
||||
if (!fileObj.isImage()) {
|
||||
return {
|
||||
type: 'application/octet-stream',
|
||||
};
|
||||
}
|
||||
return {};
|
||||
},
|
||||
};
|
||||
let store;
|
||||
if (localFSStore) {
|
||||
// have to reinvent methods from FS.Store.GridFS and FS.Store.FileSystem
|
||||
const fs = Npm.require('fs');
|
||||
const path = Npm.require('path');
|
||||
const mongodb = Npm.require('mongodb');
|
||||
const Grid = Npm.require('gridfs-stream');
|
||||
// calulate the absolute path here, because FS.Store.FileSystem didn't expose the aboslutepath or FS.Store didn't expose api calls :(
|
||||
let pathname = localFSStore;
|
||||
/*eslint camelcase: ["error", {allow: ["__meteor_bootstrap__"]}] */
|
||||
import { FilesCollection } from 'meteor/ostrio:files';
|
||||
const fs = require('fs');
|
||||
|
||||
if (!pathname && __meteor_bootstrap__ && __meteor_bootstrap__.serverDir) {
|
||||
pathname = path.join(
|
||||
__meteor_bootstrap__.serverDir,
|
||||
`../../../cfs/files/${storeName}`,
|
||||
);
|
||||
}
|
||||
const collectionName = 'attachments2';
|
||||
|
||||
if (!pathname)
|
||||
throw new Error('FS.Store.FileSystem unable to determine path');
|
||||
|
||||
// Check if we have '~/foo/bar'
|
||||
if (pathname.split(path.sep)[0] === '~') {
|
||||
const homepath =
|
||||
process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
|
||||
if (homepath) {
|
||||
pathname = pathname.replace('~', homepath);
|
||||
} else {
|
||||
throw new Error('FS.Store.FileSystem unable to resolve "~" in path');
|
||||
}
|
||||
}
|
||||
|
||||
// Set absolute path
|
||||
const absolutePath = path.resolve(pathname);
|
||||
|
||||
const _FStore = new FS.Store.FileSystem(storeName, {
|
||||
path: localFSStore,
|
||||
...defaultStoreOptions,
|
||||
});
|
||||
const GStore = {
|
||||
fileKey(fileObj) {
|
||||
const key = {
|
||||
_id: null,
|
||||
filename: null,
|
||||
};
|
||||
|
||||
// If we're passed a fileObj, we retrieve the _id and filename from it.
|
||||
if (fileObj) {
|
||||
const info = fileObj._getInfo(storeName, {
|
||||
updateFileRecordFirst: false,
|
||||
});
|
||||
key._id = info.key || null;
|
||||
key.filename =
|
||||
info.name ||
|
||||
fileObj.name({ updateFileRecordFirst: false }) ||
|
||||
`${fileObj.collectionName}-${fileObj._id}`;
|
||||
}
|
||||
|
||||
// If key._id is null at this point, createWriteStream will let GridFS generate a new ID
|
||||
return key;
|
||||
},
|
||||
db: undefined,
|
||||
mongoOptions: { useNewUrlParser: true },
|
||||
mongoUrl: process.env.MONGO_URL,
|
||||
init() {
|
||||
this._init(err => {
|
||||
this.inited = !err;
|
||||
});
|
||||
},
|
||||
_init(callback) {
|
||||
const self = this;
|
||||
mongodb.MongoClient.connect(self.mongoUrl, self.mongoOptions, function(
|
||||
err,
|
||||
db,
|
||||
) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
self.db = db;
|
||||
return callback(null);
|
||||
});
|
||||
return;
|
||||
},
|
||||
createReadStream(fileKey, options) {
|
||||
const self = this;
|
||||
if (!self.inited) {
|
||||
self.init();
|
||||
return undefined;
|
||||
}
|
||||
options = options || {};
|
||||
|
||||
// Init GridFS
|
||||
const gfs = new Grid(self.db, mongodb);
|
||||
|
||||
// Set the default streamning settings
|
||||
const settings = {
|
||||
_id: new mongodb.ObjectID(fileKey._id),
|
||||
root: `cfs_gridfs.${storeName}`,
|
||||
};
|
||||
|
||||
// Check if this should be a partial read
|
||||
if (
|
||||
typeof options.start !== 'undefined' &&
|
||||
typeof options.end !== 'undefined'
|
||||
) {
|
||||
// Add partial info
|
||||
settings.range = {
|
||||
startPos: options.start,
|
||||
endPos: options.end,
|
||||
};
|
||||
}
|
||||
return gfs.createReadStream(settings);
|
||||
},
|
||||
};
|
||||
GStore.init();
|
||||
const CRS = 'createReadStream';
|
||||
const _CRS = `_${CRS}`;
|
||||
const FStore = _FStore._transform;
|
||||
FStore[_CRS] = FStore[CRS].bind(FStore);
|
||||
FStore[CRS] = function(fileObj, options) {
|
||||
let stream;
|
||||
try {
|
||||
const localFile = path.join(
|
||||
absolutePath,
|
||||
FStore.storage.fileKey(fileObj),
|
||||
);
|
||||
const state = fs.statSync(localFile);
|
||||
if (state) {
|
||||
stream = FStore[_CRS](fileObj, options);
|
||||
}
|
||||
} catch (e) {
|
||||
// file is not there, try GridFS ?
|
||||
stream = undefined;
|
||||
}
|
||||
if (stream) return stream;
|
||||
else {
|
||||
try {
|
||||
const stream = GStore[CRS](GStore.fileKey(fileObj), options);
|
||||
return stream;
|
||||
} catch (e) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}.bind(FStore);
|
||||
store = _FStore;
|
||||
} else {
|
||||
store = new FS.Store.GridFS(localFSStore ? `G${storeName}` : storeName, {
|
||||
// XXX Add a new store for cover thumbnails so we don't load big images in
|
||||
// the general board view
|
||||
// If the uploaded document is not an image we need to enforce browser
|
||||
// download instead of execution. This is particularly important for HTML
|
||||
// files that the browser will just execute if we don't serve them with the
|
||||
// appropriate `application/octet-stream` MIME header which can lead to user
|
||||
// data leaks. I imagine other formats (like PDF) can also be attack vectors.
|
||||
// See https://github.com/wekan/wekan/issues/99
|
||||
// XXX Should we use `beforeWrite` option of CollectionFS instead of
|
||||
// collection-hooks?
|
||||
// We should use `beforeWrite`.
|
||||
...defaultStoreOptions,
|
||||
});
|
||||
}
|
||||
Attachments = new FS.Collection('attachments', {
|
||||
stores: [store],
|
||||
Attachments = new FilesCollection({
|
||||
storagePath: storagePath(),
|
||||
debug: false,
|
||||
// allowClientCode: true,
|
||||
collectionName: 'attachments2',
|
||||
onAfterUpload: onAttachmentUploaded,
|
||||
onBeforeRemove: onAttachmentRemoving
|
||||
});
|
||||
|
||||
if (Meteor.isServer) {
|
||||
Meteor.startup(() => {
|
||||
Attachments.files._ensureIndex({ cardId: 1 });
|
||||
Attachments.collection._ensureIndex({ cardId: 1 });
|
||||
});
|
||||
|
||||
// TODO: Permission related
|
||||
Attachments.allow({
|
||||
insert(userId, doc) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
||||
insert() {
|
||||
return false;
|
||||
},
|
||||
update(userId, doc) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
||||
update() {
|
||||
return true;
|
||||
},
|
||||
remove(userId, doc) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
||||
},
|
||||
// We authorize the attachment download either:
|
||||
// - if the board is public, everyone (even unconnected) can download it
|
||||
// - if the board is private, only board members can download it
|
||||
download(userId, doc) {
|
||||
const board = Boards.findOne(doc.boardId);
|
||||
if (board.isPublic()) {
|
||||
return true;
|
||||
} else {
|
||||
return board.hasMember(userId);
|
||||
}
|
||||
},
|
||||
|
||||
fetch: ['boardId'],
|
||||
});
|
||||
}
|
||||
|
||||
// XXX Enforce a schema for the Attachments CollectionFS
|
||||
|
||||
if (Meteor.isServer) {
|
||||
Attachments.files.after.insert((userId, doc) => {
|
||||
// If the attachment doesn't have a source field
|
||||
// or its source is different than import
|
||||
if (!doc.source || doc.source !== 'import') {
|
||||
// Add activity about adding the attachment
|
||||
Activities.insert({
|
||||
userId,
|
||||
type: 'card',
|
||||
activityType: 'addAttachment',
|
||||
attachmentId: doc._id,
|
||||
// this preserves the name so that notifications can be meaningful after
|
||||
// this file is removed
|
||||
attachmentName: doc.original.name,
|
||||
boardId: doc.boardId,
|
||||
cardId: doc.cardId,
|
||||
listId: doc.listId,
|
||||
swimlaneId: doc.swimlaneId,
|
||||
});
|
||||
} else {
|
||||
// Don't add activity about adding the attachment as the activity
|
||||
// be imported and delete source field
|
||||
Attachments.update(
|
||||
{
|
||||
_id: doc._id,
|
||||
},
|
||||
{
|
||||
$unset: {
|
||||
source: '',
|
||||
},
|
||||
},
|
||||
);
|
||||
remove() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Attachments.files.before.remove((userId, doc) => {
|
||||
Activities.insert({
|
||||
userId,
|
||||
type: 'card',
|
||||
activityType: 'deleteAttachment',
|
||||
attachmentId: doc._id,
|
||||
// this preserves the name so that notifications can be meaningful after
|
||||
// this file is removed
|
||||
attachmentName: doc.original.name,
|
||||
boardId: doc.boardId,
|
||||
cardId: doc.cardId,
|
||||
listId: doc.listId,
|
||||
swimlaneId: doc.swimlaneId,
|
||||
});
|
||||
Meteor.methods({
|
||||
cloneAttachment(file, overrides) {
|
||||
check(file, Object);
|
||||
check(overrides, Match.Maybe(Object));
|
||||
const path = file.path;
|
||||
const opts = {
|
||||
fileName: file.name,
|
||||
type: file.type,
|
||||
meta: file.meta,
|
||||
userId: file.userId
|
||||
};
|
||||
for (let key in overrides) {
|
||||
if (key === 'meta') {
|
||||
for (let metaKey in overrides.meta) {
|
||||
opts.meta[metaKey] = overrides.meta[metaKey];
|
||||
}
|
||||
} else {
|
||||
opts[key] = overrides[key];
|
||||
}
|
||||
}
|
||||
const buffer = fs.readFileSync(path);
|
||||
Attachments.write(buffer, opts, (err, fileRef) => {
|
||||
if (err) {
|
||||
console.log('Error when cloning record', err);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Meteor.publish(collectionName, function() {
|
||||
return Attachments.find().cursor;
|
||||
});
|
||||
} else {
|
||||
Meteor.subscribe(collectionName);
|
||||
}
|
||||
|
||||
function storagePath(defaultPath) {
|
||||
const storePath = process.env.ATTACHMENTS_STORE_PATH;
|
||||
return storePath ? storePath : defaultPath;
|
||||
}
|
||||
|
||||
function onAttachmentUploaded(fileRef) {
|
||||
Attachments.update({_id:fileRef._id}, {$set: {"meta.uploading": false}});
|
||||
if (!fileRef.meta.source || fileRef.meta.source !== 'import') {
|
||||
// Add activity about adding the attachment
|
||||
Activities.insert({
|
||||
userId: fileRef.userId,
|
||||
type: 'card',
|
||||
activityType: 'addAttachment',
|
||||
attachmentId: fileRef._id,
|
||||
// this preserves the name so that notifications can be meaningful after
|
||||
// this file is removed
|
||||
attachmentName: fileRef.name,
|
||||
boardId: fileRef.meta.boardId,
|
||||
cardId: fileRef.meta.cardId,
|
||||
listId: fileRef.meta.listId,
|
||||
swimlaneId: fileRef.meta.swimlaneId,
|
||||
});
|
||||
} else {
|
||||
// Don't add activity about adding the attachment as the activity
|
||||
// be imported and delete source field
|
||||
Attachments.collection.update(
|
||||
{
|
||||
_id: fileRef._id,
|
||||
},
|
||||
{
|
||||
$unset: {
|
||||
'meta.source': '',
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function onAttachmentRemoving(cursor) {
|
||||
const file = cursor.get()[0];
|
||||
const meta = file.meta;
|
||||
Activities.insert({
|
||||
userId: this.userId,
|
||||
type: 'card',
|
||||
activityType: 'deleteAttachment',
|
||||
attachmentId: file._id,
|
||||
// this preserves the name so that notifications can be meaningful after
|
||||
// this file is removed
|
||||
attachmentName: file.name,
|
||||
boardId: meta.boardId,
|
||||
cardId: meta.cardId,
|
||||
listId: meta.listId,
|
||||
swimlaneId: meta.swimlaneId,
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
export default Attachments;
|
||||
@@ -255,6 +255,9 @@ Boards.attachSchema(
|
||||
'dark',
|
||||
'relax',
|
||||
'corteza',
|
||||
'clearblue',
|
||||
'natural',
|
||||
'modern',
|
||||
],
|
||||
// eslint-disable-next-line consistent-return
|
||||
autoValue() {
|
||||
|
||||
+13
-8
@@ -412,10 +412,14 @@ Cards.helpers({
|
||||
const _id = Cards.insert(this);
|
||||
|
||||
// Copy attachments
|
||||
oldCard.attachments().forEach(att => {
|
||||
att.cardId = _id;
|
||||
delete att._id;
|
||||
return Attachments.insert(att);
|
||||
oldCard.attachments().forEach((file) => {
|
||||
Meteor.call('cloneAttachment', file,
|
||||
{
|
||||
meta: {
|
||||
cardId: _id
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// copy checklists
|
||||
@@ -518,14 +522,15 @@ Cards.helpers({
|
||||
attachments() {
|
||||
if (this.isLinkedCard()) {
|
||||
return Attachments.find(
|
||||
{ cardId: this.linkedId },
|
||||
{ 'meta.cardId': this.linkedId },
|
||||
{ sort: { uploadedAt: -1 } },
|
||||
);
|
||||
} else {
|
||||
return Attachments.find(
|
||||
{ cardId: this._id },
|
||||
let ret = Attachments.find(
|
||||
{ 'meta.cardId': this._id },
|
||||
{ sort: { uploadedAt: -1 } },
|
||||
);
|
||||
return ret;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -533,7 +538,7 @@ Cards.helpers({
|
||||
const cover = Attachments.findOne(this.coverId);
|
||||
// if we return a cover before it is fully stored, we will get errors when we try to display it
|
||||
// todo XXX we could return a default "upload pending" image in the meantime?
|
||||
return cover && cover.url() && cover;
|
||||
return cover && cover.link();
|
||||
},
|
||||
|
||||
checklists() {
|
||||
|
||||
+197
-51
@@ -1,4 +1,3 @@
|
||||
import { Exporter } from './exporter';
|
||||
/* global JsonRoutes */
|
||||
if (Meteor.isServer) {
|
||||
// todo XXX once we have a real API in place, move that route there
|
||||
@@ -8,10 +7,10 @@ if (Meteor.isServer) {
|
||||
// on the client instead of copy/pasting the route path manually between the
|
||||
// client and the server.
|
||||
/**
|
||||
* @operation exportJson
|
||||
* @operation export
|
||||
* @tag Boards
|
||||
*
|
||||
* @summary This route is used to export the board to a json file format.
|
||||
* @summary This route is used to export the board.
|
||||
*
|
||||
* @description If user is already logged-in, pass loginToken as param
|
||||
* "authToken": '/api/boards/:boardId/export?authToken=:token'
|
||||
@@ -47,52 +46,199 @@ if (Meteor.isServer) {
|
||||
JsonRoutes.sendResult(res, 403);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @operation exportCSV/TSV
|
||||
* @tag Boards
|
||||
*
|
||||
* @summary This route is used to export the board to a CSV or TSV file format.
|
||||
*
|
||||
* @description If user is already logged-in, pass loginToken as param
|
||||
*
|
||||
* See https://blog.kayla.com.au/server-side-route-authentication-in-meteor/
|
||||
* for detailed explanations
|
||||
*
|
||||
* @param {string} boardId the ID of the board we are exporting
|
||||
* @param {string} authToken the loginToken
|
||||
* @param {string} delimiter delimiter to use while building export. Default is comma ','
|
||||
*/
|
||||
Picker.route('/api/boards/:boardId/export/csv', function(params, req, res) {
|
||||
const boardId = params.boardId;
|
||||
let user = null;
|
||||
const loginToken = params.query.authToken;
|
||||
if (loginToken) {
|
||||
const hashToken = Accounts._hashLoginToken(loginToken);
|
||||
user = Meteor.users.findOne({
|
||||
'services.resume.loginTokens.hashedToken': hashToken,
|
||||
});
|
||||
} else if (!Meteor.settings.public.sandstorm) {
|
||||
Authentication.checkUserId(req.userId);
|
||||
user = Users.findOne({
|
||||
_id: req.userId,
|
||||
isAdmin: true,
|
||||
});
|
||||
}
|
||||
const exporter = new Exporter(boardId);
|
||||
if (exporter.canExport(user)) {
|
||||
body = params.query.delimiter
|
||||
? exporter.buildCsv(params.query.delimiter)
|
||||
: exporter.buildCsv();
|
||||
res.writeHead(200, {
|
||||
'Content-Length': body[0].length,
|
||||
'Content-Type': params.query.delimiter ? 'text/csv' : 'text/tsv',
|
||||
});
|
||||
res.write(body[0]);
|
||||
res.end();
|
||||
} else {
|
||||
res.writeHead(403);
|
||||
res.end('Permission Error');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// exporter maybe is broken since Gridfs introduced, add fs and path
|
||||
|
||||
export class Exporter {
|
||||
constructor(boardId) {
|
||||
this._boardId = boardId;
|
||||
}
|
||||
|
||||
build() {
|
||||
const fs = Npm.require('fs');
|
||||
const os = Npm.require('os');
|
||||
const path = Npm.require('path');
|
||||
|
||||
const byBoard = { boardId: this._boardId };
|
||||
const byBoardNoLinked = {
|
||||
boardId: this._boardId,
|
||||
linkedId: { $in: ['', null] },
|
||||
};
|
||||
// we do not want to retrieve boardId in related elements
|
||||
const noBoardId = {
|
||||
fields: {
|
||||
boardId: 0,
|
||||
},
|
||||
};
|
||||
const result = {
|
||||
_format: 'wekan-board-1.0.0',
|
||||
};
|
||||
_.extend(
|
||||
result,
|
||||
Boards.findOne(this._boardId, {
|
||||
fields: {
|
||||
stars: 0,
|
||||
},
|
||||
}),
|
||||
);
|
||||
result.lists = Lists.find(byBoard, noBoardId).fetch();
|
||||
result.cards = Cards.find(byBoardNoLinked, noBoardId).fetch();
|
||||
result.swimlanes = Swimlanes.find(byBoard, noBoardId).fetch();
|
||||
result.customFields = CustomFields.find(
|
||||
{ boardIds: { $in: [this.boardId] } },
|
||||
{ fields: { boardId: 0 } },
|
||||
).fetch();
|
||||
result.comments = CardComments.find(byBoard, noBoardId).fetch();
|
||||
result.activities = Activities.find(byBoard, noBoardId).fetch();
|
||||
result.rules = Rules.find(byBoard, noBoardId).fetch();
|
||||
result.checklists = [];
|
||||
result.checklistItems = [];
|
||||
result.subtaskItems = [];
|
||||
result.triggers = [];
|
||||
result.actions = [];
|
||||
result.cards.forEach(card => {
|
||||
result.checklists.push(
|
||||
...Checklists.find({
|
||||
cardId: card._id,
|
||||
}).fetch(),
|
||||
);
|
||||
result.checklistItems.push(
|
||||
...ChecklistItems.find({
|
||||
cardId: card._id,
|
||||
}).fetch(),
|
||||
);
|
||||
result.subtaskItems.push(
|
||||
...Cards.find({
|
||||
parentId: card._id,
|
||||
}).fetch(),
|
||||
);
|
||||
});
|
||||
result.rules.forEach(rule => {
|
||||
result.triggers.push(
|
||||
...Triggers.find(
|
||||
{
|
||||
_id: rule.triggerId,
|
||||
},
|
||||
noBoardId,
|
||||
).fetch(),
|
||||
);
|
||||
result.actions.push(
|
||||
...Actions.find(
|
||||
{
|
||||
_id: rule.actionId,
|
||||
},
|
||||
noBoardId,
|
||||
).fetch(),
|
||||
);
|
||||
});
|
||||
|
||||
// [Old] for attachments we only export IDs and absolute url to original doc
|
||||
// [New] Encode attachment to base64
|
||||
|
||||
const getBase64Data = function(doc, callback) {
|
||||
let buffer = Buffer.allocUnsafe(0);
|
||||
buffer.fill(0);
|
||||
|
||||
// callback has the form function (err, res) {}
|
||||
const tmpFile = path.join(
|
||||
os.tmpdir(),
|
||||
`tmpexport${process.pid}${Math.random()}`,
|
||||
);
|
||||
const tmpWriteable = fs.createWriteStream(tmpFile);
|
||||
const readStream = fs.createReadStream(doc.path);
|
||||
readStream.on('data', function(chunk) {
|
||||
buffer = Buffer.concat([buffer, chunk]);
|
||||
});
|
||||
|
||||
readStream.on('error', function(err) {
|
||||
callback(null, null);
|
||||
});
|
||||
readStream.on('end', function() {
|
||||
// done
|
||||
fs.unlink(tmpFile, () => {
|
||||
//ignored
|
||||
});
|
||||
|
||||
callback(null, buffer.toString('base64'));
|
||||
});
|
||||
readStream.pipe(tmpWriteable);
|
||||
};
|
||||
const getBase64DataSync = Meteor.wrapAsync(getBase64Data);
|
||||
result.attachments = Attachments.find({ 'meta.boardId': byBoard.boardId })
|
||||
.fetch()
|
||||
.map(attachment => {
|
||||
let filebase64 = null;
|
||||
filebase64 = getBase64DataSync(attachment);
|
||||
|
||||
return {
|
||||
_id: attachment._id,
|
||||
cardId: attachment.meta.cardId,
|
||||
//url: FlowRouter.url(attachment.url()),
|
||||
file: filebase64,
|
||||
name: attachment.name,
|
||||
type: attachment.type,
|
||||
};
|
||||
});
|
||||
|
||||
// we also have to export some user data - as the other elements only
|
||||
// include id but we have to be careful:
|
||||
// 1- only exports users that are linked somehow to that board
|
||||
// 2- do not export any sensitive information
|
||||
const users = {};
|
||||
result.members.forEach(member => {
|
||||
users[member.userId] = true;
|
||||
});
|
||||
result.lists.forEach(list => {
|
||||
users[list.userId] = true;
|
||||
});
|
||||
result.cards.forEach(card => {
|
||||
users[card.userId] = true;
|
||||
if (card.members) {
|
||||
card.members.forEach(memberId => {
|
||||
users[memberId] = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
result.comments.forEach(comment => {
|
||||
users[comment.userId] = true;
|
||||
});
|
||||
result.activities.forEach(activity => {
|
||||
users[activity.userId] = true;
|
||||
});
|
||||
result.checklists.forEach(checklist => {
|
||||
users[checklist.userId] = true;
|
||||
});
|
||||
const byUserIds = {
|
||||
_id: {
|
||||
$in: Object.getOwnPropertyNames(users),
|
||||
},
|
||||
};
|
||||
// we use whitelist to be sure we do not expose inadvertently
|
||||
// some secret fields that gets added to User later.
|
||||
const userFields = {
|
||||
fields: {
|
||||
_id: 1,
|
||||
username: 1,
|
||||
'profile.fullname': 1,
|
||||
'profile.initials': 1,
|
||||
'profile.avatarUrl': 1,
|
||||
},
|
||||
};
|
||||
result.users = Users.find(byUserIds, userFields)
|
||||
.fetch()
|
||||
.map(user => {
|
||||
// user avatar is stored as a relative url, we export absolute
|
||||
if ((user.profile || {}).avatarUrl) {
|
||||
user.profile.avatarUrl = FlowRouter.url(user.profile.avatarUrl);
|
||||
}
|
||||
return user;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
canExport(user) {
|
||||
const board = Boards.findOne(this._boardId);
|
||||
return board && board.isVisibleBy(user);
|
||||
}
|
||||
}
|
||||
@@ -369,6 +369,7 @@ export class TrelloCreator {
|
||||
// so we make it server only, and let UI catch up once it is done, forget about latency comp.
|
||||
const self = this;
|
||||
if (Meteor.isServer) {
|
||||
// FIXME: Change to new model
|
||||
file.attachData(att.url, function(error) {
|
||||
file.boardId = boardId;
|
||||
file.cardId = cardId;
|
||||
|
||||
@@ -415,6 +415,7 @@ export class WekanCreator {
|
||||
const self = this;
|
||||
if (Meteor.isServer) {
|
||||
if (att.url) {
|
||||
// FIXME: Change to new file library
|
||||
file.attachData(att.url, function(error) {
|
||||
file.boardId = boardId;
|
||||
file.cardId = cardId;
|
||||
@@ -440,6 +441,7 @@ export class WekanCreator {
|
||||
}
|
||||
});
|
||||
} else if (att.file) {
|
||||
// FIXME: Change to new file library
|
||||
file.attachData(
|
||||
Buffer.from(att.file, 'base64'),
|
||||
{
|
||||
|
||||
Generated
+43
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wekan",
|
||||
"version": "v4.02.0",
|
||||
"version": "v4.04.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -1744,6 +1744,14 @@
|
||||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
|
||||
"dev": true
|
||||
},
|
||||
"fibers": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/fibers/-/fibers-4.0.2.tgz",
|
||||
"integrity": "sha512-FhICi1K4WZh9D6NC18fh2ODF3EWy1z0gzIdV9P7+s2pRjfRBnCkMDJ6x3bV1DkVymKH8HGrQa/FNOBjYvnJ/tQ==",
|
||||
"requires": {
|
||||
"detect-libc": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"figures": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
|
||||
@@ -2039,6 +2047,11 @@
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
||||
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
|
||||
},
|
||||
"import-fresh": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
|
||||
@@ -2460,6 +2473,17 @@
|
||||
"minimist": "^1.2.5"
|
||||
}
|
||||
},
|
||||
"jszip": {
|
||||
"version": "3.4.0",
|
||||
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.4.0.tgz",
|
||||
"integrity": "sha512-gZAOYuPl4EhPTXT0GjhI3o+ZAz3su6EhLrKUoAivcKqyqC7laS5JEv4XWZND9BgcDcF83vI85yGbDmDR6UhrIg==",
|
||||
"requires": {
|
||||
"lie": "~3.3.0",
|
||||
"pako": "~1.0.2",
|
||||
"readable-stream": "~2.3.6",
|
||||
"set-immediate-shim": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"kind-of": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
|
||||
@@ -2514,6 +2538,14 @@
|
||||
"type-check": "~0.3.2"
|
||||
}
|
||||
},
|
||||
"lie": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
|
||||
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
|
||||
"requires": {
|
||||
"immediate": "~3.0.5"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-7.3.0.tgz",
|
||||
@@ -3869,6 +3901,11 @@
|
||||
"path-to-regexp": "~1.2.1"
|
||||
}
|
||||
},
|
||||
"pako": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"papaparse": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.2.0.tgz",
|
||||
@@ -4330,6 +4367,11 @@
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
},
|
||||
"set-immediate-shim": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
|
||||
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E="
|
||||
},
|
||||
"set-value": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wekan",
|
||||
"version": "v4.02.0",
|
||||
"version": "v4.04.0",
|
||||
"description": "Open-Source kanban",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -66,6 +66,7 @@
|
||||
"es6-promise": "^4.2.4",
|
||||
"flatted": "^2.0.1",
|
||||
"gridfs-stream": "^0.5.3",
|
||||
"jszip": "^3.4.0",
|
||||
"ldapjs": "^1.0.2",
|
||||
"meteor-node-stubs": "^0.4.1",
|
||||
"mongodb": "^3.5.7",
|
||||
|
||||
+336
-324
File diff suppressed because it is too large.
Load diff
@@ -1,7 +1,7 @@
|
||||
swagger: '2.0'
|
||||
info:
|
||||
title: Wekan REST API
|
||||
version: v4.02
|
||||
version: v4.04
|
||||
description: |
|
||||
The REST API allows you to control and extend Wekan with ease.
|
||||
|
||||
@@ -797,8 +797,8 @@ paths:
|
||||
200 response
|
||||
/api/boards/{board}/export:
|
||||
get:
|
||||
operationId: exportJson
|
||||
summary: This route is used to export the board to a json file format.
|
||||
operationId: export
|
||||
summary: This route is used to export the board.
|
||||
description: |
|
||||
If user is already logged-in, pass loginToken as param
|
||||
"authToken": '/api/boards/:boardId/export?authToken=:token'
|
||||
@@ -2078,6 +2078,9 @@ definitions:
|
||||
- dark
|
||||
- relax
|
||||
- corteza
|
||||
- clearblue
|
||||
- natural
|
||||
- modern
|
||||
description:
|
||||
description: |
|
||||
The description of the board
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
+64
-64
@@ -1,64 +1,64 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM NOTE: You can try this to install Meteor on Windows, it works:
|
||||
REM https://github.com/zodern/windows-meteor-installer/
|
||||
|
||||
REM Installing Meteor with Chocolatey does not currently work.
|
||||
|
||||
REM NOTE: THIS .BAT DOES NOT WORK !!
|
||||
REM Use instead this webpage instructions to build on Windows:
|
||||
REM https://github.com/wekan/wekan/wiki/Install-Wekan-from-source-on-Windows
|
||||
REM Please add fix PRs, like config of MongoDB etc.
|
||||
|
||||
md C:\repos
|
||||
cd C:\repos
|
||||
|
||||
REM Install chocolatey
|
||||
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
|
||||
|
||||
choco install -y git curl python2 dotnet4.5.2 nano mongodb-3 mongoclient meteor
|
||||
|
||||
curl -O https://nodejs.org/dist/v12.16.3/node-v12.16.2-x64.msi
|
||||
call node-v12.16.3-x64.msi
|
||||
|
||||
call npm config -g set msvs_version 2015
|
||||
call meteor npm config -g set msvs_version 2015
|
||||
|
||||
call npm -g install npm
|
||||
call npm -g install node-gyp
|
||||
call npm -g install fibers
|
||||
cd C:\repos
|
||||
git clone https://github.com/wekan/wekan.git
|
||||
cd wekan
|
||||
git checkout edge
|
||||
echo "Building Wekan."
|
||||
REM del /S /F /Q packages
|
||||
REM ## REPOS BELOW ARE INCLUDED TO WEKAN
|
||||
REM md packages
|
||||
REM cd packages
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/flow-router.git kadira-flow-router
|
||||
REM git clone --depth 1 -b master https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-cas.git
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/wekan-ldap.git
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/wekan-scrollbar.git
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-oidc.git
|
||||
REM git clone --depth 1 -b master --recurse-submodules https://github.com/wekan/markdown.git
|
||||
REM move meteor-accounts-oidc/packages/switch_accounts-oidc wekan_accounts-oidc
|
||||
REM move meteor-accounts-oidc/packages/switch_oidc wekan_oidc
|
||||
REM del /S /F /Q meteor-accounts-oidc
|
||||
REM sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
|
||||
cd ..
|
||||
REM del /S /F /Q node_modules
|
||||
call meteor npm install
|
||||
REM del /S /F /Q .build
|
||||
call meteor build .build --directory
|
||||
copy fix-download-unicode\cfs_access-point.txt .build\bundle\programs\server\packages\cfs_access-point.js
|
||||
REM ## Remove legacy webbroser bundle, so that Wekan works also at Android Firefox, iOS Safari, etc.
|
||||
del /S /F /Q rm .build/bundle/programs/web.browser.legacy
|
||||
REM ## Install some NPM packages
|
||||
cd .build\bundle\programs\server
|
||||
call meteor npm install
|
||||
REM cd C:\repos\wekan\.meteor\local\build\programs\server
|
||||
REM del node_modules
|
||||
cd C:\repos\wekan
|
||||
call start-wekan.bat
|
||||
@ECHO OFF
|
||||
|
||||
REM NOTE: You can try this to install Meteor on Windows, it works:
|
||||
REM https://github.com/zodern/windows-meteor-installer/
|
||||
|
||||
REM Installing Meteor with Chocolatey does not currently work.
|
||||
|
||||
REM NOTE: THIS .BAT DOES NOT WORK !!
|
||||
REM Use instead this webpage instructions to build on Windows:
|
||||
REM https://github.com/wekan/wekan/wiki/Install-Wekan-from-source-on-Windows
|
||||
REM Please add fix PRs, like config of MongoDB etc.
|
||||
|
||||
md C:\repos
|
||||
cd C:\repos
|
||||
|
||||
REM Install chocolatey
|
||||
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
|
||||
|
||||
choco install -y git curl python2 dotnet4.5.2 nano mongodb-3 mongoclient meteor
|
||||
|
||||
curl -O https://nodejs.org/dist/v12.16.3/node-v12.16.2-x64.msi
|
||||
call node-v12.16.3-x64.msi
|
||||
|
||||
call npm config -g set msvs_version 2015
|
||||
call meteor npm config -g set msvs_version 2015
|
||||
|
||||
call npm -g install npm
|
||||
call npm -g install node-gyp
|
||||
call npm -g install fibers
|
||||
cd C:\repos
|
||||
git clone https://github.com/wekan/wekan.git
|
||||
cd wekan
|
||||
git checkout edge
|
||||
echo "Building Wekan."
|
||||
REM del /S /F /Q packages
|
||||
REM ## REPOS BELOW ARE INCLUDED TO WEKAN
|
||||
REM md packages
|
||||
REM cd packages
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/flow-router.git kadira-flow-router
|
||||
REM git clone --depth 1 -b master https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-cas.git
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/wekan-ldap.git
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/wekan-scrollbar.git
|
||||
REM git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-oidc.git
|
||||
REM git clone --depth 1 -b master --recurse-submodules https://github.com/wekan/markdown.git
|
||||
REM move meteor-accounts-oidc/packages/switch_accounts-oidc wekan_accounts-oidc
|
||||
REM move meteor-accounts-oidc/packages/switch_oidc wekan_oidc
|
||||
REM del /S /F /Q meteor-accounts-oidc
|
||||
REM sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
|
||||
cd ..
|
||||
REM del /S /F /Q node_modules
|
||||
call meteor npm install
|
||||
REM del /S /F /Q .build
|
||||
call meteor build .build --directory
|
||||
copy fix-download-unicode\cfs_access-point.txt .build\bundle\programs\server\packages\cfs_access-point.js
|
||||
REM ## Remove legacy webbroser bundle, so that Wekan works also at Android Firefox, iOS Safari, etc.
|
||||
del /S /F /Q rm .build/bundle/programs/web.browser.legacy
|
||||
REM ## Install some NPM packages
|
||||
cd .build\bundle\programs\server
|
||||
call meteor npm install
|
||||
REM cd C:\repos\wekan\.meteor\local\build\programs\server
|
||||
REM del node_modules
|
||||
cd C:\repos\wekan
|
||||
call start-wekan.bat
|
||||
@@ -22,10 +22,10 @@ const pkgdef :Spk.PackageDefinition = (
|
||||
appTitle = (defaultText = "Wekan"),
|
||||
# The name of the app as it is displayed to the user.
|
||||
|
||||
appVersion = 402,
|
||||
appVersion = 404,
|
||||
# Increment this for every release.
|
||||
|
||||
appMarketingVersion = (defaultText = "4.02.0~2020-05-15"),
|
||||
appMarketingVersion = (defaultText = "4.04.0~2020-05-24"),
|
||||
# Human-readable presentation of the app version.
|
||||
|
||||
minUpgradableAppVersion = 0,
|
||||
@@ -261,6 +261,7 @@ const myCommand :Spk.Manifest.Command = (
|
||||
(key = "LDAP_ENABLE", value="false"),
|
||||
(key = "PASSWORD_LOGIN_ENABLED", value="true"),
|
||||
(key = "SANDSTORM", value="1"),
|
||||
(key = "METEOR_SETTINGS", value = "{\"public\": {\"sandstorm\": true}}")
|
||||
(key = "METEOR_SETTINGS", value = "{\"public\": {\"sandstorm\": true}}"),
|
||||
(key = "ATTACHMENTS_STORE_PATH", value = "/var/attachments/")
|
||||
]
|
||||
);
|
||||
+47
-1
@@ -80,7 +80,7 @@ Migrations.add('lowercase-board-permission', () => {
|
||||
Migrations.add('change-attachments-type-for-non-images', () => {
|
||||
const newTypeForNonImage = 'application/octet-stream';
|
||||
Attachments.find().forEach(file => {
|
||||
if (!file.isImage()) {
|
||||
if (!file.isImage) {
|
||||
Attachments.update(
|
||||
file._id,
|
||||
{
|
||||
@@ -119,6 +119,9 @@ Migrations.add('use-css-class-for-boards-colors', () => {
|
||||
'#2C3E51': 'dark',
|
||||
'#27AE61': 'relax',
|
||||
'#568BA2': 'corteza',
|
||||
'#499BEA': 'clearblue',
|
||||
'#596557': 'natural',
|
||||
'#2A80B8': 'modern',
|
||||
};
|
||||
Boards.find().forEach(board => {
|
||||
const oldBoardColor = board.background.color;
|
||||
@@ -1041,3 +1044,46 @@ Migrations.add('add-sort-field-to-boards', () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
import { MongoInternals } from 'meteor/mongo';
|
||||
|
||||
Migrations.add('change-attachment-library', () => {
|
||||
const fs = require('fs');
|
||||
CFSAttachments.find().forEach(file => {
|
||||
const bucket = new MongoInternals.NpmModule.GridFSBucket(MongoInternals.defaultRemoteCollectionDriver().mongo.db, {bucketName: 'cfs_gridfs.attachments'});
|
||||
const gfsId = new MongoInternals.NpmModule.ObjectID(file.copies.attachments.key);
|
||||
const reader = bucket.openDownloadStream(gfsId);
|
||||
let store = Attachments.storagePath();
|
||||
if (store.charAt(store.length - 1) === '/') {
|
||||
store = store.substring(0, store.length - 1);
|
||||
}
|
||||
const path = `${store}/${file.name()}`;
|
||||
const fd = fs.createWriteStream(path);
|
||||
reader.pipe(fd);
|
||||
reader.on('end', () => {
|
||||
let opts = {
|
||||
fileName: file.name(),
|
||||
type: file.type(),
|
||||
size: file.size(),
|
||||
fileId: file._id,
|
||||
meta: {
|
||||
userId: file.userId,
|
||||
boardId: file.boardId,
|
||||
cardId: file.cardId
|
||||
}
|
||||
};
|
||||
if (file.listId) {
|
||||
opts.meta.listId = file.listId;
|
||||
}
|
||||
if (file.swimlaneId) {
|
||||
opts.meta.swimlaneId = file.swimlaneId;
|
||||
}
|
||||
Attachments.addFile(path, opts, (err, fileRef) => {
|
||||
if (err) {
|
||||
console.log('error when migrating', file.name(), err);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
const localFSStore = process.env.ATTACHMENTS_STORE_PATH;
|
||||
const storeName = 'attachments';
|
||||
const defaultStoreOptions = {
|
||||
beforeWrite: fileObj => {
|
||||
if (!fileObj.isImage()) {
|
||||
return {
|
||||
type: 'application/octet-stream',
|
||||
};
|
||||
}
|
||||
return {};
|
||||
},
|
||||
};
|
||||
let store;
|
||||
if (localFSStore) {
|
||||
// have to reinvent methods from FS.Store.GridFS and FS.Store.FileSystem
|
||||
const fs = Npm.require('fs');
|
||||
const path = Npm.require('path');
|
||||
const mongodb = Npm.require('mongodb');
|
||||
const Grid = Npm.require('gridfs-stream');
|
||||
// calulate the absolute path here, because FS.Store.FileSystem didn't expose the aboslutepath or FS.Store didn't expose api calls :(
|
||||
let pathname = localFSStore;
|
||||
/*eslint camelcase: ["error", {allow: ["__meteor_bootstrap__"]}] */
|
||||
|
||||
if (!pathname && __meteor_bootstrap__ && __meteor_bootstrap__.serverDir) {
|
||||
pathname = path.join(
|
||||
__meteor_bootstrap__.serverDir,
|
||||
`../../../cfs/files/${storeName}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (!pathname)
|
||||
throw new Error('FS.Store.FileSystem unable to determine path');
|
||||
|
||||
// Check if we have '~/foo/bar'
|
||||
if (pathname.split(path.sep)[0] === '~') {
|
||||
const homepath =
|
||||
process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
|
||||
if (homepath) {
|
||||
pathname = pathname.replace('~', homepath);
|
||||
} else {
|
||||
throw new Error('FS.Store.FileSystem unable to resolve "~" in path');
|
||||
}
|
||||
}
|
||||
|
||||
// Set absolute path
|
||||
const absolutePath = path.resolve(pathname);
|
||||
|
||||
const _FStore = new FS.Store.FileSystem(storeName, {
|
||||
path: localFSStore,
|
||||
...defaultStoreOptions,
|
||||
});
|
||||
const GStore = {
|
||||
fileKey(fileObj) {
|
||||
const key = {
|
||||
_id: null,
|
||||
filename: null,
|
||||
};
|
||||
|
||||
// If we're passed a fileObj, we retrieve the _id and filename from it.
|
||||
if (fileObj) {
|
||||
const info = fileObj._getInfo(storeName, {
|
||||
updateFileRecordFirst: false,
|
||||
});
|
||||
key._id = info.key || null;
|
||||
key.filename =
|
||||
info.name ||
|
||||
fileObj.name({ updateFileRecordFirst: false }) ||
|
||||
`${fileObj.collectionName}-${fileObj._id}`;
|
||||
}
|
||||
|
||||
// If key._id is null at this point, createWriteStream will let GridFS generate a new ID
|
||||
return key;
|
||||
},
|
||||
db: undefined,
|
||||
mongoOptions: { useNewUrlParser: true },
|
||||
mongoUrl: process.env.MONGO_URL,
|
||||
init() {
|
||||
this._init(err => {
|
||||
this.inited = !err;
|
||||
});
|
||||
},
|
||||
_init(callback) {
|
||||
const self = this;
|
||||
mongodb.MongoClient.connect(self.mongoUrl, self.mongoOptions, function(
|
||||
err,
|
||||
db,
|
||||
) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
self.db = db;
|
||||
return callback(null);
|
||||
});
|
||||
return;
|
||||
},
|
||||
createReadStream(fileKey, options) {
|
||||
const self = this;
|
||||
if (!self.inited) {
|
||||
self.init();
|
||||
return undefined;
|
||||
}
|
||||
options = options || {};
|
||||
|
||||
// Init GridFS
|
||||
const gfs = new Grid(self.db, mongodb);
|
||||
|
||||
// Set the default streamning settings
|
||||
const settings = {
|
||||
_id: new mongodb.ObjectID(fileKey._id),
|
||||
root: `cfs_gridfs.${storeName}`,
|
||||
};
|
||||
|
||||
// Check if this should be a partial read
|
||||
if (
|
||||
typeof options.start !== 'undefined' &&
|
||||
typeof options.end !== 'undefined'
|
||||
) {
|
||||
// Add partial info
|
||||
settings.range = {
|
||||
startPos: options.start,
|
||||
endPos: options.end,
|
||||
};
|
||||
}
|
||||
return gfs.createReadStream(settings);
|
||||
},
|
||||
};
|
||||
GStore.init();
|
||||
const CRS = 'createReadStream';
|
||||
const _CRS = `_${CRS}`;
|
||||
const FStore = _FStore._transform;
|
||||
FStore[_CRS] = FStore[CRS].bind(FStore);
|
||||
FStore[CRS] = function(fileObj, options) {
|
||||
let stream;
|
||||
try {
|
||||
const localFile = path.join(
|
||||
absolutePath,
|
||||
FStore.storage.fileKey(fileObj),
|
||||
);
|
||||
const state = fs.statSync(localFile);
|
||||
if (state) {
|
||||
stream = FStore[_CRS](fileObj, options);
|
||||
}
|
||||
} catch (e) {
|
||||
// file is not there, try GridFS ?
|
||||
stream = undefined;
|
||||
}
|
||||
if (stream) return stream;
|
||||
else {
|
||||
try {
|
||||
const stream = GStore[CRS](GStore.fileKey(fileObj), options);
|
||||
return stream;
|
||||
} catch (e) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}.bind(FStore);
|
||||
store = _FStore;
|
||||
} else {
|
||||
store = new FS.Store.GridFS(localFSStore ? `G${storeName}` : storeName, {
|
||||
// XXX Add a new store for cover thumbnails so we don't load big images in
|
||||
// the general board view
|
||||
// If the uploaded document is not an image we need to enforce browser
|
||||
// download instead of execution. This is particularly important for HTML
|
||||
// files that the browser will just execute if we don't serve them with the
|
||||
// appropriate `application/octet-stream` MIME header which can lead to user
|
||||
// data leaks. I imagine other formats (like PDF) can also be attack vectors.
|
||||
// See https://github.com/wekan/wekan/issues/99
|
||||
// XXX Should we use `beforeWrite` option of CollectionFS instead of
|
||||
// collection-hooks?
|
||||
// We should use `beforeWrite`.
|
||||
...defaultStoreOptions,
|
||||
});
|
||||
}
|
||||
CFSAttachments = new FS.Collection('attachments', {
|
||||
stores: [store],
|
||||
});
|
||||
|
||||
if (Meteor.isServer) {
|
||||
Meteor.startup(() => {
|
||||
CFSAttachments.files._ensureIndex({ cardId: 1 });
|
||||
});
|
||||
|
||||
CFSAttachments.allow({
|
||||
insert(userId, doc) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
||||
},
|
||||
update(userId, doc) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
||||
},
|
||||
remove(userId, doc) {
|
||||
return allowIsBoardMember(userId, Boards.findOne(doc.boardId));
|
||||
},
|
||||
// We authorize the attachment download either:
|
||||
// - if the board is public, everyone (even unconnected) can download it
|
||||
// - if the board is private, only board members can download it
|
||||
download(userId, doc) {
|
||||
if (Meteor.isServer) {
|
||||
return true;
|
||||
}
|
||||
const board = Boards.findOne(doc.boardId);
|
||||
if (board.isPublic()) {
|
||||
return true;
|
||||
} else {
|
||||
return board.hasMember(userId);
|
||||
}
|
||||
},
|
||||
|
||||
fetch: ['boardId'],
|
||||
});
|
||||
}
|
||||
|
||||
export default CFSAttachments;
|
||||
@@ -131,7 +131,7 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
|
||||
// Gather queries and send in bulk
|
||||
const cardComments = this.join(CardComments);
|
||||
cardComments.selector = _ids => ({ cardId: _ids });
|
||||
const attachments = this.join(Attachments);
|
||||
const attachments = this.join(Attachments.collection);
|
||||
attachments.selector = _ids => ({ cardId: _ids });
|
||||
const checklists = this.join(Checklists);
|
||||
checklists.selector = _ids => ({ cardId: _ids });
|
||||
|
||||
Reference in new issue
Block a user