mirror of
https://github.com/wekan/wekan.git
synced 2026-11-18 05:45:02 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8911fe5c8d | ||
|
|
1d9346513e | ||
|
|
62150ce6c4 | ||
|
|
b2d4135dca | ||
|
|
49e3e01ece | ||
|
|
23c2ff0e29 | ||
|
|
a550c255e6 | ||
|
|
6b897faaa8 | ||
|
|
48255f6f1e | ||
|
|
45bc3bd3db | ||
|
|
5ab20a9257 | ||
|
|
88e4918208 | ||
|
|
521ef8b6da | ||
|
|
0d86dfa571 | ||
|
|
472350e56f | ||
|
|
68569b9640 | ||
|
|
823f11d5dd | ||
|
|
ae19018831 | ||
|
|
d5b09c7b3e | ||
|
|
d3b4aa4dc7 | ||
|
|
c2da477735 | ||
|
|
843ff8eaaa | ||
|
|
c5143e2c54 | ||
|
|
0596f5e864 | ||
|
|
8ca1b25daf | ||
|
|
1f76159bfe | ||
|
|
39ece35f52 | ||
|
|
63c1bb9e17 | ||
|
|
354622c5ad | ||
|
|
df7fd8c900 | ||
|
|
7957690fca | ||
|
|
63d19447a0 | ||
|
|
018a84ec59 | ||
|
|
e5c0e623a0 | ||
|
|
9a2d3e15e8 | ||
|
|
c07e262e68 | ||
|
|
cacb2b91ee | ||
|
|
6f269d598f | ||
|
|
57ea254bff | ||
|
|
7e183c838f | ||
|
|
3ffdfd9736 | ||
|
|
621c701bef | ||
|
|
3c24c9966c | ||
|
|
995de525d9 | ||
|
|
ae30b1220a | ||
|
|
e380ad26c2 | ||
|
|
9bb31d2380 | ||
|
|
8ec1e4f3fa | ||
|
|
9f0f6841b0 | ||
|
|
5d18f98b44 | ||
|
|
e738177e08 | ||
|
|
bb201935b9 | ||
|
|
bcfe6bd616 | ||
|
|
9c6352a7bc | ||
|
|
9110e41f20 | ||
|
|
7ae871d3a6 | ||
|
|
0ddf027d43 | ||
|
|
45124a39f3 | ||
|
|
4940af0573 |
No files matched your search
+3
-3
@@ -17,7 +17,7 @@ es5-shim@4.8.0
|
||||
|
||||
# Collections
|
||||
aldeed:collection2
|
||||
cfs:standard-packages
|
||||
wekan-cfs-standard-packages
|
||||
cottz:publish-relations
|
||||
dburles:collection-helpers
|
||||
idmontie:migrations
|
||||
@@ -75,7 +75,7 @@ horka:swipebox
|
||||
dynamic-import@0.6.0
|
||||
|
||||
accounts-password@1.7.0
|
||||
cfs:gridfs
|
||||
wekan-cfs-gridfs
|
||||
rzymek:fullcalendar
|
||||
momentjs:moment@2.22.2
|
||||
browser-policy-framing@1.1.0
|
||||
@@ -91,7 +91,7 @@ meteorhacks:aggregate@1.3.0
|
||||
wekan-markdown
|
||||
konecty:mongo-counter
|
||||
percolate:synced-cron
|
||||
cfs:filesystem
|
||||
wekan-cfs-filesystem
|
||||
tmeasday:check-npm-versions
|
||||
steffo:meteor-accounts-saml
|
||||
rajit:bootstrap3-datepicker-fi
|
||||
|
||||
+24
-23
@@ -1,7 +1,7 @@
|
||||
3stack:presence@1.1.2
|
||||
accounts-base@1.9.0
|
||||
accounts-oauth@1.2.0
|
||||
accounts-password@1.7.0
|
||||
accounts-password@1.7.1
|
||||
aldeed:collection2@2.10.0
|
||||
aldeed:collection2-core@1.2.0
|
||||
aldeed:schema-deny@1.1.0
|
||||
@@ -23,24 +23,7 @@ browser-policy-framing@1.1.0
|
||||
caching-compiler@1.2.2
|
||||
caching-html-compiler@1.2.0
|
||||
callback-hook@1.3.0
|
||||
cfs:access-point@0.1.49
|
||||
cfs:base-package@0.0.30
|
||||
cfs:collection@0.5.5
|
||||
cfs:collection-filters@0.2.4
|
||||
cfs:data-man@0.0.6
|
||||
cfs:file@0.1.17
|
||||
cfs:filesystem@0.1.2
|
||||
cfs:gridfs@0.0.34
|
||||
cfs:http-methods@0.0.32
|
||||
cfs:http-publish@0.0.13
|
||||
cfs:power-queue@0.9.11
|
||||
cfs:reactive-list@0.0.9
|
||||
cfs:reactive-property@0.0.4
|
||||
cfs:standard-packages@0.5.10
|
||||
cfs:storage-adapter@0.2.4
|
||||
cfs:tempstore@0.1.6
|
||||
cfs:upload-http@0.0.20
|
||||
cfs:worker@0.1.5
|
||||
check@1.3.1
|
||||
chuangbo:cookie@1.1.0
|
||||
coagmano:stylus@1.1.0
|
||||
@@ -49,10 +32,10 @@ coffeescript-compiler@2.4.1
|
||||
cottz:publish-relations@2.0.8
|
||||
dburles:collection-helpers@1.1.0
|
||||
ddp@1.4.0
|
||||
ddp-client@2.4.0
|
||||
ddp-client@2.4.1
|
||||
ddp-common@1.4.0
|
||||
ddp-rate-limiter@1.0.9
|
||||
ddp-server@2.3.2
|
||||
ddp-server@2.3.3
|
||||
deps@1.0.12
|
||||
diff-sequence@1.1.1
|
||||
dynamic-import@0.6.0
|
||||
@@ -100,7 +83,7 @@ meteorhacks:collection-utils@1.2.0
|
||||
meteorhacks:picker@1.0.3
|
||||
meteorhacks:subs-manager@1.6.4
|
||||
meteorspark:util@0.2.0
|
||||
minifier-css@1.5.3
|
||||
minifier-css@1.5.4
|
||||
minifier-js@2.6.0
|
||||
minifiers@1.1.8-faster-rebuild.0
|
||||
minimongo@1.6.2
|
||||
@@ -109,7 +92,7 @@ modern-browsers@0.1.5
|
||||
modules@0.16.0
|
||||
modules-runtime@0.12.0
|
||||
momentjs:moment@2.29.1
|
||||
mongo@1.11.0
|
||||
mongo@1.11.1
|
||||
mongo-decimal@0.1.2
|
||||
mongo-dev-server@1.1.0
|
||||
mongo-id@1.0.7
|
||||
@@ -208,7 +191,7 @@ simple:json-routes@2.1.0
|
||||
simple:rest-accounts-password@1.1.2
|
||||
simple:rest-bearer-token-parser@1.0.1
|
||||
simple:rest-json-error-handler@1.0.1
|
||||
socket-stream-client@0.3.1
|
||||
socket-stream-client@0.3.2
|
||||
softwarerero:accounts-t9n@1.3.11
|
||||
spacebars@1.1.0
|
||||
spacebars-compiler@1.2.1
|
||||
@@ -238,6 +221,24 @@ webapp@1.10.1
|
||||
webapp-hashing@1.1.0
|
||||
wekan-accounts-cas@0.1.0
|
||||
wekan-accounts-oidc@1.0.10
|
||||
wekan-cfs-access-point@0.1.50
|
||||
wekan-cfs-base-package@0.0.30
|
||||
wekan-cfs-collection@0.5.5
|
||||
wekan-cfs-collection-filters@0.2.4
|
||||
wekan-cfs-data-man@0.0.6
|
||||
wekan-cfs-file@0.1.17
|
||||
wekan-cfs-filesystem@0.1.2
|
||||
wekan-cfs-gridfs@0.0.34
|
||||
wekan-cfs-http-methods@0.0.32
|
||||
wekan-cfs-http-publish@0.0.13
|
||||
wekan-cfs-power-queue@0.9.11
|
||||
wekan-cfs-reactive-list@0.0.9
|
||||
wekan-cfs-reactive-property@0.0.4
|
||||
wekan-cfs-standard-packages@0.5.10
|
||||
wekan-cfs-storage-adapter@0.2.4
|
||||
wekan-cfs-tempstore@0.1.6
|
||||
wekan-cfs-upload-http@0.0.21
|
||||
wekan-cfs-worker@0.1.5
|
||||
wekan-ldap@0.0.2
|
||||
wekan-markdown@1.0.9
|
||||
wekan-oidc@1.0.12
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ host = https://www.transifex.com
|
||||
# tap:i18n requires us to use `-` separator in the language identifiers whereas
|
||||
# Transifex uses a `_` separator, without an option to customize it on one side
|
||||
# or the other, so we need to do a Manual mapping.
|
||||
lang_map = ar_EG:ar-EG, bg_BG:bg, de_CH:de-CH, en_GB:en-GB, es_AR:es-AR, es_CL:es-CL, es_419:es-LA, es_PE:es-PE, es_MX:es-MX, es_TX:es-TX, es_PY:es-PY, el_GR:el, fa_IR:fa-IR, fi_FI:fi, hu_HU:hu, id_ID:id, mn_MN:mn, no:nb, lv_LV:lv, pt_BR:pt-BR, ro_RO:ro, sl_SI:sl, zh_CN:zh-CN, zh_TW:zh-TW, zh_HK:zh-HK
|
||||
lang_map = ar_EG:ar-EG, bg_BG:bg, de_CH:de-CH, en_GB:en-GB, es_AR:es-AR, es_CL:es-CL, es_419:es-LA, es_PE:es-PE, es_MX:es-MX, es_TX:es-TX, es_PY:es-PY, el_GR:el, fa_IR:fa-IR, fi_FI:fi, hu_HU:hu, id_ID:id, mn_MN:mn, lv_LV:lv, pt_BR:pt-BR, ro_RO:ro, sl_SI:sl, zh_CN:zh-CN, zh_TW:zh-TW, zh_HK:zh-HK
|
||||
|
||||
[wekan.application]
|
||||
file_filter = i18n/<lang>.i18n.json
|
||||
|
||||
@@ -1,3 +1,92 @@
|
||||
# v5.28 2021-05-07 Wekan release
|
||||
|
||||
This release adds the following new features:
|
||||
|
||||
- [Mermaid Diagram](https://github.com/wekan/wekan/wiki/Mermaid-Diagram).
|
||||
Thanks to xuguotong and xet7.
|
||||
|
||||
and adds the following updates:
|
||||
|
||||
- Updated dependencies
|
||||
[Part 1](https://github.com/wekan/wekan/commit/521ef8b6dad4f00662f22702331193c16b91b482),
|
||||
[Part 2](https://github.com/wekan/wekan/commit/48255f6f1e4a0caf0be006196f28295d0825eb95),
|
||||
[Part 3](https://github.com/wekan/wekan/commit/a550c255e6c3bd2d609a1a45a213cdae7ab4f74d).
|
||||
Thanks to developers of dependencies.
|
||||
|
||||
and fixes the following bugs:
|
||||
|
||||
- [Fix: BG color of StartDate](https://github.com/wekan/wekan/pull/3793).
|
||||
Thanks to listenerri.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v5.27 2021-04-29 Wekan release
|
||||
|
||||
This release fixes the following bugs:
|
||||
|
||||
- [Fixed Non-ASCII attachment filename will crash when downloading](https://github.com/wekan/wekan/commit/c2da47773552a61d45b010a095f73d2e441f687c).
|
||||
Thanks to xet7.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v5.26 2021-04-28 Wekan release
|
||||
|
||||
This release adds the following new features:
|
||||
|
||||
- [Feature/mini card subtask count](https://github.com/wekan/wekan/pull/3765).
|
||||
Thanks to ryanMushy.
|
||||
|
||||
and fixes the following bugs:
|
||||
|
||||
- [Bring back Almost-Due for Start Date](https://github.com/wekan/wekan/commit/8ca1b25daf3be60c2dc64f03830dea8437bbd8ad).
|
||||
Thanks to darren-teo.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v5.25 2021-04-27 Wekan release
|
||||
|
||||
This release adds the following new features:
|
||||
|
||||
- [Swimlane in Export to Excel](https://github.com/wekan/wekan/pull/3764).
|
||||
Thanks to Keelan and ryanMushy.
|
||||
|
||||
and adds the following updates:
|
||||
|
||||
- [Updated release scripts](https://github.com/wekan/wekan/commit/9f0f6841b01b88f5559724b047d5e245617a02c8).
|
||||
Thanks to xet7.
|
||||
|
||||
and fixes the following bugs:
|
||||
|
||||
- [Added missing PostgreSQL password to ToroDB](https://github.com/wekan/wekan/commit/995de525d96946702536f0cdcb98ef281b9df94e).
|
||||
Thanks to xet7.
|
||||
- [Fixed language name of Deutsch (Schweiz)](https://github.com/wekan/wekan/commit/621c701bef1d09d4ddfc93be411cfad98869f0ae).
|
||||
Thanks to urmel1960.
|
||||
- [Bugfix/Summernote on paste](https://github.com/wekan/wekan/pull/3761).
|
||||
Thanks to ryanMushy.
|
||||
- [OpenAPI: Better handle nested schemas](https://github.com/wekan/wekan/pull/3762).
|
||||
Thanks to bentiss.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v5.24 2021-04-24 Wekan release
|
||||
|
||||
This release adds the following new features:
|
||||
|
||||
- [Copy Swimlane](https://github.com/wekan/wekan/pull/3753).
|
||||
Thanks to jrsupplee.
|
||||
|
||||
and adds the following updates:
|
||||
|
||||
- [Updated dependencies](https://github.com/wekan/wekan/commit/e738177e081e4a7e83fed3389f47847403551fc2).
|
||||
Thanks to developers of dependencies.
|
||||
|
||||
and fixes the following bugs:
|
||||
|
||||
- [Fix Snap: Delete extra symlink that prevented building Snap](https://github.com/wekan/wekan/commit/45124a39f34a918b251a4a36fb016639b558f119).
|
||||
Thanks to xet7.
|
||||
|
||||
Thanks to above GitHub users for their contributions and translators for their translations.
|
||||
|
||||
# v5.23 2021-04-22 Wekan release
|
||||
|
||||
This release adds the following new features:
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
appId: wekan-public/apps/77b94f60-dec9-0136-304e-16ff53095928
|
||||
appVersion: "v5.23.0"
|
||||
appVersion: "v5.28.0"
|
||||
files:
|
||||
userUploads:
|
||||
- README.md
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import sanitizeXss from 'xss';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
const activitiesPerPage = 500;
|
||||
|
||||
@@ -162,11 +162,15 @@ BlazeComponent.extendComponent({
|
||||
{
|
||||
href: source.url,
|
||||
},
|
||||
sanitizeXss(source.system),
|
||||
DOMPurify.sanitize(source.system, {
|
||||
ALLOW_UNKNOWN_PROTOCOLS: true,
|
||||
}),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return sanitizeXss(source.system);
|
||||
return DOMPurify.sanitize(source.system, {
|
||||
ALLOW_UNKNOWN_PROTOCOLS: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -190,10 +194,10 @@ BlazeComponent.extendComponent({
|
||||
href: attachment.url({ download: true }),
|
||||
target: '_blank',
|
||||
},
|
||||
sanitizeXss(attachment.name()),
|
||||
DOMPurify.sanitize(attachment.name()),
|
||||
),
|
||||
)) ||
|
||||
sanitizeXss(this.currentData().activity.attachmentName)
|
||||
DOMPurify.sanitize(this.currentData().activity.attachmentName)
|
||||
);
|
||||
},
|
||||
|
||||
@@ -232,7 +236,7 @@ BlazeComponent.extendComponent({
|
||||
|
||||
Template.activity.helpers({
|
||||
sanitize(value) {
|
||||
return sanitizeXss(value);
|
||||
return DOMPurify.sanitize(value, { ALLOW_UNKNOWN_PROTOCOLS: true });
|
||||
},
|
||||
});
|
||||
|
||||
@@ -246,7 +250,7 @@ function createCardLink(card) {
|
||||
href: card.originRelativeUrl(),
|
||||
class: 'action-card',
|
||||
},
|
||||
sanitizeXss(card.title),
|
||||
DOMPurify.sanitize(card.title, { ALLOW_UNKNOWN_PROTOCOLS: true }),
|
||||
),
|
||||
)
|
||||
);
|
||||
@@ -263,7 +267,7 @@ function createBoardLink(board, list) {
|
||||
href: board.originRelativeUrl(),
|
||||
class: 'action-board',
|
||||
},
|
||||
sanitizeXss(text),
|
||||
DOMPurify.sanitize(text, { ALLOW_UNKNOWN_PROTOCOLS: true }),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -187,6 +187,7 @@ class CardStartDate extends CardDate {
|
||||
// if dueAt or endAt exist & are > startAt, startAt doesn't need to be flagged
|
||||
if ((endAt && theDate.isAfter(endAt)) || (dueAt && theDate.isAfter(dueAt)))
|
||||
classes += 'long-overdue';
|
||||
else if (theDate.isAfter(now)) classes += '';
|
||||
else classes += 'current';
|
||||
return classes;
|
||||
}
|
||||
|
||||
@@ -129,3 +129,8 @@ template(name="minicard")
|
||||
.badge(class="{{#if checklistFinished}}is-finished{{/if}}")
|
||||
span.badge-icon.fa.fa-check-square-o
|
||||
span.badge-text.check-list-text {{checklistFinishedCount}}/{{checklistItemCount}}
|
||||
if allSubtasks.count
|
||||
.badge
|
||||
span.badge-icon.fa.fa-sitemap
|
||||
span.badge-text.check-list-text {{subtasksFinishedCount}}/{{allSubtasksCount}}
|
||||
//{{subtasksFinishedCount}}/{{subtasksCount}} does not work because when a subtaks is archived, the count goes down
|
||||
@@ -145,6 +145,7 @@ Template.editor.onRendered(() => {
|
||||
const MAX_IMAGE_PIXEL = Utils.MAX_IMAGE_PIXEL;
|
||||
const COMPRESS_RATIO = Utils.IMAGE_COMPRESS_RATIO;
|
||||
const insertImage = src => {
|
||||
// process all image upload types to the description/comment window
|
||||
const img = document.createElement('img');
|
||||
img.src = src;
|
||||
img.setAttribute('width', '100%');
|
||||
@@ -210,7 +211,16 @@ Template.editor.onRendered(() => {
|
||||
}
|
||||
}
|
||||
},
|
||||
onPaste() {
|
||||
onPaste(e) {
|
||||
var clipboardData = e.clipboardData;
|
||||
var pastedData = clipboardData.getData('Text');
|
||||
|
||||
//if pasted data is an image, exit
|
||||
if (!pastedData.length) {
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
// clear up unwanted tag info when user pasted in text
|
||||
const thisNote = this;
|
||||
const updatePastedText = function(object) {
|
||||
@@ -219,7 +229,7 @@ Template.editor.onRendered(() => {
|
||||
// (and multiplies by pasting more) by changing paste "p" to "br".
|
||||
// Fixes https://github.com/wekan/wekan/2890 .
|
||||
// == Fix Start ==
|
||||
someNote.execCommand('defaultParagraphSeparator', false, 'br');
|
||||
//someNote.execCommand('defaultParagraphSeparator', false, 'br');
|
||||
// == Fix End ==
|
||||
const original = someNote.summernote('code');
|
||||
const cleaned = cleanPastedHTML(original); //this is where to call whatever clean function you want. I have mine in a different file, called CleanPastedHTML.
|
||||
@@ -236,14 +246,11 @@ Template.editor.onRendered(() => {
|
||||
dialogsInBody: true,
|
||||
spellCheck: true,
|
||||
disableGrammar: false,
|
||||
disableDragAndDrop: true,
|
||||
disableDragAndDrop: false,
|
||||
toolbar,
|
||||
popover: {
|
||||
image: [
|
||||
[
|
||||
'image',
|
||||
['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone'],
|
||||
],
|
||||
['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
|
||||
['float', ['floatLeft', 'floatRight', 'floatNone']],
|
||||
['remove', ['removeMedia']],
|
||||
],
|
||||
@@ -266,10 +273,12 @@ Template.editor.onRendered(() => {
|
||||
}
|
||||
});
|
||||
|
||||
import sanitizeXss from 'xss';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
// Additional safeAttrValue function to allow for other specific protocols
|
||||
// See https://github.com/leizongmin/js-xss/issues/52#issuecomment-241354114
|
||||
|
||||
/*
|
||||
function mySafeAttrValue(tag, name, value, cssFilter) {
|
||||
// only when the tag is 'a' and attribute is 'href'
|
||||
// then use your custom function
|
||||
@@ -295,6 +304,7 @@ function mySafeAttrValue(tag, name, value, cssFilter) {
|
||||
return sanitizeXss.safeAttrValue(tag, name, value, cssFilter);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// XXX I believe we should compute a HTML rendered field on the server that
|
||||
// would handle markdown and user mentions. We can simply have two
|
||||
@@ -310,7 +320,9 @@ Blaze.Template.registerHelper(
|
||||
let content = Blaze.toHTML(view.templateContentBlock);
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
if (!currentBoard)
|
||||
return HTML.Raw(sanitizeXss(content, { safeAttrValue: mySafeAttrValue }));
|
||||
return HTML.Raw(
|
||||
DOMPurify.sanitize(content, { ALLOW_UNKNOWN_PROTOCOLS: true }),
|
||||
);
|
||||
const knowedUsers = currentBoard.members.map(member => {
|
||||
const u = Users.findOne(member.userId);
|
||||
if (u) {
|
||||
@@ -354,7 +366,9 @@ Blaze.Template.registerHelper(
|
||||
content = content.replace(fullMention, Blaze.toHTML(link));
|
||||
}
|
||||
|
||||
return HTML.Raw(sanitizeXss(content, { safeAttrValue: mySafeAttrValue }));
|
||||
return HTML.Raw(
|
||||
DOMPurify.sanitize(content, { ALLOW_UNKNOWN_PROTOCOLS: true }),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ Template.userFormsLayout.helpers({
|
||||
// ar-EG = Arabic (Egypt), simply Masri (مَصرى, [ˈmɑsˤɾi], Egyptian, Masr refers to Cairo)
|
||||
name = 'مَصرى';
|
||||
} else if (lang.name === 'de-CH') {
|
||||
name = 'Schwiizerdütsch';
|
||||
name = 'Deutsch (Schweiz)';
|
||||
} else if (lang.name === 'fa-IR') {
|
||||
// fa-IR = Persian (Iran)
|
||||
name = 'فارسی/پارسی (ایران)';
|
||||
|
||||
@@ -39,6 +39,8 @@ template(name="swimlaneActionPopup")
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li: a.js-close-swimlane {{_ 'archive-swimlane'}}
|
||||
ul.pop-over-list
|
||||
li: a.js-copy-swimlane {{_ 'copy-swimlane'}}
|
||||
ul.pop-over-list
|
||||
li: a.js-move-swimlane {{_ 'move-swimlane'}}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ Template.swimlaneActionPopup.events({
|
||||
Popup.close();
|
||||
},
|
||||
'click .js-move-swimlane': Popup.open('moveSwimlane'),
|
||||
'click .js-copy-swimlane': Popup.open('copySwimlane'),
|
||||
});
|
||||
|
||||
Template.swimlaneActionPopup.events({
|
||||
|
||||
@@ -71,3 +71,13 @@ template(name="moveSwimlanePopup")
|
||||
|
||||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-done {{_ 'done'}}
|
||||
|
||||
template(name="copySwimlanePopup")
|
||||
unless currentUser.isWorker
|
||||
label {{_ 'boards'}}:
|
||||
select.js-select-boards(autofocus)
|
||||
each toBoard in toBoards
|
||||
option(value="{{toBoard._id}}" selected="{{#if $eq toBoard.title board.title}}1{{/if}}") {{toBoard.title}}
|
||||
|
||||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-done {{_ 'done'}}
|
||||
@@ -324,45 +324,54 @@ BlazeComponent.extendComponent({
|
||||
},
|
||||
}).register('listsGroup');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
class MoveSwimlaneComponent extends BlazeComponent {
|
||||
serverMethod = 'moveSwimlane';
|
||||
|
||||
onCreated() {
|
||||
this.currentSwimlane = this.currentData();
|
||||
},
|
||||
}
|
||||
|
||||
board() {
|
||||
return Boards.findOne(Session.get('currentBoard'));
|
||||
},
|
||||
}
|
||||
|
||||
toBoardsSelector() {
|
||||
return {
|
||||
archived: false,
|
||||
'members.userId': Meteor.userId(),
|
||||
type: 'board',
|
||||
_id: { $ne: this.board()._id },
|
||||
};
|
||||
}
|
||||
|
||||
toBoards() {
|
||||
const boards = Boards.find(
|
||||
{
|
||||
archived: false,
|
||||
'members.userId': Meteor.userId(),
|
||||
type: 'board',
|
||||
_id: { $ne: this.board()._id },
|
||||
},
|
||||
{
|
||||
sort: { title: 1 },
|
||||
},
|
||||
);
|
||||
|
||||
return boards;
|
||||
},
|
||||
return Boards.find(this.toBoardsSelector(), { sort: { title: 1 } });
|
||||
}
|
||||
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
'click .js-done'() {
|
||||
const swimlane = Swimlanes.findOne(this.currentSwimlane._id);
|
||||
// const swimlane = Swimlanes.findOne(this.currentSwimlane._id);
|
||||
const bSelect = $('.js-select-boards')[0];
|
||||
let boardId;
|
||||
if (bSelect) {
|
||||
boardId = bSelect.options[bSelect.selectedIndex].value;
|
||||
Meteor.call('moveSwimlane', this.currentSwimlane._id, boardId);
|
||||
Meteor.call(this.serverMethod, this.currentSwimlane._id, boardId);
|
||||
}
|
||||
Popup.close();
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
}).register('moveSwimlanePopup');
|
||||
}
|
||||
}
|
||||
MoveSwimlaneComponent.register('moveSwimlanePopup');
|
||||
|
||||
(class extends MoveSwimlaneComponent {
|
||||
serverMethod = 'copySwimlane';
|
||||
toBoardsSelector() {
|
||||
const selector = super.toBoardsSelector();
|
||||
delete selector._id;
|
||||
return selector;
|
||||
}
|
||||
}.register('copySwimlanePopup'));
|
||||
@@ -175,7 +175,7 @@ Template.changeLanguagePopup.helpers({
|
||||
// fa-IR = Persian (Iran)
|
||||
name = 'فارسی/پارسی (ایران)';
|
||||
} else if (lang.name === 'de-CH') {
|
||||
name = 'Schwiizerdütsch';
|
||||
name = 'Deutsch (Schweiz)';
|
||||
} else if (lang.name === 'fr-BE') {
|
||||
name = 'Français (Belgique)';
|
||||
} else if (lang.name === 'fr-CA') {
|
||||
|
||||
+39
-10
@@ -23,21 +23,30 @@ class DateFilter {
|
||||
|
||||
// past builds a filter for all dates before now
|
||||
past() {
|
||||
if (this._filterState == 'past') { this.reset(); return; }
|
||||
if (this._filterState == 'past') {
|
||||
this.reset();
|
||||
return;
|
||||
}
|
||||
this._filter = { $lte: moment().toDate() };
|
||||
this._updateState('past');
|
||||
}
|
||||
|
||||
// today is a convenience method for calling relativeDay with 0
|
||||
today() {
|
||||
if (this._filterState == 'today') { this.reset(); return; }
|
||||
if (this._filterState == 'today') {
|
||||
this.reset();
|
||||
return;
|
||||
}
|
||||
this.relativeDay(0);
|
||||
this._updateState('today');
|
||||
}
|
||||
|
||||
// tomorrow is a convenience method for calling relativeDay with 1
|
||||
tomorrow() {
|
||||
if (this._filterState == 'tomorrow') { this.reset(); return; }
|
||||
if (this._filterState == 'tomorrow') {
|
||||
this.reset();
|
||||
return;
|
||||
}
|
||||
this.relativeDay(1);
|
||||
this._updateState('tomorrow');
|
||||
}
|
||||
@@ -50,10 +59,18 @@ class DateFilter {
|
||||
// relativeDay builds a filter starting from now and including all
|
||||
// days up to today +/- offset.
|
||||
relativeDay(offset) {
|
||||
if (this._filterState == 'day') { this.reset(); return; }
|
||||
if (this._filterState == 'day') {
|
||||
this.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
var startDay = moment().startOf('day').toDate(),
|
||||
endDay = moment().endOf('day').add(offset, 'day').toDate();
|
||||
var startDay = moment()
|
||||
.startOf('day')
|
||||
.toDate(),
|
||||
endDay = moment()
|
||||
.endOf('day')
|
||||
.add(offset, 'day')
|
||||
.toDate();
|
||||
|
||||
if (offset >= 0) {
|
||||
this._filter = { $gte: startDay, $lte: endDay };
|
||||
@@ -68,7 +85,10 @@ class DateFilter {
|
||||
// weeks up to today +/- offset. This considers the user's preferred
|
||||
// start of week day (as defined by Meteor).
|
||||
relativeWeek(offset) {
|
||||
if (this._filterState == 'week') { this.reset(); return; }
|
||||
if (this._filterState == 'week') {
|
||||
this.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
// getStartDayOfWeek returns the offset from Sunday of the user's
|
||||
// preferred starting day of the week. This date should be added
|
||||
@@ -78,8 +98,14 @@ class DateFilter {
|
||||
const weekStartDay = currentUser ? currentUser.getStartDayOfWeek() : 1;
|
||||
|
||||
// Moments are mutable so they must be cloned before modification
|
||||
var thisWeekStart = moment().startOf('day').startOf('week').add(weekStartDay, 'days');
|
||||
var thisWeekEnd = thisWeekStart.clone().add(offset, 'week').endOf('day');
|
||||
var thisWeekStart = moment()
|
||||
.startOf('day')
|
||||
.startOf('week')
|
||||
.add(weekStartDay, 'days');
|
||||
var thisWeekEnd = thisWeekStart
|
||||
.clone()
|
||||
.add(offset, 'week')
|
||||
.endOf('day');
|
||||
var startDate = thisWeekStart.toDate();
|
||||
var endDate = thisWeekEnd.toDate();
|
||||
|
||||
@@ -94,7 +120,10 @@ class DateFilter {
|
||||
|
||||
// noDate builds a filter for items where date is not set
|
||||
noDate() {
|
||||
if (this._filterState == 'noDate') { this.reset(); return; }
|
||||
if (this._filterState == 'noDate') {
|
||||
this.reset();
|
||||
return;
|
||||
}
|
||||
this._filter = null;
|
||||
this._updateState('noDate');
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
var Meteor = Package.meteor.Meteor;
|
||||
var global = Package.meteor.global;
|
||||
var meteorEnv = Package.meteor.meteorEnv;
|
||||
var FS = Package['cfs:base-package'].FS;
|
||||
var FS = Package['wekan-cfs-base-package'].FS;
|
||||
var check = Package.check.check;
|
||||
var Match = Package.check.Match;
|
||||
var EJSON = Package.ejson.EJSON;
|
||||
var HTTP = Package['cfs:http-methods'].HTTP;
|
||||
var HTTP = Package['wekan-cfs-http-methods'].HTTP;
|
||||
|
||||
/* Package-scope variables */
|
||||
var rootUrlPathPrefix, baseUrl, getHeaders, getHeadersByCollection, _existingMountPoints, mountUrls;
|
||||
@@ -25,7 +25,7 @@ var rootUrlPathPrefix, baseUrl, getHeaders, getHeadersByCollection, _existingMou
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// packages/cfs:access-point/access-point-common.js //
|
||||
// packages/wekan-cfs-access-point/access-point-common.js //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -217,7 +217,7 @@ FS.File.prototype.url = function(options) {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// packages/cfs:access-point/access-point-handlers.js //
|
||||
// packages/wekan-cfs-access-point/access-point-handlers.js //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -537,7 +537,7 @@ FS.HTTP.Handlers.PutUpdate = function httpPutUpdateHandler(ref) {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// packages/cfs:access-point/access-point-server.js //
|
||||
// packages/wekan-cfs-access-point/access-point-server.js //
|
||||
// //
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -909,6 +909,6 @@ Meteor.startup(function () {
|
||||
|
||||
/* Exports */
|
||||
if (typeof Package === 'undefined') Package = {};
|
||||
Package['cfs:access-point'] = {};
|
||||
Package['wekan-cfs-access-point'] = {};
|
||||
|
||||
})();
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1005,5 +1005,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Tiedostot raportti",
|
||||
"orphanedFilesReportTitle": "Orvot tiedostot raportti",
|
||||
"reports": "Raportit",
|
||||
"rulesReportTitle": "Säännöt raportti"
|
||||
"rulesReportTitle": "Säännöt raportti",
|
||||
"copy-swimlane": "Kopioi Swimlane",
|
||||
"copySwimlanePopup-title": "Kopioi Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+155
-11
@@ -144,7 +144,7 @@
|
||||
"board-view-collapse": "Slå sammen",
|
||||
"board-view-gantt": "Gantt",
|
||||
"board-view-lists": "Lister",
|
||||
"bucket-example": "Som \"Bucket List\" for eksempel",
|
||||
"bucket-example": "Som 'Bucket List' for eksempel",
|
||||
"cancel": "Avbryt",
|
||||
"card-archived": "Dette kortet er flyttet til Arkivet",
|
||||
"board-archived": "Denne tavlen er flyttet til Arkivet",
|
||||
@@ -207,7 +207,7 @@
|
||||
"clipboard": "Utklippstavle eller Dra og Slipp",
|
||||
"close": "Lukk",
|
||||
"close-board": "Lukk Tavle",
|
||||
"close-board-pop": "Du vil ha muligheten til å gjenopprette Tavle ved å klikke på \"Arkiv\"-knappen i hjem-menyen.",
|
||||
"close-board-pop": "Du vil ha muligheten til å gjenopprette Tavle ved å klikke på 'Arkiv'-knappen i hjem-menyen.",
|
||||
"color-black": "svart",
|
||||
"color-blue": "blå",
|
||||
"color-crimson": "høyrød",
|
||||
@@ -322,11 +322,15 @@
|
||||
"error-user-notAllowSelf": "Du kan ikke invitere deg selv",
|
||||
"error-user-notCreated": "Denne Brukeren er ikke opprettet",
|
||||
"error-username-taken": "Brukernavn allerede i bruk",
|
||||
"error-orgname-taken": "Navn på Organisasjon allerede benyttet",
|
||||
"error-teamname-taken": "Navn på Team allerede benyttet",
|
||||
"error-email-taken": "E-postadressen er allerede i bruk",
|
||||
"export-board": "Eksporter tavle",
|
||||
"export-board-json": "Eksporter tavle til JSON",
|
||||
"export-board-csv": "Eksporter tavle til CSV",
|
||||
"export-board-tsv": "Eksporter tavle til TSV",
|
||||
"export-board-excel": "Eksporter Tavle til Excel",
|
||||
"user-can-not-export-excel": "Bruker kan ikke eksportere til Excel",
|
||||
"export-board-html": "Eksporter tavle til HTML",
|
||||
"exportBoardPopup-title": "Eksporter tavle",
|
||||
"sort": "Sorter",
|
||||
@@ -340,6 +344,12 @@
|
||||
"list-label-short-sort": "(M)",
|
||||
"filter": "Filtrer",
|
||||
"filter-cards": "Filtrer Kort eller Lister",
|
||||
"filter-dates-label": "Filtrer etter dato",
|
||||
"filter-no-due-date": "Ingen forfallsdato",
|
||||
"filter-overdue": "Forfalt",
|
||||
"filter-due-today": "Forfall i dag",
|
||||
"filter-due-this-week": "Forfall denne uke",
|
||||
"filter-due-tomorrow": "Forfall i morgen",
|
||||
"list-filter-label": "Filtrer Liste etter tittel",
|
||||
"filter-clear": "Fjern filter",
|
||||
"filter-labels-label": "Filtrer etter Etikett",
|
||||
@@ -382,6 +392,7 @@
|
||||
"import-csv-placeholder": "Lim inn gyldig CSV/TSV-data her",
|
||||
"import-map-members": "Tilknytt medlemmer",
|
||||
"import-members-map": "Importert Tavle har medlemmer. Vennligst tilknytt medlemmer som skal importeres til dine Brukere.",
|
||||
"import-members-map-note": "Merk: Ikke registrerte medlemmer vil bli lagt til nåværende bruker.",
|
||||
"import-show-user-mapping": "Gjennomgang tilknytning medlemmer",
|
||||
"import-user-select": "Velg eksisterende Bruker som skal tilknyttes dette Medlemmet",
|
||||
"importMapMembersAddPopup-title": "Velg Medlem",
|
||||
@@ -527,7 +538,9 @@
|
||||
"custom-login-logo-image-url": "Tilpass URL logo-bilde innlogging",
|
||||
"custom-login-logo-link-url": "Tilpass URL logo-link innlogging",
|
||||
"text-below-custom-login-logo": "Tekst under tilpasset logo innlogging",
|
||||
"automatic-linked-url-schemes": "Egendefinerte URL-tilordninger som automatisk skal kunne klikkes på. Kun én URL-tilordning per linje",
|
||||
"username": "Brukernavn",
|
||||
"import-usernames": "Importer Brukernavn",
|
||||
"view-it": "Se det",
|
||||
"warn-list-archived": "advarsel: dette kortet er i en liste i arkivet",
|
||||
"watch": "Overvåk",
|
||||
@@ -546,7 +559,7 @@
|
||||
"wipLimitErrorPopup-dialog-pt2": "Vennligst flytt noen oppgaver ut av denne listen eller sett høyere WIP-begrensning.",
|
||||
"admin-panel": "Admin-panel",
|
||||
"settings": "Innstillinger",
|
||||
"people": "Folk",
|
||||
"people": "Medlemmer",
|
||||
"registration": "Registrering",
|
||||
"disable-self-registration": "Deaktiver selvregistrering",
|
||||
"invite": "Inviter",
|
||||
@@ -599,7 +612,8 @@
|
||||
"minutes": "minutter",
|
||||
"seconds": "sekunder",
|
||||
"show-field-on-card": "Vis dette feltet på kort",
|
||||
"automatically-field-on-card": "Automatisk oppretting av felt på alle kort",
|
||||
"automatically-field-on-card": "Legg til felt på nye kort",
|
||||
"always-field-on-card": "Legg til felt på alle kort",
|
||||
"showLabel-field-on-card": "Vis feltetikett på minikort",
|
||||
"yes": "Ja",
|
||||
"no": "Nei",
|
||||
@@ -607,6 +621,7 @@
|
||||
"accounts-allowEmailChange": "Tillat endring e-post",
|
||||
"accounts-allowUserNameChange": "Tillat endring brukernavn",
|
||||
"createdAt": "Opprettet på",
|
||||
"modifiedAt": "Endret kl. ",
|
||||
"verified": "Verifisert",
|
||||
"active": "Aktiv",
|
||||
"card-received": "Mottatt",
|
||||
@@ -669,6 +684,7 @@
|
||||
"r-removed-from": "Fjernet fra",
|
||||
"r-the-board": "tavlen",
|
||||
"r-list": "listen",
|
||||
"list": "Liste",
|
||||
"set-filter": "Sett filter",
|
||||
"r-moved-to": "Flyttet til",
|
||||
"r-moved-from": "Flyttet fra",
|
||||
@@ -851,16 +867,144 @@
|
||||
"person": "Person",
|
||||
"my-cards": "Mine Kort",
|
||||
"card": "Kort",
|
||||
"list": "Liste",
|
||||
"board": "Tavle",
|
||||
"context-separator": "/",
|
||||
"myCardsSortChange-title": "Sortering mine Kort",
|
||||
"myCardsSortChangePopup-title": "Sortering mine Kort",
|
||||
"myCardsSortChange-choice-board": "På Tavle",
|
||||
"myCardsSortChange-choice-dueat": "På dato Varighet",
|
||||
"dueCards-title": "Due Cards",
|
||||
"dueCardsViewChange-title": "Due Cards View",
|
||||
"dueCardsViewChange-choice-me": "Me",
|
||||
"dueCardsViewChange-choice-all": "All Users",
|
||||
"dueCardsViewChange-choice-all-description": "Shows all incomplete cards with a *Due* date from boards for which the user has permission.",
|
||||
"broken-cards": "Broken Cards"
|
||||
"dueCards-title": "Forfalte Kort",
|
||||
"dueCardsViewChange-title": "Oversikt Forfalte Kort",
|
||||
"dueCardsViewChangePopup-title": "Oversikt Forfalte Kort",
|
||||
"dueCardsViewChange-choice-me": "Meg",
|
||||
"dueCardsViewChange-choice-all": "Alle Brukere",
|
||||
"dueCardsViewChange-choice-all-description": "Viser alle kort som ikke er ferdigstilt, med \"Forfallsdato\" fra tavler som brukeren har rettigheter til.",
|
||||
"broken-cards": "Broken Cards",
|
||||
"board-title-not-found": "Tavle '%s' ikke funnet.",
|
||||
"swimlane-title-not-found": "Svømmebane '%s' ikke funnet.",
|
||||
"list-title-not-found": "Liste '%s' ikke funnet.",
|
||||
"label-not-found": "Merke '%s' ikke funnet.",
|
||||
"label-color-not-found": "Farge på Merke %s ikke funnet.",
|
||||
"user-username-not-found": "Brukernavn '%s' ikke funnet.",
|
||||
"comment-not-found": "Kort med kommentar som inneholder teksten '%s' ikke funnet.",
|
||||
"globalSearch-title": "Søk i alle Tavler.",
|
||||
"no-cards-found": "Ingen Kort funnet.",
|
||||
"one-card-found": "Ett Kort funnet.",
|
||||
"n-cards-found": "%s Kort funnet.",
|
||||
"n-n-of-n-cards-found": "__start__-__end__ av __total__ Kort funnet",
|
||||
"operator-board": "Tavle",
|
||||
"operator-board-abbrev": "t",
|
||||
"operator-swimlane": "svømmebane",
|
||||
"operator-swimlane-abbrev": "s",
|
||||
"operator-list": "listen",
|
||||
"operator-list-abbrev": "l",
|
||||
"operator-label": "etikett",
|
||||
"operator-label-abbrev": "#",
|
||||
"operator-user": "bruker",
|
||||
"operator-user-abbrev": "@",
|
||||
"operator-member": "Medlem",
|
||||
"operator-member-abbrev": "m",
|
||||
"operator-assignee": "Rettighetstaker",
|
||||
"operator-assignee-abbrev": "r",
|
||||
"operator-creator": "oppretter",
|
||||
"operator-status": "status",
|
||||
"operator-due": "forfall",
|
||||
"operator-created": "opprettet",
|
||||
"operator-modified": "endret",
|
||||
"operator-sort": "sorter",
|
||||
"operator-comment": "kommentar",
|
||||
"operator-has": "har",
|
||||
"operator-limit": "begens",
|
||||
"predicate-archived": "arkivert",
|
||||
"predicate-open": "åpne",
|
||||
"predicate-ended": "avsluttet",
|
||||
"predicate-all": "alle",
|
||||
"predicate-overdue": "forfalt",
|
||||
"predicate-week": "uke",
|
||||
"predicate-month": "måned",
|
||||
"predicate-quarter": "kvartal",
|
||||
"predicate-year": "år",
|
||||
"predicate-due": "forfall",
|
||||
"predicate-modified": "endret",
|
||||
"predicate-created": "opprettet",
|
||||
"predicate-attachment": "vedlegg",
|
||||
"predicate-description": "beskrivelse",
|
||||
"predicate-checklist": "sjekkliste",
|
||||
"predicate-start": "start",
|
||||
"predicate-end": "slutt",
|
||||
"predicate-assignee": "Rettighetstaker",
|
||||
"predicate-member": "Medlem",
|
||||
"predicate-public": "offentlig",
|
||||
"predicate-private": "privat",
|
||||
"operator-unknown-error": "%s er ikke en operator",
|
||||
"operator-number-expected": "operator __operator__ forventet et tall, mottok '__value__'",
|
||||
"operator-sort-invalid": "sortering av '%s' er ugyldig",
|
||||
"operator-status-invalid": "'%s' er ikke en gyldig status",
|
||||
"operator-has-invalid": "%s er ikke en gyldig kontroll av eksistens",
|
||||
"operator-limit-invalid": "%ser ikke en gyldig begrensning. Begrensning må være et positivt heltall.",
|
||||
"next-page": "Neste Side",
|
||||
"previous-page": "Forrige Side",
|
||||
"heading-notes": "Notater",
|
||||
"globalSearch-instructions-heading": "Søk etter Instruksjoner",
|
||||
"globalSearch-instructions-description": "Søk kan inkludere operatorer for å avgrense søket. Operatoren spesifiseres ved å skrive operatorens navn og verdi, atskilt med et kolon. For eksempel vil en spesifisering av operatoren `liste:Blokkert' begrense søket til Kort som er inkludert i en liste med navnet \"Blokkert\". Hvis verdien inneholder mellomrom eller spesialtegn, må den være spesifisert i anførselstegn (f.eks. `__operator_list__:\"To Review\"`).",
|
||||
"globalSearch-instructions-operators": "Tilgjengelige operatorer:",
|
||||
"globalSearch-instructions-operator-board": "`__operator_board__:<title>` - kort i tavlene samsvarer med angitt *<title>*",
|
||||
"globalSearch-instructions-operator-list": "`__operator_list__:<title>` - kort i listene stemmer med angitt *<title>*",
|
||||
"globalSearch-instructions-operator-swimlane": "`__operator_swimlane__:<title>` - kort i svømmebaner samsvarer med angitt *<title>*",
|
||||
"globalSearch-instructions-operator-comment": "`__operator_comment__:<text>` - kort med en kommetar inneholdende *<text>*.",
|
||||
"globalSearch-instructions-operator-label": "`__operator_label__:<color>` `__operator_label__:<name>` - kort med merke som samsvarer med *<color>* or *<name>",
|
||||
"globalSearch-instructions-operator-hash": "`__operator_label_abbrev__<name|color>` - forkortelse for `__operator_label__:<color>` eller `__operator_label__:<name>`",
|
||||
"globalSearch-instructions-operator-user": "`__operator_user__:<username>` - kort hvor *<username>* ier et *medlemr* or *rettighetstaker*",
|
||||
"globalSearch-instructions-operator-at": "`__operator_user_abbrev__username` - forkortelse for bruker:<username>`",
|
||||
"globalSearch-instructions-operator-member": "`__operator_member__:<username>` - kort hvor *<username>* er et *medlem*",
|
||||
"globalSearch-instructions-operator-assignee": "`__operator_assignee__:<username>` - kort hvor *<username>* er en *rettighetstaker*",
|
||||
"globalSearch-instructions-operator-creator": "`__operator_creator__:<username>` - kort hvor *<username>* er kortenes oppretter",
|
||||
"globalSearch-instructions-operator-due": "`__operator_due__:<n>` - kort som forfaller om *<n>* dager fra nå. `__operator_due__:__predicate_overdue__ lister alle kort med passert forfallsdato.",
|
||||
"globalSearch-instructions-operator-created": "`__operator_created__:<n>` - kort som er opprettet *<n>* dager siden eller mindre",
|
||||
"globalSearch-instructions-operator-modified": "`__operator_modified__:<n>` - kort som er modifisert *<n>* dager siden eller mindre",
|
||||
"globalSearch-instructions-operator-status": "`__operator_status__:<status>` - hvor *<status>* er en av de følgende:",
|
||||
"globalSearch-instructions-status-archived": "`__predicate_archived__` - arkiverte kort",
|
||||
"globalSearch-instructions-status-all": "`__predicate_all__` - alle arkiverte eller ikke arkiverte kort",
|
||||
"globalSearch-instructions-status-ended": "`__predicate_ended__` - kort med en sluttdato",
|
||||
"globalSearch-instructions-status-public": "`__predicate_public__` - kort bare i offentlige tavler",
|
||||
"globalSearch-instructions-status-private": "`__predicate_private__` - kort bare i private tavler",
|
||||
"globalSearch-instructions-operator-has": "`__operator_has__:<field>` - hvor *<field>* er en av `__predicate_attachment__`, `__predicate_checklist__`, `__predicate_description__`, `__predicate_start__`, `__predicate_due__`, `__predicate_end__`, `__predicate_assignee__` eller `__predicate_member__`. Plassering av et `-` foran *<field>* søk i mangel på en verdi i et felt (f.eks. `har:-forfall` søker etter alle kort uten en forfallsdato).",
|
||||
"globalSearch-instructions-operator-sort": "`__operator_sort__:<sort-name>` - hvor *<sort-name>* er en av `__predicate_due__`, `__predicate_created__` eller `__predicate_modified__`. For en synkende sortering, plassér en `-` foran navn på sortering.",
|
||||
"globalSearch-instructions-operator-limit": "`__operator_limit__:<n>` - hvor*<n>* er et positivt heltall som angir antall kort som skal vises på siden.",
|
||||
"globalSearch-instructions-notes-1": "Flere operatorer kan angis.",
|
||||
"globalSearch-instructions-notes-2": "Like operatorer er knyttet sammen med \"ELLER\". Kort som samsvarer med noen av de angitte kriteriene vil returneres.\n`__operator_list__:Tilgjengelig __operator_list__:Blokkert` vil returnere Kort som inneholder lister med navnet \"Blokkert\" eller \"Tilgjengelig\".",
|
||||
"globalSearch-instructions-notes-3": "Forskjellige operatorer er knyttet sammen med *OG*. Bare kort som samsvarer med alle de angitte kriteriene vil returneres. `__operator_list__:Tilgjengelig __operator_list__:rød` vil kun returnere kort i listen *Tilgjengelig* og som er markert med et *rødt* merke.",
|
||||
"globalSearch-instructions-notes-3-2": "Dager kan angis som et positivt eller negativt heltall, eller ved bruk av `__predicate_week__`, `__predicate_month__`, `__predicate_quarter__` eller `__predicate_year__` for den aktuelle perioden.",
|
||||
"globalSearch-instructions-notes-4": "Tekstsøk er ikke \"case\"-sensitive.",
|
||||
"globalSearch-instructions-notes-5": "Som standard er arkiverte kort ikke søkbare, ",
|
||||
"link-to-search": "Link til dette søket",
|
||||
"excel-font": "Arial",
|
||||
"number": "Nummer",
|
||||
"label-colors": "Farge Merke",
|
||||
"label-names": "Navn på Merke",
|
||||
"archived-at": "arkivert på",
|
||||
"sort-cards": "Sortér Kort",
|
||||
"cardsSortPopup-title": "Sortér Kort",
|
||||
"due-date": "Forfalldato",
|
||||
"server-error": "Serverfeil",
|
||||
"server-error-troubleshooting": "For hjelp til feilsøk ber vi om innsending av feilmelding generert av server.\nFor Snap-installasjon, kjør: `sudo snap logs wekan.wekan`\nFor Docker-installasjon, kjør: `sudo docker logs wekan-app`",
|
||||
"title-alphabetically": "Tittel (alfabetisk)",
|
||||
"created-at-newest-first": "Opprettet på (Nyeste Først)",
|
||||
"created-at-oldest-first": "Opprettet på (Eldste Først)",
|
||||
"links-heading": "Linker",
|
||||
"hide-system-messages-of-all-users": "Skjul systemmeldinger for alle brukere",
|
||||
"now-system-messages-of-all-users-are-hidden": "Systemmeldinger er nå skjult for alle brukere",
|
||||
"move-swimlane": "Flytt Svømmebane",
|
||||
"moveSwimlanePopup-title": "Flytt Svømmebane",
|
||||
"custom-field-stringtemplate": "Mal Tekststreng",
|
||||
"custom-field-stringtemplate-format": "Format (bruk %{value} som standardverdi)",
|
||||
"custom-field-stringtemplate-separator": "Tekstseparator (bruk   eller som separator)",
|
||||
"custom-field-stringtemplate-item-placeholder": "Trykk Enter for å legge til flere objekt",
|
||||
"creator": "Oppretter",
|
||||
"filesReportTitle": "Rapportering Filer",
|
||||
"orphanedFilesReportTitle": "Rapportering Foreldreløse Filer",
|
||||
"reports": "Rapportering",
|
||||
"rulesReportTitle": "Rapportering Regler",
|
||||
"copy-swimlane": "Kopiér Svømmebane",
|
||||
"copySwimlanePopup-title": "Kopiér Svømmebane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
+1009
-1007
File diff suppressed because it is too large.
Load diff
+1009
-1007
File diff suppressed because it is too large.
Load diff
+1009
-1007
File diff suppressed because it is too large.
Load diff
+1009
-1007
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Filrapport",
|
||||
"orphanedFilesReportTitle": "Föräldralös filrapport",
|
||||
"reports": "Rapporter",
|
||||
"rulesReportTitle": "Regelrapport"
|
||||
"rulesReportTitle": "Regelrapport",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+3
-1
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+1009
-1007
File diff suppressed because it is too large.
Load diff
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
@@ -1004,5 +1004,7 @@
|
||||
"filesReportTitle": "Files Report",
|
||||
"orphanedFilesReportTitle": "Orphaned Files Report",
|
||||
"reports": "Reports",
|
||||
"rulesReportTitle": "Rules Report"
|
||||
"rulesReportTitle": "Rules Report",
|
||||
"copy-swimlane": "Copy Swimlane",
|
||||
"copySwimlanePopup-title": "Copy Swimlane"
|
||||
}
|
||||
+21
-26
@@ -641,37 +641,32 @@ Cards.helpers({
|
||||
);
|
||||
},
|
||||
|
||||
allSubtasks() {
|
||||
return Cards.find(
|
||||
{
|
||||
parentId: this._id,
|
||||
archived: false,
|
||||
},
|
||||
{
|
||||
sort: {
|
||||
sort: 1,
|
||||
},
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
subtasksCount() {
|
||||
return Cards.find({
|
||||
parentId: this._id,
|
||||
archived: false,
|
||||
}).count();
|
||||
},
|
||||
|
||||
subtasksFinishedCount() {
|
||||
subtasksFinished() {
|
||||
return Cards.find({
|
||||
parentId: this._id,
|
||||
archived: true,
|
||||
}).count();
|
||||
});
|
||||
},
|
||||
|
||||
subtasksFinished() {
|
||||
const finishCount = this.subtasksFinishedCount();
|
||||
return finishCount > 0 && this.subtasksCount() === finishCount;
|
||||
allSubtasks() {
|
||||
return Cards.find({
|
||||
parentId: this._id,
|
||||
});
|
||||
},
|
||||
|
||||
subtasksCount() {
|
||||
const subtasks = this.subtasks();
|
||||
return subtasks.count();
|
||||
},
|
||||
|
||||
subtasksFinishedCount() {
|
||||
const subtasksArchived = this.subtasksFinished();
|
||||
return subtasksArchived.count();
|
||||
},
|
||||
|
||||
allSubtasksCount() {
|
||||
const allSubtasks = this.allSubtasks();
|
||||
return allSubtasks.count();
|
||||
},
|
||||
|
||||
allowsSubtasks() {
|
||||
|
||||
+26
-3
@@ -239,7 +239,7 @@ export class ExporterExcel {
|
||||
},
|
||||
{
|
||||
key: 'c',
|
||||
width: 20,
|
||||
width: 60,
|
||||
},
|
||||
{
|
||||
key: 'd',
|
||||
@@ -342,6 +342,10 @@ export class ExporterExcel {
|
||||
key: 'p',
|
||||
width: 20,
|
||||
},
|
||||
{
|
||||
key: 'q',
|
||||
width: 20,
|
||||
},
|
||||
];
|
||||
|
||||
//add title line
|
||||
@@ -378,10 +382,23 @@ export class ExporterExcel {
|
||||
for (const klist in result.lists) {
|
||||
jlist[result.lists[klist]._id] = result.lists[klist].title;
|
||||
}
|
||||
//get kanban swimlanes info
|
||||
const jswimlane = {};
|
||||
for (const kswimlane in result.swimlanes) {
|
||||
jswimlane[result.swimlanes[kswimlane]._id] =
|
||||
result.swimlanes[kswimlane].title;
|
||||
}
|
||||
//get kanban label info
|
||||
const jlabel = {};
|
||||
var isFirst = 1;
|
||||
for (const klabel in result.labels) {
|
||||
jlabel[result.labels[klabel]._id] = result.labels[klabel].name;
|
||||
console.log(klabel);
|
||||
if (isFirst == 0) {
|
||||
jlabel[result.labels[klabel]._id] = `,${result.labels[klabel].name}`;
|
||||
} else {
|
||||
isFirst = 0;
|
||||
jlabel[result.labels[klabel]._id] = result.labels[klabel].name;
|
||||
}
|
||||
}
|
||||
//add data +8 hours
|
||||
function addTZhours(jdate) {
|
||||
@@ -413,7 +430,7 @@ export class ExporterExcel {
|
||||
size: 10,
|
||||
bold: true,
|
||||
};
|
||||
ws.mergeCells('F3:P3');
|
||||
ws.mergeCells('F3:Q3');
|
||||
ws.getCell('B3').style = {
|
||||
font: {
|
||||
name: TAPi18n.__('excel-font'),
|
||||
@@ -487,6 +504,7 @@ export class ExporterExcel {
|
||||
];
|
||||
//add card title
|
||||
//ws.addRow().values = ['编号', '标题', '创建人', '创建时间', '更新时间', '列表', '成员', '描述', '标签'];
|
||||
//this is where order in which the excel file generates
|
||||
ws.addRow().values = [
|
||||
TAPi18n.__('number'),
|
||||
TAPi18n.__('title'),
|
||||
@@ -499,6 +517,7 @@ export class ExporterExcel {
|
||||
TAPi18n.__('card-due'),
|
||||
TAPi18n.__('card-end'),
|
||||
TAPi18n.__('list'),
|
||||
TAPi18n.__('swimlane'),
|
||||
TAPi18n.__('assignee'),
|
||||
TAPi18n.__('members'),
|
||||
TAPi18n.__('labels'),
|
||||
@@ -522,6 +541,7 @@ export class ExporterExcel {
|
||||
allBorder('N5');
|
||||
allBorder('O5');
|
||||
allBorder('P5');
|
||||
allBorder('Q5');
|
||||
cellCenter('A5');
|
||||
cellCenter('B5');
|
||||
cellCenter('C5');
|
||||
@@ -538,6 +558,7 @@ export class ExporterExcel {
|
||||
cellCenter('N5');
|
||||
cellCenter('O5');
|
||||
cellCenter('P5');
|
||||
cellCenter('Q5');
|
||||
ws.getRow(5).font = {
|
||||
name: TAPi18n.__('excel-font'),
|
||||
size: 12,
|
||||
@@ -580,6 +601,7 @@ export class ExporterExcel {
|
||||
addTZhours(jcard.dueAt),
|
||||
addTZhours(jcard.endAt),
|
||||
jlist[jcard.listId],
|
||||
jswimlane[jcard.swimlaneId],
|
||||
jcassig,
|
||||
jcmem,
|
||||
jclabel,
|
||||
@@ -604,6 +626,7 @@ export class ExporterExcel {
|
||||
allBorder(`N${y}`);
|
||||
allBorder(`O${y}`);
|
||||
allBorder(`P${y}`);
|
||||
allBorder(`Q${y}`);
|
||||
cellCenter(`A${y}`);
|
||||
ws.getCell(`B${y}`).alignment = {
|
||||
wrapText: true,
|
||||
|
||||
@@ -147,6 +147,45 @@ Swimlanes.helpers({
|
||||
});
|
||||
},
|
||||
|
||||
move(toBoardId) {
|
||||
this.lists().forEach(list => {
|
||||
const toList = Lists.findOne({
|
||||
boardId: toBoardId,
|
||||
title: list.title,
|
||||
archived: false,
|
||||
});
|
||||
|
||||
let toListId;
|
||||
if (toList) {
|
||||
toListId = toList._id;
|
||||
} else {
|
||||
toListId = Lists.insert({
|
||||
title: list.title,
|
||||
boardId: toBoardId,
|
||||
type: list.type,
|
||||
archived: false,
|
||||
wipLimit: list.wipLimit,
|
||||
});
|
||||
}
|
||||
|
||||
Cards.find({
|
||||
listId: list._id,
|
||||
swimlaneId: this._id,
|
||||
}).forEach(card => {
|
||||
card.move(toBoardId, this._id, toListId);
|
||||
});
|
||||
});
|
||||
|
||||
Swimlanes.update(this._id, {
|
||||
$set: {
|
||||
boardId: toBoardId,
|
||||
},
|
||||
});
|
||||
|
||||
// make sure there is a default swimlane
|
||||
this.board().getDefaultSwimline();
|
||||
},
|
||||
|
||||
cards() {
|
||||
return Cards.find(
|
||||
Filter.mongoSelector({
|
||||
|
||||
@@ -607,6 +607,9 @@ class SchemaProperty(object):
|
||||
|
||||
# deal with subschemas
|
||||
if '.' in name:
|
||||
subschema = name.split('.')[0]
|
||||
subschema = subschema.capitalize()
|
||||
|
||||
if name.endswith('$'):
|
||||
# reference in reference
|
||||
subschema = ''.join([n.capitalize() for n in self.name.split('.')[:-1]])
|
||||
@@ -621,9 +624,12 @@ class SchemaProperty(object):
|
||||
print(''' {}:
|
||||
type: object'''.format(subschema))
|
||||
return current_schema
|
||||
elif '$' in name:
|
||||
# In the form of 'profile.notifications.$.activity'
|
||||
subschema = name[:name.index('$') - 1] # 'profile.notifications'
|
||||
subschema = ''.join([s.capitalize() for s in subschema.split('.')])
|
||||
|
||||
subschema = name.split('.')[0]
|
||||
schema_name = self.schema.name + subschema.capitalize()
|
||||
schema_name = self.schema.name + subschema
|
||||
name = name.split('.')[-1]
|
||||
|
||||
if current_schema != schema_name:
|
||||
@@ -755,7 +761,7 @@ class Schemas(object):
|
||||
# then print the references
|
||||
current = None
|
||||
required_properties = []
|
||||
properties = [f for f in self.fields if '.' in f.name and not f.name.endswith('$')]
|
||||
properties = [f for f in self.fields if '.' in f.name and not '$' in f.name]
|
||||
for prop in properties:
|
||||
current = prop.print_openapi(6, current, required_properties)
|
||||
|
||||
@@ -766,7 +772,7 @@ class Schemas(object):
|
||||
|
||||
required_properties = []
|
||||
# then print the references in the references
|
||||
for prop in [f for f in self.fields if '.' in f.name and f.name.endswith('$')]:
|
||||
for prop in [f for f in self.fields if '.' in f.name and '$' in f.name]:
|
||||
current = prop.print_openapi(6, current, required_properties)
|
||||
|
||||
if required_properties:
|
||||
|
||||
Generated
+8698
-4416
File diff suppressed because it is too large.
Load diff
+18
-56
@@ -1,35 +1,8 @@
|
||||
{
|
||||
"name": "wekan",
|
||||
"version": "v5.23.0",
|
||||
"version": "v5.28.0",
|
||||
"description": "Open-Source kanban",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"lint": "eslint --cache --ext .js --ignore-path .eslintignore .",
|
||||
"lint:eslint:fix": "eslint --ext .js --ignore-path .eslintignore --fix .",
|
||||
"lint:staged": "lint-staged",
|
||||
"prettify": "prettier --write '**/*.js' '**/*.jsx'",
|
||||
"test": "npm run lint"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"meteor npm run prettify",
|
||||
"meteor npm run lint:eslint:fix",
|
||||
"git add --force"
|
||||
],
|
||||
"*.jsx": [
|
||||
"meteor npm run prettify",
|
||||
"meteor npm run lint:eslint:fix",
|
||||
"git add --force"
|
||||
],
|
||||
"*.json": [
|
||||
"prettier --write",
|
||||
"git add --force"
|
||||
]
|
||||
},
|
||||
"pre-commit": "lint:staged",
|
||||
"eslintConfig": {
|
||||
"extends": "@meteorjs/eslint-config-meteor"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/wekan/wekan.git"
|
||||
@@ -40,44 +13,33 @@
|
||||
},
|
||||
"homepage": "https://wekan.github.io",
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-meteor": "0.0.9",
|
||||
"eslint-config-prettier": "^3.6.0",
|
||||
"eslint-import-resolver-meteor": "^0.4.0",
|
||||
"eslint-plugin-import": "^2.20.0",
|
||||
"eslint-plugin-meteor": "^5.1.0",
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"lint-staged": "^7.3.0",
|
||||
"pre-commit": "^1.2.2",
|
||||
"prettier": "^1.19.1",
|
||||
"prettier-eslint": "^9.0.2"
|
||||
"flatted": "^3.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.9.6",
|
||||
"@babel/runtime": "^7.9.6",
|
||||
"@root/request": "^1.6.1",
|
||||
"ajv": "^6.12.4",
|
||||
"@babel/core": "^7.14.0",
|
||||
"@babel/runtime": "^7.14.0",
|
||||
"@liradb2000/markdown-it-mermaid": "^0.4.2",
|
||||
"ajv": "^6.12.6",
|
||||
"babel-runtime": "^6.26.0",
|
||||
"bcrypt": "^5.0.0",
|
||||
"bson": "^4.0.3",
|
||||
"bunyan": "^1.8.12",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"bson": "^4.3.0",
|
||||
"bunyan": "^1.8.15",
|
||||
"core-js": "^2.6.12",
|
||||
"dompurify": "^2.2.8",
|
||||
"es6-promise": "^4.2.4",
|
||||
"exceljs": "^4.2.1",
|
||||
"fibers": "^5.0.0",
|
||||
"flatted": "^3.0.4",
|
||||
"gridfs-stream": "https://github.com/wekan/gridfs-stream/tarball/master",
|
||||
"jszip": "^3.4.0",
|
||||
"ldapjs": "^2.1.1",
|
||||
"markdown-it": "^12.0.2",
|
||||
"jszip": "^3.6.0",
|
||||
"ldapjs": "^2.2.4",
|
||||
"markdown-it": "^12.0.6",
|
||||
"markdown-it-emoji": "^2.0.0",
|
||||
"meteor-node-stubs": "^1.0.3",
|
||||
"mongodb": "^3.6.2",
|
||||
"mongodb": "^3.6.6",
|
||||
"os": "^0.1.1",
|
||||
"page": "^1.11.5",
|
||||
"papaparse": "^5.2.0",
|
||||
"qs": "^6.9.4",
|
||||
"source-map-support": "^0.5.19",
|
||||
"xss": "^1.0.8"
|
||||
"papaparse": "^5.3.0",
|
||||
"qs": "^6.10.1",
|
||||
"source-map-support": "^0.5.19"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { checkNpmVersions } from 'meteor/tmeasday:check-npm-versions';
|
||||
|
||||
checkNpmVersions({
|
||||
'xss': '1.0.8',
|
||||
'dompurify': '2.2.8',
|
||||
}, 'my:xss');
|
||||
@@ -1,4 +1,5 @@
|
||||
import sanitizeXss from 'xss';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
var Markdown = require('markdown-it')({
|
||||
html: true,
|
||||
linkify: true,
|
||||
@@ -6,7 +7,9 @@ var Markdown = require('markdown-it')({
|
||||
breaks: true,
|
||||
});
|
||||
|
||||
import markdownItMermaid from "@liradb2000/markdown-it-mermaid";
|
||||
|
||||
/*
|
||||
// Static URL Scheme Listing
|
||||
var urlschemes = [
|
||||
"aodroplink",
|
||||
@@ -19,7 +22,7 @@ var urlschemes = [
|
||||
"mailspring"
|
||||
];
|
||||
|
||||
// Better would be a field in the admin backend to set this dynamically
|
||||
// Better would be a field in the admin backend to set this dynamically
|
||||
// instead of putting all known or wanted url schemes here hard into code
|
||||
// but i was not able to access those settings
|
||||
// var urlschemes = currentSetting.automaticLinkedUrlSchemes.split('\n');
|
||||
@@ -44,14 +47,18 @@ function mySafeAttrValue(tag, name, value, cssFilter) {
|
||||
// use the default safeAttrValue function to process all non cbthunderlinks
|
||||
return sanitizeXss.safeAttrValue(tag, name, value, cssFilter);
|
||||
}
|
||||
// } else if (tag === 'svg') {
|
||||
// return `<img src="data:image/svg+xml;base64,` + atob(value) + `"></img>`;
|
||||
} else {
|
||||
// use the default safeAttrValue function to process it
|
||||
return sanitizeXss.safeAttrValue(tag, name, value, cssFilter);
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
var emoji = require('markdown-it-emoji');
|
||||
Markdown.use(emoji);
|
||||
Markdown.use(markdownItMermaid);
|
||||
|
||||
if (Package.ui) {
|
||||
const Template = Package.templating.Template;
|
||||
@@ -66,6 +73,6 @@ if (Package.ui) {
|
||||
text = Blaze._toText(self.templateContentBlock, HTML.TEXTMODE.STRING);
|
||||
}
|
||||
|
||||
return HTML.Raw(sanitizeXss(Markdown.render(text), { safeAttrValue: mySafeAttrValue }));
|
||||
return HTML.Raw(DOMPurify.sanitize(Markdown.render(text), {ALLOW_UNKNOWN_PROTOCOLS: true}));
|
||||
}));
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
before_install:
|
||||
- "curl -L http://git.io/s0Zu-w | /bin/sh"
|
||||
@@ -0,0 +1,288 @@
|
||||
# Changelog
|
||||
|
||||
## [v0.1.50] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.1.46)
|
||||
#### 21/1/19 by Harry Adel
|
||||
|
||||
- Bump to version 0.1.50
|
||||
|
||||
- *Merged pull-request:* "filename conversion for FS.HTTP.Handlers.Get" [#9](https://github.com/zcfs/Meteor-CollectionFS/pull/994) ([yatusiter](https://github.com/yatusiter))
|
||||
|
||||
|
||||
|
||||
## [v0.1.46] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.1.46)
|
||||
#### 30/3/15 by Eric Dobbertin
|
||||
|
||||
- Bump to version 0.1.46
|
||||
|
||||
- *Merged pull-request:* [#611](https://github.com/zcfs/Meteor-CollectionFS/issues/611)
|
||||
|
||||
- Exposed request handlers on `FS.HTTP.Handlers` object so that app can override
|
||||
|
||||
## [v0.1.43] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.1.43)
|
||||
#### 20/12/14 by Morten Henriksen
|
||||
- add changelog
|
||||
|
||||
- Bump to version 0.1.43
|
||||
|
||||
- *Fixed bug:* "Doesn't work in IE 8" [#10](https://github.com/zcfs/Meteor-cfs-access-point/issues/10)
|
||||
|
||||
- *Merged pull-request:* "rootUrlPathPrefix fix for cordova" [#9](https://github.com/zcfs/Meteor-cfs-access-point/issues/9) ([dmitriyles](https://github.com/dmitriyles))
|
||||
|
||||
- *Merged pull-request:* "Support for expiration token" [#1](https://github.com/zcfs/Meteor-cfs-access-point/issues/1) ([tanis2000](https://github.com/tanis2000))
|
||||
|
||||
Patches by GitHub users [@dmitriyles](https://github.com/dmitriyles), [@tanis2000](https://github.com/tanis2000).
|
||||
|
||||
## [v0.1.42] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.1.42)
|
||||
#### 17/12/14 by Morten Henriksen
|
||||
## [v0.1.41] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.1.41)
|
||||
#### 17/12/14 by Morten Henriksen
|
||||
- mbr update, remove versions.json
|
||||
|
||||
- Cordova rootUrlPathPrefix fix
|
||||
|
||||
- Bump to version 0.1.41
|
||||
|
||||
## [v0.1.40] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.1.40)
|
||||
#### 17/12/14 by Morten Henriksen
|
||||
- mbr fixed warnings
|
||||
|
||||
- fixes to GET handler
|
||||
|
||||
- add back tests
|
||||
|
||||
- support apps in server subdirectories; closes #8
|
||||
|
||||
- 0.9.1 support
|
||||
|
||||
## [v0.0.39] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.39)
|
||||
#### 28/08/14 by Morten Henriksen
|
||||
- Meteor Package System Update
|
||||
|
||||
## [v0.0.38] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.38)
|
||||
#### 27/08/14 by Eric Dobbertin
|
||||
## [v0.0.37] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.37)
|
||||
#### 26/08/14 by Eric Dobbertin
|
||||
- change package name to lowercase
|
||||
|
||||
## [v0.0.36] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.36)
|
||||
#### 06/08/14 by Eric Dobbertin
|
||||
- pass correct arg
|
||||
|
||||
## [v0.0.35] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.35)
|
||||
#### 06/08/14 by Eric Dobbertin
|
||||
- move to correct place
|
||||
|
||||
## [v0.0.34] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.34)
|
||||
#### 05/08/14 by Eric Dobbertin
|
||||
- *Merged pull-request:* "Added contentLength for ranges and inline content" [#5](https://github.com/zcfs/Meteor-cfs-access-point/issues/5) ([maomorales](https://github.com/maomorales))
|
||||
|
||||
- Content-Length and Last-Modified headers
|
||||
|
||||
Patches by GitHub user [@maomorales](https://github.com/maomorales).
|
||||
|
||||
## [v0.0.33] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.33)
|
||||
#### 31/07/14 by Eric Dobbertin
|
||||
- *Merged pull-request:* "Force browser to download with filename passed in url" [#3](https://github.com/zcfs/Meteor-cfs-access-point/issues/3) ([elbowz](https://github.com/elbowz))
|
||||
|
||||
- Force browser to download with filename passed in url
|
||||
|
||||
Patches by GitHub user [@elbowz](https://github.com/elbowz).
|
||||
|
||||
## [v0.0.32] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.32)
|
||||
#### 28/07/14 by Eric Dobbertin
|
||||
- support collection-specific GET headers
|
||||
|
||||
- update API docs
|
||||
|
||||
## [v0.0.31] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.31)
|
||||
#### 06/07/14 by Eric Dobbertin
|
||||
- allow override filename
|
||||
|
||||
## [v0.0.30] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.30)
|
||||
#### 30/04/14 by Eric Dobbertin
|
||||
- ignore auth on server so that url method can be called on the server
|
||||
|
||||
## [v0.0.29] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.29)
|
||||
#### 30/04/14 by Eric Dobbertin
|
||||
- rework the new authtoken stuff to make it easier to debug and cleaner
|
||||
|
||||
## [v0.0.28] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.28)
|
||||
#### 29/04/14 by Eric Dobbertin
|
||||
- generate api docs
|
||||
|
||||
- adjustments to use new FS.File API functions, plus have `url` function omit query string whenever possible
|
||||
|
||||
- *Merged pull-request:* "Support for expiration token" [#1](https://github.com/zcfs/Meteor-cfs-access-point/issues/1) ([tanis2000](https://github.com/tanis2000))
|
||||
|
||||
- Switched to HTTP.call() to get the server time
|
||||
|
||||
- Better check for options.auth being a number. Check to see if we have Buffer() available on the server side. New check to make sure we have the token. Switched Metheor.method to HTTP.methods for the getServerTime() function.
|
||||
|
||||
- Expiration is now optional. If auth is set to a number, that is the number of seconds the token is valid for.
|
||||
|
||||
- Added time sync with the server for token generation.
|
||||
|
||||
- Added code to pass a token with a set expiration date from the client. Added token check on the server side.
|
||||
|
||||
Patches by GitHub user [@tanis2000](https://github.com/tanis2000).
|
||||
|
||||
## [v0.0.27] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.27)
|
||||
#### 08/04/14 by Eric Dobbertin
|
||||
- clean up/fix whole-file upload handler
|
||||
|
||||
## [v0.0.26] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.26)
|
||||
#### 07/04/14 by Eric Dobbertin
|
||||
- add URL options to get temporary images while uploading and storing
|
||||
|
||||
## [v0.0.25] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.25)
|
||||
#### 03/04/14 by Eric Dobbertin
|
||||
- * allow `setBaseUrl` to be called either outside of Meteor.startup or inside * move encodeParams helper to FS.Utility
|
||||
|
||||
## [v0.0.24] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.24)
|
||||
#### 03/04/14 by Eric Dobbertin
|
||||
- properly remount URLs
|
||||
|
||||
- when uploading chunks, check the insert allow/deny since it's part of inserting
|
||||
|
||||
## [v0.0.23] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.23)
|
||||
#### 31/03/14 by Eric Dobbertin
|
||||
- use latest releases
|
||||
|
||||
## [v0.0.22] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.22)
|
||||
#### 29/03/14 by Morten Henriksen
|
||||
- remove underscore deps
|
||||
|
||||
## [v0.0.21] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.21)
|
||||
#### 25/03/14 by Morten Henriksen
|
||||
- add comments about shareId
|
||||
|
||||
## [v0.0.20] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.20)
|
||||
#### 23/03/14 by Morten Henriksen
|
||||
- Rollback to specific git dependency
|
||||
|
||||
- Try modified test script
|
||||
|
||||
- deps are already in collectionFS
|
||||
|
||||
## [v0.0.19] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.19)
|
||||
#### 22/03/14 by Morten Henriksen
|
||||
- try to fix travis test by using general package references
|
||||
|
||||
## [v0.0.18] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.18)
|
||||
#### 22/03/14 by Morten Henriksen
|
||||
- If the read stream fails we send an error to the client
|
||||
|
||||
## [v0.0.17] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.17)
|
||||
#### 21/03/14 by Morten Henriksen
|
||||
- remove smart lock
|
||||
|
||||
- commit smart.lock, trying to get tests to pass on travis
|
||||
|
||||
- some minor pkg adjustments; trying to get tests to pass on travis
|
||||
|
||||
## [v0.0.16] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.16)
|
||||
#### 18/03/14 by Morten Henriksen
|
||||
- Rollback to using the direct storage adapter - makes more sense when serving files
|
||||
|
||||
- shift to new http.methods streaming api
|
||||
|
||||
- move server side DDP access points to cfs-download-ddp pkg; update API docs
|
||||
|
||||
- fix typo...
|
||||
|
||||
- return something useful
|
||||
|
||||
- convert to streaming
|
||||
|
||||
- Add streaming WIP
|
||||
|
||||
- fix/adjust some tests; minor improvements to some handlers
|
||||
|
||||
- Add unmount and allow mount to use default selector function
|
||||
|
||||
- Refactor access point - wip
|
||||
|
||||
## [v0.0.15] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.15)
|
||||
#### 05/03/14 by Morten Henriksen
|
||||
- Refactor note, encode stuff should be prefixed into FS.Utility
|
||||
|
||||
- FS.File.url add user deps when auth is used
|
||||
|
||||
- fix url method
|
||||
|
||||
- query string fix
|
||||
|
||||
- move PUT access points for HTTP upload into this package; mount DELETE on /record/ as well as /files/; some fixes and improvements to handlers
|
||||
|
||||
## [v0.0.14] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.14)
|
||||
#### 03/03/14 by Eric Dobbertin
|
||||
- better error; return Buffer instead of converting to Uint8Array
|
||||
|
||||
## [v0.0.13] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.13)
|
||||
#### 02/03/14 by Eric Dobbertin
|
||||
- more tests, make everything work, add unpublish method
|
||||
|
||||
- Merge branch 'master' of https://github.com/zcfs/Meteor-cfs-access-point
|
||||
|
||||
## [v0.0.12] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.12)
|
||||
#### 01/03/14 by Eric Dobbertin
|
||||
- add travis-ci image
|
||||
|
||||
- rework URLs a bit, use http-publish package to publish FS.Collection listing, and add a test for this (!)
|
||||
|
||||
- add http-publish dependency
|
||||
|
||||
- del should be delete
|
||||
|
||||
## [v0.0.11] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.11)
|
||||
#### 28/02/14 by Eric Dobbertin
|
||||
- move some code to other packages; redo the HTTP GET/DEL methods
|
||||
|
||||
## [v0.0.10] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.10)
|
||||
#### 28/02/14 by Eric Dobbertin
|
||||
- move DDP upload methods to new cfs-upload-ddp package
|
||||
|
||||
## [v0.0.9] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.9)
|
||||
#### 21/02/14 by Eric Dobbertin
|
||||
- new URL syntax; use the store's file key instead of ID; also fix allow/deny checks with insecure
|
||||
|
||||
## [v0.0.8] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.8)
|
||||
#### 20/02/14 by Eric Dobbertin
|
||||
- support HTTP PUT of new file and fix PUT of existing file
|
||||
|
||||
## [v0.0.7] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.7)
|
||||
#### 17/02/14 by Morten Henriksen
|
||||
- add http-methods dependency
|
||||
|
||||
## [v0.0.6] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.6)
|
||||
#### 16/02/14 by Morten Henriksen
|
||||
## [v0.0.5] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.5)
|
||||
#### 16/02/14 by Morten Henriksen
|
||||
- a few fixes and improvements
|
||||
|
||||
- need to actually mount it
|
||||
|
||||
- attempt at switching to generic HTTP access point; also add support for chunked http downloads (range header)
|
||||
|
||||
## [v0.0.4] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.4)
|
||||
#### 15/02/14 by Morten Henriksen
|
||||
- Merge branch 'master' of https://github.com/zcfs/Meteor-cfs-access-point
|
||||
|
||||
- corrected typo
|
||||
|
||||
- added debugging
|
||||
|
||||
- call HTTP.methods on server only
|
||||
|
||||
- run client side, too, for side effects
|
||||
|
||||
- rework for additional abstraction; also DDP methods don't need to be per-collection so they no longer are
|
||||
|
||||
## [v0.0.3] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.3)
|
||||
#### 13/02/14 by Morten Henriksen
|
||||
## [v0.0.2] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.2)
|
||||
#### 13/02/14 by Morten Henriksen
|
||||
## [v0.0.1] (https://github.com/zcfs/Meteor-cfs-access-point/tree/v0.0.1)
|
||||
#### 13/02/14 by Morten Henriksen
|
||||
- init commit
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013 [@raix](https://github.com/raix) and [@aldeed](https://github.com/aldeed), aka Morten N.O. Nørgaard Henriksen, mh@gi-software.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,32 @@
|
||||
wekan-cfs-access-point [](https://travis-ci.org/CollectionFS/Meteor-cfs-access-point)
|
||||
=========================
|
||||
|
||||
This is a Meteor package used by
|
||||
[CollectionFS](https://github.com/zcfs/Meteor-CollectionFS).
|
||||
|
||||
You don't need to manually add this package to your app. It is added when you
|
||||
add the `wekan-cfs-standard-packages` package. You could potentially use your own access point
|
||||
package instead.
|
||||
|
||||
## Define a URL for Collection Listing
|
||||
|
||||
To define a URL that accepts GET requests and returns a list of published
|
||||
files in a FS.Collection:
|
||||
|
||||
```js
|
||||
Images = new FS.Collection("images", {
|
||||
stores: [myStore]
|
||||
});
|
||||
|
||||
FS.HTTP.publish(Images, function () {
|
||||
// `this` provides a context similar to Meteor.publish
|
||||
return Images.find();
|
||||
});
|
||||
```
|
||||
|
||||
The URL will be '/cfs/record/images', where the `cfs` piece is configurable
|
||||
using the `FS.HTTP.setBaseUrl` method.
|
||||
|
||||
## API Documentation
|
||||
|
||||
[Here](api.md)
|
||||
@@ -0,0 +1,58 @@
|
||||
FS.HTTP.setHeadersForGet = function setHeadersForGet() {
|
||||
// Client Stub
|
||||
};
|
||||
|
||||
FS.HTTP.now = function() {
|
||||
return new Date(new Date() + FS.HTTP._serverTimeDiff);
|
||||
};
|
||||
|
||||
// Returns the localstorage if its found and working
|
||||
// TODO: check if this works in IE
|
||||
// could use Meteor._localStorage - just needs a rewrite
|
||||
FS.HTTP._storage = function() {
|
||||
var storage,
|
||||
fail,
|
||||
uid;
|
||||
try {
|
||||
uid = "test";
|
||||
(storage = window.localStorage).setItem(uid, uid);
|
||||
fail = (storage.getItem(uid) !== uid);
|
||||
storage.removeItem(uid);
|
||||
if (fail) {
|
||||
storage = false;
|
||||
}
|
||||
} catch(e) {
|
||||
console.log("Error initializing storage for FS.HTTP");
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
return storage;
|
||||
};
|
||||
|
||||
// get our storage if found
|
||||
FS.HTTP.storage = FS.HTTP._storage();
|
||||
|
||||
FS.HTTP._prefix = 'fsHTTP.';
|
||||
|
||||
FS.HTTP._serverTimeDiff = 0; // Time difference in ms
|
||||
|
||||
if (FS.HTTP.storage) {
|
||||
// Initialize the FS.HTTP._serverTimeDiff
|
||||
FS.HTTP._serverTimeDiff = (1*FS.HTTP.storage.getItem(FS.HTTP._prefix+'timeDiff')) || 0;
|
||||
// At client startup we figure out the time difference between server and
|
||||
// client time - this includes lag and timezone
|
||||
Meteor.startup(function() {
|
||||
// Call the server method an get server time
|
||||
HTTP.get(rootUrlPathPrefix + '/cfs/servertime', function(error, result) {
|
||||
if (!error) {
|
||||
// Update our server time diff
|
||||
var dateNew = new Date(+result.content);
|
||||
FS.HTTP._serverTimeDiff = dateNew - new Date();// - lag or/and timezone
|
||||
// Update the localstorage
|
||||
FS.HTTP.storage.setItem(FS.HTTP._prefix + 'timeDiff', FS.HTTP._serverTimeDiff);
|
||||
} else {
|
||||
console.log(error.message);
|
||||
}
|
||||
}); // EO Server call
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
rootUrlPathPrefix = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX || "";
|
||||
// Adjust the rootUrlPathPrefix if necessary
|
||||
if (rootUrlPathPrefix.length > 0) {
|
||||
if (rootUrlPathPrefix.slice(0, 1) !== '/') {
|
||||
rootUrlPathPrefix = '/' + rootUrlPathPrefix;
|
||||
}
|
||||
if (rootUrlPathPrefix.slice(-1) === '/') {
|
||||
rootUrlPathPrefix = rootUrlPathPrefix.slice(0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
// prepend ROOT_URL when isCordova
|
||||
if (Meteor.isCordova) {
|
||||
rootUrlPathPrefix = Meteor.absoluteUrl(rootUrlPathPrefix.replace(/^\/+/, '')).replace(/\/+$/, '');
|
||||
}
|
||||
|
||||
baseUrl = '/cfs';
|
||||
FS.HTTP = FS.HTTP || {};
|
||||
|
||||
// Note the upload URL so that client uploader packages know what it is
|
||||
FS.HTTP.uploadUrl = rootUrlPathPrefix + baseUrl + '/files';
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.setBaseUrl
|
||||
* @public
|
||||
* @param {String} newBaseUrl - Change the base URL for the HTTP GET and DELETE endpoints.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
FS.HTTP.setBaseUrl = function setBaseUrl(newBaseUrl) {
|
||||
|
||||
// Adjust the baseUrl if necessary
|
||||
if (newBaseUrl.slice(0, 1) !== '/') {
|
||||
newBaseUrl = '/' + newBaseUrl;
|
||||
}
|
||||
if (newBaseUrl.slice(-1) === '/') {
|
||||
newBaseUrl = newBaseUrl.slice(0, -1);
|
||||
}
|
||||
|
||||
// Update the base URL
|
||||
baseUrl = newBaseUrl;
|
||||
|
||||
// Change the upload URL so that client uploader packages know what it is
|
||||
FS.HTTP.uploadUrl = rootUrlPathPrefix + baseUrl + '/files';
|
||||
|
||||
// Remount URLs with the new baseUrl, unmounting the old, on the server only.
|
||||
// If existingMountPoints is empty, then we haven't run the server startup
|
||||
// code yet, so this new URL will be used at that point for the initial mount.
|
||||
if (Meteor.isServer && !FS.Utility.isEmpty(_existingMountPoints)) {
|
||||
mountUrls();
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* FS.File extensions
|
||||
*/
|
||||
|
||||
/**
|
||||
* @method FS.File.prototype.urlRelative Construct the file url
|
||||
* @public
|
||||
* @param {Object} [options]
|
||||
* @param {String} [options.store] Name of the store to get from. If not defined, the first store defined in `options.stores` for the collection on the client is used.
|
||||
* @param {Boolean} [options.auth=null] Add authentication token to the URL query string? By default, a token for the current logged in user is added on the client. Set this to `false` to omit the token. Set this to a string to provide your own token. Set this to a number to specify an expiration time for the token in seconds.
|
||||
* @param {Boolean} [options.download=false] Should headers be set to force a download? Typically this means that clicking the link with this URL will download the file to the user's Downloads folder instead of displaying the file in the browser.
|
||||
* @param {Boolean} [options.brokenIsFine=false] Return the URL even if we know it's currently a broken link because the file hasn't been saved in the requested store yet.
|
||||
* @param {Boolean} [options.returnWhenStored=false] Flag relevant only on server, Return the URL only when file has been saved to the requested store.
|
||||
* @param {Boolean} [options.metadata=false] Return the URL for the file metadata access point rather than the file itself.
|
||||
* @param {String} [options.uploading=null] A URL to return while the file is being uploaded.
|
||||
* @param {String} [options.storing=null] A URL to return while the file is being stored.
|
||||
* @param {String} [options.filename=null] Override the filename that should appear at the end of the URL. By default it is the name of the file in the requested store.
|
||||
*
|
||||
* Returns the relative HTTP URL for getting the file or its metadata.
|
||||
*/
|
||||
FS.File.prototype.urlRelative = function(options) {
|
||||
var self = this;
|
||||
options = options || {};
|
||||
options = FS.Utility.extend({
|
||||
store: null,
|
||||
auth: null,
|
||||
download: false,
|
||||
metadata: false,
|
||||
brokenIsFine: false,
|
||||
returnWhenStored: false,
|
||||
uploading: null, // return this URL while uploading
|
||||
storing: null, // return this URL while storing
|
||||
filename: null // override the filename that is shown to the user
|
||||
}, options.hash || options); // check for "hash" prop if called as helper
|
||||
|
||||
// Primarily useful for displaying a temporary image while uploading an image
|
||||
if (options.uploading && !self.isUploaded()) {
|
||||
return options.uploading;
|
||||
}
|
||||
|
||||
if (self.isMounted()) {
|
||||
// See if we've stored in the requested store yet
|
||||
var storeName = options.store || self.collection.primaryStore.name;
|
||||
if (!self.hasStored(storeName)) {
|
||||
if (options.storing) {
|
||||
return options.storing;
|
||||
} else if (!options.brokenIsFine) {
|
||||
// In case we want to get back the url only when he is stored
|
||||
if (Meteor.isServer && options.returnWhenStored) {
|
||||
// Wait till file is stored to storeName
|
||||
self.onStored(storeName);
|
||||
} else {
|
||||
// We want to return null if we know the URL will be a broken
|
||||
// link because then we can avoid rendering broken links, broken
|
||||
// images, etc.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add filename to end of URL if we can determine one
|
||||
var filename = options.filename || self.name({store: storeName});
|
||||
if (typeof filename === "string" && filename.length) {
|
||||
filename = '/' + filename;
|
||||
} else {
|
||||
filename = '';
|
||||
}
|
||||
|
||||
// TODO: Could we somehow figure out if the collection requires login?
|
||||
var authToken = '';
|
||||
if (Meteor.isClient && typeof Accounts !== "undefined" && typeof Accounts._storedLoginToken === "function") {
|
||||
if (options.auth !== false) {
|
||||
// Add reactive deps on the user
|
||||
Meteor.userId();
|
||||
|
||||
var authObject = {
|
||||
authToken: Accounts._storedLoginToken() || ''
|
||||
};
|
||||
|
||||
// If it's a number, we use that as the expiration time (in seconds)
|
||||
if (options.auth === +options.auth) {
|
||||
authObject.expiration = FS.HTTP.now() + options.auth * 1000;
|
||||
}
|
||||
|
||||
// Set the authToken
|
||||
var authString = JSON.stringify(authObject);
|
||||
authToken = FS.Utility.btoa(authString);
|
||||
}
|
||||
} else if (typeof options.auth === "string") {
|
||||
// If the user supplies auth token the user will be responsible for
|
||||
// updating
|
||||
authToken = options.auth;
|
||||
}
|
||||
|
||||
// Construct query string
|
||||
var params = {};
|
||||
if (authToken !== '') {
|
||||
params.token = authToken;
|
||||
}
|
||||
if (options.download) {
|
||||
params.download = true;
|
||||
}
|
||||
if (options.store) {
|
||||
// We use options.store here instead of storeName because we want to omit the queryString
|
||||
// whenever possible, allowing users to have "clean" URLs if they want. The server will
|
||||
// assume the first store defined on the server, which means that we are assuming that
|
||||
// the first on the client is also the first on the server. If that's not the case, the
|
||||
// store option should be supplied.
|
||||
params.store = options.store;
|
||||
}
|
||||
var queryString = FS.Utility.encodeParams(params);
|
||||
if (queryString.length) {
|
||||
queryString = '?' + queryString;
|
||||
}
|
||||
|
||||
// Determine which URL to use
|
||||
var area;
|
||||
if (options.metadata) {
|
||||
area = '/record';
|
||||
} else {
|
||||
area = '/files';
|
||||
}
|
||||
|
||||
// Construct and return the http method url
|
||||
return baseUrl + area + '/' + self.collection.name + '/' + self._id + filename + queryString;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @method FS.File.prototype.url Construct the file url
|
||||
* @public
|
||||
* @param {Object} [options]
|
||||
* @param {String} [options.store] Name of the store to get from. If not defined, the first store defined in `options.stores` for the collection on the client is used.
|
||||
* @param {Boolean} [options.auth=null] Add authentication token to the URL query string? By default, a token for the current logged in user is added on the client. Set this to `false` to omit the token. Set this to a string to provide your own token. Set this to a number to specify an expiration time for the token in seconds.
|
||||
* @param {Boolean} [options.download=false] Should headers be set to force a download? Typically this means that clicking the link with this URL will download the file to the user's Downloads folder instead of displaying the file in the browser.
|
||||
* @param {Boolean} [options.brokenIsFine=false] Return the URL even if we know it's currently a broken link because the file hasn't been saved in the requested store yet.
|
||||
* @param {Boolean} [options.metadata=false] Return the URL for the file metadata access point rather than the file itself.
|
||||
* @param {String} [options.uploading=null] A URL to return while the file is being uploaded.
|
||||
* @param {String} [options.storing=null] A URL to return while the file is being stored.
|
||||
* @param {String} [options.filename=null] Override the filename that should appear at the end of the URL. By default it is the name of the file in the requested store.
|
||||
*
|
||||
* Returns the HTTP URL for getting the file or its metadata.
|
||||
*/
|
||||
FS.File.prototype.url = function(options) {
|
||||
self = this;
|
||||
return rootUrlPathPrefix + self.urlRelative(options);
|
||||
};
|
||||
@@ -0,0 +1,307 @@
|
||||
getHeaders = [];
|
||||
getHeadersByCollection = {};
|
||||
|
||||
var contentDisposition = Npm.require('content-disposition');
|
||||
|
||||
FS.HTTP.Handlers = {};
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.Handlers.Del
|
||||
* @public
|
||||
* @returns {any} response
|
||||
*
|
||||
* HTTP DEL request handler
|
||||
*/
|
||||
FS.HTTP.Handlers.Del = function httpDelHandler(ref) {
|
||||
var self = this;
|
||||
var opts = FS.Utility.extend({}, self.query || {}, self.params || {});
|
||||
|
||||
// If DELETE request, validate with 'remove' allow/deny, delete the file, and return
|
||||
FS.Utility.validateAction(ref.collection.files._validators['remove'], ref.file, self.userId);
|
||||
|
||||
/*
|
||||
* From the DELETE spec:
|
||||
* A successful response SHOULD be 200 (OK) if the response includes an
|
||||
* entity describing the status, 202 (Accepted) if the action has not
|
||||
* yet been enacted, or 204 (No Content) if the action has been enacted
|
||||
* but the response does not include an entity.
|
||||
*/
|
||||
self.setStatusCode(200);
|
||||
|
||||
return {
|
||||
deleted: !!ref.file.remove()
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.Handlers.GetList
|
||||
* @public
|
||||
* @returns {Object} response
|
||||
*
|
||||
* HTTP GET file list request handler
|
||||
*/
|
||||
FS.HTTP.Handlers.GetList = function httpGetListHandler() {
|
||||
// Not Yet Implemented
|
||||
// Need to check publications and return file list based on
|
||||
// what user is allowed to see
|
||||
};
|
||||
|
||||
/*
|
||||
requestRange will parse the range set in request header - if not possible it
|
||||
will throw fitting errors and autofill range for both partial and full ranges
|
||||
|
||||
throws error or returns the object:
|
||||
{
|
||||
start
|
||||
end
|
||||
length
|
||||
unit
|
||||
partial
|
||||
}
|
||||
*/
|
||||
var requestRange = function(req, fileSize) {
|
||||
if (req) {
|
||||
if (req.headers) {
|
||||
var rangeString = req.headers.range;
|
||||
|
||||
// Make sure range is a string
|
||||
if (rangeString === ''+rangeString) {
|
||||
|
||||
// range will be in the format "bytes=0-32767"
|
||||
var parts = rangeString.split('=');
|
||||
var unit = parts[0];
|
||||
|
||||
// Make sure parts consists of two strings and range is of type "byte"
|
||||
if (parts.length == 2 && unit == 'bytes') {
|
||||
// Parse the range
|
||||
var range = parts[1].split('-');
|
||||
var start = Number(range[0]);
|
||||
var end = Number(range[1]);
|
||||
|
||||
// Fix invalid ranges?
|
||||
if (range[0] != start) start = 0;
|
||||
if (range[1] != end || !end) end = fileSize - 1;
|
||||
|
||||
// Make sure range consists of a start and end point of numbers and start is less than end
|
||||
if (start < end) {
|
||||
|
||||
var partSize = 0 - start + end + 1;
|
||||
|
||||
// Return the parsed range
|
||||
return {
|
||||
start: start,
|
||||
end: end,
|
||||
length: partSize,
|
||||
size: fileSize,
|
||||
unit: unit,
|
||||
partial: (partSize < fileSize)
|
||||
};
|
||||
|
||||
} else {
|
||||
throw new Meteor.Error(416, "Requested Range Not Satisfiable");
|
||||
}
|
||||
|
||||
} else {
|
||||
// The first part should be bytes
|
||||
throw new Meteor.Error(416, "Requested Range Unit Not Satisfiable");
|
||||
}
|
||||
|
||||
} else {
|
||||
// No range found
|
||||
}
|
||||
|
||||
} else {
|
||||
// throw new Error('No request headers set for _parseRange function');
|
||||
}
|
||||
} else {
|
||||
throw new Error('No request object passed to _parseRange function');
|
||||
}
|
||||
|
||||
return {
|
||||
start: 0,
|
||||
end: fileSize - 1,
|
||||
length: fileSize,
|
||||
size: fileSize,
|
||||
unit: 'bytes',
|
||||
partial: false
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.Handlers.Get
|
||||
* @public
|
||||
* @returns {any} response
|
||||
*
|
||||
* HTTP GET request handler
|
||||
*/
|
||||
FS.HTTP.Handlers.Get = function httpGetHandler(ref) {
|
||||
var self = this;
|
||||
// Once we have the file, we can test allow/deny validators
|
||||
// XXX: pass on the "share" query eg. ?share=342hkjh23ggj for shared url access?
|
||||
FS.Utility.validateAction(ref.collection._validators['download'], ref.file, self.userId /*, self.query.shareId*/);
|
||||
|
||||
var storeName = ref.storeName;
|
||||
|
||||
// If no storeName was specified, use the first defined storeName
|
||||
if (typeof storeName !== "string") {
|
||||
// No store handed, we default to primary store
|
||||
storeName = ref.collection.primaryStore.name;
|
||||
}
|
||||
|
||||
// Get the storage reference
|
||||
var storage = ref.collection.storesLookup[storeName];
|
||||
|
||||
if (!storage) {
|
||||
throw new Meteor.Error(404, "Not Found", 'There is no store "' + storeName + '"');
|
||||
}
|
||||
|
||||
// Get the file
|
||||
var copyInfo = ref.file.copies[storeName];
|
||||
|
||||
if (!copyInfo) {
|
||||
throw new Meteor.Error(404, "Not Found", 'This file was not stored in the ' + storeName + ' store');
|
||||
}
|
||||
|
||||
// Set the content type for file
|
||||
if (typeof copyInfo.type === "string") {
|
||||
self.setContentType(copyInfo.type);
|
||||
} else {
|
||||
self.setContentType('application/octet-stream');
|
||||
}
|
||||
|
||||
// Add 'Content-Disposition' header if requested a download/attachment URL
|
||||
if (typeof ref.download !== "undefined") {
|
||||
var filename = ref.filename || copyInfo.name;
|
||||
self.addHeader('Content-Disposition', contentDisposition(filename));
|
||||
} else {
|
||||
self.addHeader('Content-Disposition', 'inline');
|
||||
}
|
||||
|
||||
// Get the contents range from request
|
||||
var range = requestRange(self.request, copyInfo.size);
|
||||
|
||||
// Some browsers cope better if the content-range header is
|
||||
// still included even for the full file being returned.
|
||||
self.addHeader('Content-Range', range.unit + ' ' + range.start + '-' + range.end + '/' + range.size);
|
||||
|
||||
// If a chunk/range was requested instead of the whole file, serve that'
|
||||
if (range.partial) {
|
||||
self.setStatusCode(206, 'Partial Content');
|
||||
} else {
|
||||
self.setStatusCode(200, 'OK');
|
||||
}
|
||||
|
||||
// Add any other global custom headers and collection-specific custom headers
|
||||
FS.Utility.each(getHeaders.concat(getHeadersByCollection[ref.collection.name] || []), function(header) {
|
||||
self.addHeader(header[0], header[1]);
|
||||
});
|
||||
|
||||
// Inform clients about length (or chunk length in case of ranges)
|
||||
self.addHeader('Content-Length', range.length);
|
||||
|
||||
// Last modified header (updatedAt from file info)
|
||||
self.addHeader('Last-Modified', copyInfo.updatedAt.toUTCString());
|
||||
|
||||
// Inform clients that we accept ranges for resumable chunked downloads
|
||||
self.addHeader('Accept-Ranges', range.unit);
|
||||
|
||||
if (FS.debug) console.log('Read file "' + (ref.filename || copyInfo.name) + '" ' + range.unit + ' ' + range.start + '-' + range.end + '/' + range.size);
|
||||
|
||||
var readStream = storage.adapter.createReadStream(ref.file, {start: range.start, end: range.end});
|
||||
|
||||
readStream.on('error', function(err) {
|
||||
// Send proper error message on get error
|
||||
if (err.message && err.statusCode) {
|
||||
self.Error(new Meteor.Error(err.statusCode, err.message));
|
||||
} else {
|
||||
self.Error(new Meteor.Error(503, 'Service unavailable'));
|
||||
}
|
||||
});
|
||||
|
||||
readStream.pipe(self.createWriteStream());
|
||||
};
|
||||
|
||||
// File with unicode or other encodings filename can upload to server susscessfully,
|
||||
// but when download, the HTTP header "Content-Disposition" cannot accept
|
||||
// characters other than ASCII, the filename should be converted to binary or URI encoded.
|
||||
// https://github.com/wekan/wekan/issues/784
|
||||
const originalHandler = FS.HTTP.Handlers.Get;
|
||||
FS.HTTP.Handlers.Get = function (ref) {
|
||||
try {
|
||||
var userAgent = (this.requestHeaders['user-agent']||'').toLowerCase();
|
||||
if(userAgent.indexOf('msie') >= 0 || userAgent.indexOf('chrome') >= 0) {
|
||||
ref.filename = encodeURIComponent(ref.filename);
|
||||
} else if(userAgent.indexOf('firefox') >= 0) {
|
||||
ref.filename = new Buffer(ref.filename).toString('binary');
|
||||
} else {
|
||||
/* safari*/
|
||||
ref.filename = new Buffer(ref.filename).toString('binary');
|
||||
}
|
||||
} catch (ex){
|
||||
ref.filename = ref.filename;
|
||||
}
|
||||
return originalHandler.call(this, ref);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.Handlers.PutInsert
|
||||
* @public
|
||||
* @returns {Object} response object with _id property
|
||||
*
|
||||
* HTTP PUT file insert request handler
|
||||
*/
|
||||
FS.HTTP.Handlers.PutInsert = function httpPutInsertHandler(ref) {
|
||||
var self = this;
|
||||
var opts = FS.Utility.extend({}, self.query || {}, self.params || {});
|
||||
|
||||
FS.debug && console.log("HTTP PUT (insert) handler");
|
||||
|
||||
// Create the nice FS.File
|
||||
var fileObj = new FS.File();
|
||||
|
||||
// Set its name
|
||||
fileObj.name(opts.filename || null);
|
||||
|
||||
// Attach the readstream as the file's data
|
||||
fileObj.attachData(self.createReadStream(), {type: self.requestHeaders['content-type'] || 'application/octet-stream'});
|
||||
|
||||
// Validate with insert allow/deny
|
||||
FS.Utility.validateAction(ref.collection.files._validators['insert'], fileObj, self.userId);
|
||||
|
||||
// Insert file into collection, triggering readStream storage
|
||||
ref.collection.insert(fileObj);
|
||||
|
||||
// Send response
|
||||
self.setStatusCode(200);
|
||||
|
||||
// Return the new file id
|
||||
return {_id: fileObj._id};
|
||||
};
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.Handlers.PutUpdate
|
||||
* @public
|
||||
* @returns {Object} response object with _id and chunk properties
|
||||
*
|
||||
* HTTP PUT file update chunk request handler
|
||||
*/
|
||||
FS.HTTP.Handlers.PutUpdate = function httpPutUpdateHandler(ref) {
|
||||
var self = this;
|
||||
var opts = FS.Utility.extend({}, self.query || {}, self.params || {});
|
||||
|
||||
var chunk = parseInt(opts.chunk, 10);
|
||||
if (isNaN(chunk)) chunk = 0;
|
||||
|
||||
FS.debug && console.log("HTTP PUT (update) handler received chunk: ", chunk);
|
||||
|
||||
// Validate with insert allow/deny; also mounts and retrieves the file
|
||||
FS.Utility.validateAction(ref.collection.files._validators['insert'], ref.file, self.userId);
|
||||
|
||||
self.createReadStream().pipe( FS.TempStore.createWriteStream(ref.file, chunk) );
|
||||
|
||||
// Send response
|
||||
self.setStatusCode(200);
|
||||
|
||||
return { _id: ref.file._id, chunk: chunk };
|
||||
};
|
||||
@@ -0,0 +1,362 @@
|
||||
var path = Npm.require("path");
|
||||
|
||||
HTTP.publishFormats({
|
||||
fileRecordFormat: function (input) {
|
||||
// Set the method scope content type to json
|
||||
this.setContentType('application/json');
|
||||
if (FS.Utility.isArray(input)) {
|
||||
return EJSON.stringify(FS.Utility.map(input, function (obj) {
|
||||
return FS.Utility.cloneFileRecord(obj);
|
||||
}));
|
||||
} else {
|
||||
return EJSON.stringify(FS.Utility.cloneFileRecord(input));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.setHeadersForGet
|
||||
* @public
|
||||
* @param {Array} headers - List of headers, where each is a two-item array in which item 1 is the header name and item 2 is the header value.
|
||||
* @param {Array|String} [collections] - Which collections the headers should be added for. Omit this argument to add the header for all collections.
|
||||
* @returns {undefined}
|
||||
*/
|
||||
FS.HTTP.setHeadersForGet = function setHeadersForGet(headers, collections) {
|
||||
if (typeof collections === "string") {
|
||||
collections = [collections];
|
||||
}
|
||||
if (collections) {
|
||||
FS.Utility.each(collections, function(collectionName) {
|
||||
getHeadersByCollection[collectionName] = headers || [];
|
||||
});
|
||||
} else {
|
||||
getHeaders = headers || [];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.publish
|
||||
* @public
|
||||
* @param {FS.Collection} collection
|
||||
* @param {Function} func - Publish function that returns a cursor.
|
||||
* @returns {undefined}
|
||||
*
|
||||
* Publishes all documents returned by the cursor at a GET URL
|
||||
* with the format baseUrl/record/collectionName. The publish
|
||||
* function `this` is similar to normal `Meteor.publish`.
|
||||
*/
|
||||
FS.HTTP.publish = function fsHttpPublish(collection, func) {
|
||||
var name = baseUrl + '/record/' + collection.name;
|
||||
// Mount collection listing URL using http-publish package
|
||||
HTTP.publish({
|
||||
name: name,
|
||||
defaultFormat: 'fileRecordFormat',
|
||||
collection: collection,
|
||||
collectionGet: true,
|
||||
collectionPost: false,
|
||||
documentGet: true,
|
||||
documentPut: false,
|
||||
documentDelete: false
|
||||
}, func);
|
||||
|
||||
FS.debug && console.log("Registered HTTP method GET URLs:\n\n" + name + '\n' + name + '/:id\n');
|
||||
};
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.unpublish
|
||||
* @public
|
||||
* @param {FS.Collection} collection
|
||||
* @returns {undefined}
|
||||
*
|
||||
* Unpublishes a restpoint created by a call to `FS.HTTP.publish`
|
||||
*/
|
||||
FS.HTTP.unpublish = function fsHttpUnpublish(collection) {
|
||||
// Mount collection listing URL using http-publish package
|
||||
HTTP.unpublish(baseUrl + '/record/' + collection.name);
|
||||
};
|
||||
|
||||
_existingMountPoints = {};
|
||||
|
||||
/**
|
||||
* @method defaultSelectorFunction
|
||||
* @private
|
||||
* @returns { collection, file }
|
||||
*
|
||||
* This is the default selector function
|
||||
*/
|
||||
var defaultSelectorFunction = function() {
|
||||
var self = this;
|
||||
// Selector function
|
||||
//
|
||||
// This function will have to return the collection and the
|
||||
// file. If file not found undefined is returned - if null is returned the
|
||||
// search was not possible
|
||||
var opts = FS.Utility.extend({}, self.query || {}, self.params || {});
|
||||
|
||||
// Get the collection name from the url
|
||||
var collectionName = opts.collectionName;
|
||||
|
||||
// Get the id from the url
|
||||
var id = opts.id;
|
||||
|
||||
// Get the collection
|
||||
var collection = FS._collections[collectionName];
|
||||
|
||||
//if Mongo ObjectIds are used, then we need to use that in find statement
|
||||
if(collection.options.idGeneration && collection.options.idGeneration === 'MONGO') {
|
||||
// Get the file if possible else return null
|
||||
var file = (id && collection)? collection.findOne({ _id: new Meteor.Collection.ObjectID(id)}): null;
|
||||
} else {
|
||||
var file = (id && collection)? collection.findOne({ _id: id }): null;
|
||||
}
|
||||
|
||||
|
||||
// Return the collection and the file
|
||||
return {
|
||||
collection: collection,
|
||||
file: file,
|
||||
storeName: opts.store,
|
||||
download: opts.download,
|
||||
filename: opts.filename
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* @method FS.HTTP.mount
|
||||
* @public
|
||||
* @param {array of string} mountPoints mount points to map rest functinality on
|
||||
* @param {function} selector_f [selector] function returns `{ collection, file }` for mount points to work with
|
||||
*
|
||||
*/
|
||||
FS.HTTP.mount = function(mountPoints, selector_f) {
|
||||
// We take mount points as an array and we get a selector function
|
||||
var selectorFunction = selector_f || defaultSelectorFunction;
|
||||
|
||||
var accessPoint = {
|
||||
'stream': true,
|
||||
'auth': expirationAuth,
|
||||
'post': function(data) {
|
||||
// Use the selector for finding the collection and file reference
|
||||
var ref = selectorFunction.call(this);
|
||||
|
||||
// We dont support post - this would be normal insert eg. of filerecord?
|
||||
throw new Meteor.Error(501, "Not implemented", "Post is not supported");
|
||||
},
|
||||
'put': function(data) {
|
||||
// Use the selector for finding the collection and file reference
|
||||
var ref = selectorFunction.call(this);
|
||||
|
||||
// Make sure we have a collection reference
|
||||
if (!ref.collection)
|
||||
throw new Meteor.Error(404, "Not Found", "No collection found");
|
||||
|
||||
// Make sure we have a file reference
|
||||
if (ref.file === null) {
|
||||
// No id supplied so we will create a new FS.File instance and
|
||||
// insert the supplied data.
|
||||
return FS.HTTP.Handlers.PutInsert.apply(this, [ref]);
|
||||
} else {
|
||||
if (ref.file) {
|
||||
return FS.HTTP.Handlers.PutUpdate.apply(this, [ref]);
|
||||
} else {
|
||||
throw new Meteor.Error(404, "Not Found", 'No file found');
|
||||
}
|
||||
}
|
||||
},
|
||||
'get': function(data) {
|
||||
// Use the selector for finding the collection and file reference
|
||||
var ref = selectorFunction.call(this);
|
||||
|
||||
// Make sure we have a collection reference
|
||||
if (!ref.collection)
|
||||
throw new Meteor.Error(404, "Not Found", "No collection found");
|
||||
|
||||
// Make sure we have a file reference
|
||||
if (ref.file === null) {
|
||||
// No id supplied so we will return the published list of files ala
|
||||
// http.publish in json format
|
||||
return FS.HTTP.Handlers.GetList.apply(this, [ref]);
|
||||
} else {
|
||||
if (ref.file) {
|
||||
return FS.HTTP.Handlers.Get.apply(this, [ref]);
|
||||
} else {
|
||||
throw new Meteor.Error(404, "Not Found", 'No file found');
|
||||
}
|
||||
}
|
||||
},
|
||||
'delete': function(data) {
|
||||
// Use the selector for finding the collection and file reference
|
||||
var ref = selectorFunction.call(this);
|
||||
|
||||
// Make sure we have a collection reference
|
||||
if (!ref.collection)
|
||||
throw new Meteor.Error(404, "Not Found", "No collection found");
|
||||
|
||||
// Make sure we have a file reference
|
||||
if (ref.file) {
|
||||
return FS.HTTP.Handlers.Del.apply(this, [ref]);
|
||||
} else {
|
||||
throw new Meteor.Error(404, "Not Found", 'No file found');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var accessPoints = {};
|
||||
|
||||
// Add debug message
|
||||
FS.debug && console.log('Registered HTTP method URLs:');
|
||||
|
||||
FS.Utility.each(mountPoints, function(mountPoint) {
|
||||
// Couple mountpoint and accesspoint
|
||||
accessPoints[mountPoint] = accessPoint;
|
||||
// Remember our mountpoints
|
||||
_existingMountPoints[mountPoint] = mountPoint;
|
||||
// Add debug message
|
||||
FS.debug && console.log(mountPoint);
|
||||
});
|
||||
|
||||
// XXX: HTTP:methods should unmount existing mounts in case of overwriting?
|
||||
HTTP.methods(accessPoints);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* @method FS.HTTP.unmount
|
||||
* @public
|
||||
* @param {string | array of string} [mountPoints] Optional, if not specified all mountpoints are unmounted
|
||||
*
|
||||
*/
|
||||
FS.HTTP.unmount = function(mountPoints) {
|
||||
// The mountPoints is optional, can be string or array if undefined then
|
||||
// _existingMountPoints will be used
|
||||
var unmountList;
|
||||
// Container for the mount points to unmount
|
||||
var unmountPoints = {};
|
||||
|
||||
if (typeof mountPoints === 'undefined') {
|
||||
// Use existing mount points - unmount all
|
||||
unmountList = _existingMountPoints;
|
||||
} else if (mountPoints === ''+mountPoints) {
|
||||
// Got a string
|
||||
unmountList = [mountPoints];
|
||||
} else if (mountPoints.length) {
|
||||
// Got an array
|
||||
unmountList = mountPoints;
|
||||
}
|
||||
|
||||
// If we have a list to unmount
|
||||
if (unmountList) {
|
||||
// Iterate over each item
|
||||
FS.Utility.each(unmountList, function(mountPoint) {
|
||||
// Check _existingMountPoints to make sure the mount point exists in our
|
||||
// context / was created by the FS.HTTP.mount
|
||||
if (_existingMountPoints[mountPoint]) {
|
||||
// Mark as unmount
|
||||
unmountPoints[mountPoint] = false;
|
||||
// Release
|
||||
delete _existingMountPoints[mountPoint];
|
||||
}
|
||||
});
|
||||
FS.debug && console.log('FS.HTTP.unmount:');
|
||||
FS.debug && console.log(unmountPoints);
|
||||
// Complete unmount
|
||||
HTTP.methods(unmountPoints);
|
||||
}
|
||||
};
|
||||
|
||||
// ### FS.Collection maps on HTTP pr. default on the following restpoints:
|
||||
// *
|
||||
// baseUrl + '/files/:collectionName/:id/:filename',
|
||||
// baseUrl + '/files/:collectionName/:id',
|
||||
// baseUrl + '/files/:collectionName'
|
||||
//
|
||||
// Change/ replace the existing mount point by:
|
||||
// ```js
|
||||
// // unmount all existing
|
||||
// FS.HTTP.unmount();
|
||||
// // Create new mount point
|
||||
// FS.HTTP.mount([
|
||||
// '/cfs/files/:collectionName/:id/:filename',
|
||||
// '/cfs/files/:collectionName/:id',
|
||||
// '/cfs/files/:collectionName'
|
||||
// ]);
|
||||
// ```
|
||||
//
|
||||
mountUrls = function mountUrls() {
|
||||
// We unmount first in case we are calling this a second time
|
||||
FS.HTTP.unmount();
|
||||
|
||||
FS.HTTP.mount([
|
||||
baseUrl + '/files/:collectionName/:id/:filename',
|
||||
baseUrl + '/files/:collectionName/:id',
|
||||
baseUrl + '/files/:collectionName'
|
||||
]);
|
||||
};
|
||||
|
||||
// Returns the userId from URL token
|
||||
var expirationAuth = function expirationAuth() {
|
||||
var self = this;
|
||||
|
||||
// Read the token from '/hello?token=base64'
|
||||
var encodedToken = self.query.token;
|
||||
|
||||
FS.debug && console.log("token: "+encodedToken);
|
||||
|
||||
if (!encodedToken || !Meteor.users) return false;
|
||||
|
||||
// Check the userToken before adding it to the db query
|
||||
// Set the this.userId
|
||||
var tokenString = FS.Utility.atob(encodedToken);
|
||||
|
||||
var tokenObject;
|
||||
try {
|
||||
tokenObject = JSON.parse(tokenString);
|
||||
} catch(err) {
|
||||
throw new Meteor.Error(400, 'Bad Request');
|
||||
}
|
||||
|
||||
// XXX: Do some check here of the object
|
||||
var userToken = tokenObject.authToken;
|
||||
if (userToken !== ''+userToken) {
|
||||
throw new Meteor.Error(400, 'Bad Request');
|
||||
}
|
||||
|
||||
// If we have an expiration token we should check that it's still valid
|
||||
if (tokenObject.expiration != null) {
|
||||
// check if its too old
|
||||
var now = Date.now();
|
||||
if (tokenObject.expiration < now) {
|
||||
FS.debug && console.log('Expired token: ' + tokenObject.expiration + ' is less than ' + now);
|
||||
throw new Meteor.Error(500, 'Expired token');
|
||||
}
|
||||
}
|
||||
|
||||
// We are not on a secure line - so we have to look up the user...
|
||||
var user = Meteor.users.findOne({
|
||||
$or: [
|
||||
{'services.resume.loginTokens.hashedToken': Accounts._hashLoginToken(userToken)},
|
||||
{'services.resume.loginTokens.token': userToken}
|
||||
]
|
||||
});
|
||||
|
||||
// Set the userId in the scope
|
||||
return user && user._id;
|
||||
};
|
||||
|
||||
HTTP.methods(
|
||||
{'/cfs/servertime': {
|
||||
get: function(data) {
|
||||
return Date.now().toString();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Unify client / server api
|
||||
FS.HTTP.now = function() {
|
||||
return Date.now();
|
||||
};
|
||||
|
||||
// Start up the basic mount points
|
||||
Meteor.startup(function () {
|
||||
mountUrls();
|
||||
});
|
||||
@@ -0,0 +1,271 @@
|
||||
## wekan-cfs-access-point Public API ##
|
||||
|
||||
CollectionFS, add ddp and http accesspoint capability
|
||||
|
||||
_API documentation automatically generated by [docmeteor](https://github.com/raix/docmeteor)._
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.setBaseUrl"></a>*FSHTTP*.setBaseUrl(newBaseUrl) <sub><i>Anywhere</i></sub> ###
|
||||
|
||||
*This method __setBaseUrl__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __newBaseUrl__ *{String}*
|
||||
|
||||
Change the base URL for the HTTP GET and DELETE endpoints.
|
||||
|
||||
|
||||
__Returns__ *{undefined}*
|
||||
|
||||
|
||||
> ```FS.HTTP.setBaseUrl = function setBaseUrl(newBaseUrl) { ...``` [access-point-common.js:29](access-point-common.js#L29)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.File.prototype.url"></a>*fsFile*.url([options]) <sub><i>Anywhere</i></sub> ###
|
||||
|
||||
*This method __url__ is defined in `prototype` of `FS.File`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __options__ *{Object}* (Optional)
|
||||
* __store__ *{String}* (Optional)
|
||||
|
||||
Name of the store to get from. If not defined, the first store defined in `options.stores` for the collection on the client is used.
|
||||
|
||||
* __auth__ *{Boolean}* (Optional, Default = null)
|
||||
|
||||
Add authentication token to the URL query string? By default, a token for the current logged in user is added on the client. Set this to `false` to omit the token. Set this to a string to provide your own token. Set this to a number to specify an expiration time for the token in seconds.
|
||||
|
||||
* __download__ *{Boolean}* (Optional, Default = false)
|
||||
|
||||
Should headers be set to force a download? Typically this means that clicking the link with this URL will download the file to the user's Downloads folder instead of displaying the file in the browser.
|
||||
|
||||
* __brokenIsFine__ *{Boolean}* (Optional, Default = false)
|
||||
|
||||
Return the URL even if we know it's currently a broken link because the file hasn't been saved in the requested store yet.
|
||||
|
||||
* __metadata__ *{Boolean}* (Optional, Default = false)
|
||||
|
||||
Return the URL for the file metadata access point rather than the file itself.
|
||||
|
||||
* __uploading__ *{String}* (Optional, Default = null)
|
||||
|
||||
A URL to return while the file is being uploaded.
|
||||
|
||||
* __storing__ *{String}* (Optional, Default = null)
|
||||
|
||||
A URL to return while the file is being stored.
|
||||
|
||||
* __filename__ *{String}* (Optional, Default = null)
|
||||
|
||||
Override the filename that should appear at the end of the URL. By default it is the name of the file in the requested store.
|
||||
|
||||
|
||||
|
||||
Returns the HTTP URL for getting the file or its metadata.
|
||||
|
||||
> ```FS.File.prototype.url = function(options) { ...``` [access-point-common.js:72](access-point-common.js#L72)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.Handlers.Del"></a>*FSHTTPHandlers*.Del() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __Del__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{any}*
|
||||
response
|
||||
|
||||
|
||||
HTTP DEL request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.Del = function httpDelHandler(ref) { ...``` [access-point-handlers.js:13](access-point-handlers.js#L13)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.Handlers.GetList"></a>*FSHTTPHandlers*.GetList() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __GetList__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{Object}*
|
||||
response
|
||||
|
||||
|
||||
HTTP GET file list request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.GetList = function httpGetListHandler() { ...``` [access-point-handlers.js:41](access-point-handlers.js#L41)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.Handlers.Get"></a>*FSHTTPHandlers*.Get() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __Get__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{any}*
|
||||
response
|
||||
|
||||
|
||||
HTTP GET request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.Get = function httpGetHandler(ref) { ...``` [access-point-handlers.js:135](access-point-handlers.js#L135)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.Handlers.PutInsert"></a>*FSHTTPHandlers*.PutInsert() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __PutInsert__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{Object}*
|
||||
response object with _id property
|
||||
|
||||
|
||||
HTTP PUT file insert request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.PutInsert = function httpPutInsertHandler(ref) { ...``` [access-point-handlers.js:229](access-point-handlers.js#L229)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.Handlers.PutUpdate"></a>*FSHTTPHandlers*.PutUpdate() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __PutUpdate__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{Object}*
|
||||
response object with _id and chunk properties
|
||||
|
||||
|
||||
HTTP PUT file update chunk request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.PutUpdate = function httpPutUpdateHandler(ref) { ...``` [access-point-handlers.js:264](access-point-handlers.js#L264)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.setHeadersForGet"></a>*FSHTTP*.setHeadersForGet(headers, [collections]) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __setHeadersForGet__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __headers__ *{Array}*
|
||||
|
||||
List of headers, where each is a two-item array in which item 1 is the header name and item 2 is the header value.
|
||||
|
||||
* __collections__ *{Array|String}* (Optional)
|
||||
|
||||
Which collections the headers should be added for. Omit this argument to add the header for all collections.
|
||||
|
||||
|
||||
__Returns__ *{undefined}*
|
||||
|
||||
|
||||
> ```FS.HTTP.setHeadersForGet = function setHeadersForGet(headers, collections) { ...``` [access-point-server.js:24](access-point-server.js#L24)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.publish"></a>*FSHTTP*.publish(collection, func) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __publish__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __collection__ *{[FS.Collection](#FS.Collection)}*
|
||||
* __func__ *{Function}*
|
||||
|
||||
Publish function that returns a cursor.
|
||||
|
||||
|
||||
__Returns__ *{undefined}*
|
||||
|
||||
|
||||
Publishes all documents returned by the cursor at a GET URL
|
||||
with the format baseUrl/record/collectionName. The publish
|
||||
function `this` is similar to normal `Meteor.publish`.
|
||||
|
||||
> ```FS.HTTP.publish = function fsHttpPublish(collection, func) { ...``` [access-point-server.js:48](access-point-server.js#L48)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.unpublish"></a>*FSHTTP*.unpublish(collection) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __unpublish__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __collection__ *{[FS.Collection](#FS.Collection)}*
|
||||
|
||||
__Returns__ *{undefined}*
|
||||
|
||||
|
||||
Unpublishes a restpoint created by a call to `FS.HTTP.publish`
|
||||
|
||||
> ```FS.HTTP.unpublish = function fsHttpUnpublish(collection) { ...``` [access-point-server.js:73](access-point-server.js#L73)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.mount"></a>*FSHTTP*.mount(mountPoints, selector_f) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __mount__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __mountPoints__ *{[array of string](#array of string)}*
|
||||
|
||||
mount points to map rest functinality on
|
||||
|
||||
* __selector_f__ *{function}*
|
||||
|
||||
[selector] function returns `{ collection, file }` for mount points to work with
|
||||
|
||||
|
||||
|
||||
> ```FS.HTTP.mount = function(mountPoints, selector_f) { ...``` [access-point-server.js:125](access-point-server.js#L125)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.unmount"></a>*FSHTTP*.unmount([mountPoints]) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __unmount__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __mountPoints__ *{[string ](#string )|[ array of string](# array of string)}* (Optional)
|
||||
|
||||
Optional, if not specified all mountpoints are unmounted
|
||||
|
||||
|
||||
|
||||
|
||||
> ```FS.HTTP.unmount = function(mountPoints) { ...``` [access-point-server.js:223](access-point-server.js#L223)
|
||||
|
||||
|
||||
|
||||
-
|
||||
### FS.Collection maps on HTTP pr. default on the following restpoints:
|
||||
*
|
||||
baseUrl + '/files/:collectionName/:id/:filename',
|
||||
baseUrl + '/files/:collectionName/:id',
|
||||
baseUrl + '/files/:collectionName'
|
||||
|
||||
Change/ replace the existing mount point by:
|
||||
```js
|
||||
unmount all existing
|
||||
FS.HTTP.unmount();
|
||||
Create new mount point
|
||||
FS.HTTP.mount([
|
||||
'/cfs/files/:collectionName/:id/:filename',
|
||||
'/cfs/files/:collectionName/:id',
|
||||
'/cfs/files/:collectionName'
|
||||
]);
|
||||
```
|
||||
@@ -0,0 +1,332 @@
|
||||
## Public and Private API ##
|
||||
|
||||
_API documentation automatically generated by [docmeteor](https://github.com/raix/docmeteor)._
|
||||
|
||||
***
|
||||
|
||||
__File: ["access-point-common.js"](access-point-common.js) Where: {server|client}__
|
||||
|
||||
***
|
||||
|
||||
### <a name="FS.HTTP.setBaseUrl"></a>*FSHTTP*.setBaseUrl(newBaseUrl) <sub><i>Anywhere</i></sub> ###
|
||||
|
||||
*This method __setBaseUrl__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __newBaseUrl__ *{String}*
|
||||
|
||||
Change the base URL for the HTTP GET and DELETE endpoints.
|
||||
|
||||
|
||||
__Returns__ *{undefined}*
|
||||
|
||||
|
||||
> ```FS.HTTP.setBaseUrl = function setBaseUrl(newBaseUrl) { ...``` [access-point-common.js:29](access-point-common.js#L29)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.File.prototype.url"></a>*fsFile*.url([options]) <sub><i>Anywhere</i></sub> ###
|
||||
|
||||
*This method __url__ is defined in `prototype` of `FS.File`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __options__ *{Object}* (Optional)
|
||||
* __store__ *{String}* (Optional)
|
||||
|
||||
Name of the store to get from. If not defined, the first store defined in `options.stores` for the collection on the client is used.
|
||||
|
||||
* __auth__ *{Boolean}* (Optional, Default = null)
|
||||
|
||||
Add authentication token to the URL query string? By default, a token for the current logged in user is added on the client. Set this to `false` to omit the token. Set this to a string to provide your own token. Set this to a number to specify an expiration time for the token in seconds.
|
||||
|
||||
* __download__ *{Boolean}* (Optional, Default = false)
|
||||
|
||||
Should headers be set to force a download? Typically this means that clicking the link with this URL will download the file to the user's Downloads folder instead of displaying the file in the browser.
|
||||
|
||||
* __brokenIsFine__ *{Boolean}* (Optional, Default = false)
|
||||
|
||||
Return the URL even if we know it's currently a broken link because the file hasn't been saved in the requested store yet.
|
||||
|
||||
* __metadata__ *{Boolean}* (Optional, Default = false)
|
||||
|
||||
Return the URL for the file metadata access point rather than the file itself.
|
||||
|
||||
* __uploading__ *{String}* (Optional, Default = null)
|
||||
|
||||
A URL to return while the file is being uploaded.
|
||||
|
||||
* __storing__ *{String}* (Optional, Default = null)
|
||||
|
||||
A URL to return while the file is being stored.
|
||||
|
||||
* __filename__ *{String}* (Optional, Default = null)
|
||||
|
||||
Override the filename that should appear at the end of the URL. By default it is the name of the file in the requested store.
|
||||
|
||||
|
||||
|
||||
Returns the HTTP URL for getting the file or its metadata.
|
||||
|
||||
> ```FS.File.prototype.url = function(options) { ...``` [access-point-common.js:72](access-point-common.js#L72)
|
||||
|
||||
|
||||
***
|
||||
|
||||
__File: ["access-point-handlers.js"](access-point-handlers.js) Where: {server}__
|
||||
|
||||
***
|
||||
|
||||
### <a name="FS.HTTP.Handlers.Del"></a>*FSHTTPHandlers*.Del() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __Del__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{any}*
|
||||
response
|
||||
|
||||
|
||||
HTTP DEL request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.Del = function httpDelHandler(ref) { ...``` [access-point-handlers.js:13](access-point-handlers.js#L13)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="self.setStatusCode"></a>*self*.setStatusCode {any} <sub><i>Server</i></sub> ###
|
||||
|
||||
```
|
||||
From the DELETE spec:
|
||||
A successful response SHOULD be 200 (OK) if the response includes an
|
||||
entity describing the status, 202 (Accepted) if the action has not
|
||||
yet been enacted, or 204 (No Content) if the action has been enacted
|
||||
but the response does not include an entity.
|
||||
```
|
||||
*This property __setStatusCode__ is defined in `self`*
|
||||
|
||||
> ```self.setStatusCode(200);``` [access-point-handlers.js:27](access-point-handlers.js#L27)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.Handlers.GetList"></a>*FSHTTPHandlers*.GetList() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __GetList__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{Object}*
|
||||
response
|
||||
|
||||
|
||||
HTTP GET file list request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.GetList = function httpGetListHandler() { ...``` [access-point-handlers.js:41](access-point-handlers.js#L41)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="requestRange"></a>requestRange {any} <sub><i>Server</i></sub> ###
|
||||
|
||||
```
|
||||
requestRange will parse the range set in request header - if not possible it
|
||||
will throw fitting errors and autofill range for both partial and full ranges
|
||||
throws error or returns the object:
|
||||
{
|
||||
start
|
||||
end
|
||||
length
|
||||
unit
|
||||
partial
|
||||
}
|
||||
```
|
||||
*This property is private*
|
||||
|
||||
> ```var requestRange = function(req, fileSize) { ...``` [access-point-handlers.js:60](access-point-handlers.js#L60)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.Handlers.Get"></a>*FSHTTPHandlers*.Get() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __Get__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{any}*
|
||||
response
|
||||
|
||||
|
||||
HTTP GET request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.Get = function httpGetHandler(ref) { ...``` [access-point-handlers.js:135](access-point-handlers.js#L135)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.Handlers.PutInsert"></a>*FSHTTPHandlers*.PutInsert() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __PutInsert__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{Object}*
|
||||
response object with _id property
|
||||
|
||||
|
||||
HTTP PUT file insert request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.PutInsert = function httpPutInsertHandler(ref) { ...``` [access-point-handlers.js:229](access-point-handlers.js#L229)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.Handlers.PutUpdate"></a>*FSHTTPHandlers*.PutUpdate() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __PutUpdate__ is defined in `FS.HTTP.Handlers`*
|
||||
|
||||
__Returns__ *{Object}*
|
||||
response object with _id and chunk properties
|
||||
|
||||
|
||||
HTTP PUT file update chunk request handler
|
||||
|
||||
> ```FS.HTTP.Handlers.PutUpdate = function httpPutUpdateHandler(ref) { ...``` [access-point-handlers.js:264](access-point-handlers.js#L264)
|
||||
|
||||
|
||||
***
|
||||
|
||||
__File: ["access-point-server.js"](access-point-server.js) Where: {server}__
|
||||
|
||||
***
|
||||
|
||||
### <a name="FS.HTTP.setHeadersForGet"></a>*FSHTTP*.setHeadersForGet(headers, [collections]) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __setHeadersForGet__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __headers__ *{Array}*
|
||||
|
||||
List of headers, where each is a two-item array in which item 1 is the header name and item 2 is the header value.
|
||||
|
||||
* __collections__ *{Array|String}* (Optional)
|
||||
|
||||
Which collections the headers should be added for. Omit this argument to add the header for all collections.
|
||||
|
||||
|
||||
__Returns__ *{undefined}*
|
||||
|
||||
|
||||
> ```FS.HTTP.setHeadersForGet = function setHeadersForGet(headers, collections) { ...``` [access-point-server.js:24](access-point-server.js#L24)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.publish"></a>*FSHTTP*.publish(collection, func) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __publish__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __collection__ *{[FS.Collection](#FS.Collection)}*
|
||||
* __func__ *{Function}*
|
||||
|
||||
Publish function that returns a cursor.
|
||||
|
||||
|
||||
__Returns__ *{undefined}*
|
||||
|
||||
|
||||
Publishes all documents returned by the cursor at a GET URL
|
||||
with the format baseUrl/record/collectionName. The publish
|
||||
function `this` is similar to normal `Meteor.publish`.
|
||||
|
||||
> ```FS.HTTP.publish = function fsHttpPublish(collection, func) { ...``` [access-point-server.js:48](access-point-server.js#L48)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.unpublish"></a>*FSHTTP*.unpublish(collection) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __unpublish__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __collection__ *{[FS.Collection](#FS.Collection)}*
|
||||
|
||||
__Returns__ *{undefined}*
|
||||
|
||||
|
||||
Unpublishes a restpoint created by a call to `FS.HTTP.publish`
|
||||
|
||||
> ```FS.HTTP.unpublish = function fsHttpUnpublish(collection) { ...``` [access-point-server.js:73](access-point-server.js#L73)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="defaultSelectorFunction"></a>defaultSelectorFunction() <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method is private*
|
||||
|
||||
__Returns__ *{ collection, file }*
|
||||
|
||||
|
||||
This is the default selector function
|
||||
|
||||
> ```var defaultSelectorFunction = function() { ...``` [access-point-server.js:87](access-point-server.js#L87)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.mount"></a>*FSHTTP*.mount(mountPoints, selector_f) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __mount__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __mountPoints__ *{[array of string](#array of string)}*
|
||||
|
||||
mount points to map rest functinality on
|
||||
|
||||
* __selector_f__ *{function}*
|
||||
|
||||
[selector] function returns `{ collection, file }` for mount points to work with
|
||||
|
||||
|
||||
|
||||
> ```FS.HTTP.mount = function(mountPoints, selector_f) { ...``` [access-point-server.js:125](access-point-server.js#L125)
|
||||
|
||||
|
||||
-
|
||||
|
||||
### <a name="FS.HTTP.unmount"></a>*FSHTTP*.unmount([mountPoints]) <sub><i>Server</i></sub> ###
|
||||
|
||||
*This method __unmount__ is defined in `FS.HTTP`*
|
||||
|
||||
__Arguments__
|
||||
|
||||
* __mountPoints__ *{[string ](#string )|[ array of string](# array of string)}* (Optional)
|
||||
|
||||
Optional, if not specified all mountpoints are unmounted
|
||||
|
||||
|
||||
|
||||
|
||||
> ```FS.HTTP.unmount = function(mountPoints) { ...``` [access-point-server.js:223](access-point-server.js#L223)
|
||||
|
||||
|
||||
|
||||
-
|
||||
### FS.Collection maps on HTTP pr. default on the following restpoints:
|
||||
*
|
||||
baseUrl + '/files/:collectionName/:id/:filename',
|
||||
baseUrl + '/files/:collectionName/:id',
|
||||
baseUrl + '/files/:collectionName'
|
||||
|
||||
Change/ replace the existing mount point by:
|
||||
```js
|
||||
unmount all existing
|
||||
FS.HTTP.unmount();
|
||||
Create new mount point
|
||||
FS.HTTP.mount([
|
||||
'/cfs/files/:collectionName/:id/:filename',
|
||||
'/cfs/files/:collectionName/:id',
|
||||
'/cfs/files/:collectionName'
|
||||
]);
|
||||
```
|
||||
@@ -0,0 +1,65 @@
|
||||
Package.describe({
|
||||
name: 'wekan-cfs-access-point',
|
||||
version: '0.1.50',
|
||||
summary: 'CollectionFS, add ddp and http accesspoint capability',
|
||||
git: 'https://github.com/zcfs/Meteor-cfs-access-point.git'
|
||||
});
|
||||
|
||||
Npm.depends({
|
||||
"content-disposition": "0.5.0"
|
||||
});
|
||||
|
||||
Package.onUse(function(api) {
|
||||
api.versionsFrom('1.0');
|
||||
|
||||
// This imply is needed for tests, and is technically probably correct anyway.
|
||||
api.imply([
|
||||
'wekan-cfs-base-package'
|
||||
]);
|
||||
|
||||
api.use([
|
||||
//CFS packages
|
||||
'wekan-cfs-base-package@0.0.30',
|
||||
'wekan-cfs-file@0.1.16',
|
||||
//Core packages
|
||||
'check',
|
||||
'ejson',
|
||||
//Other packages
|
||||
'wekan-cfs-http-methods@0.0.29',
|
||||
'wekan-cfs-http-publish@0.0.13'
|
||||
]);
|
||||
|
||||
api.addFiles([
|
||||
'access-point-common.js',
|
||||
'access-point-handlers.js',
|
||||
'access-point-server.js'
|
||||
], 'server');
|
||||
|
||||
api.addFiles([
|
||||
'access-point-common.js',
|
||||
'access-point-client.js'
|
||||
], 'client');
|
||||
});
|
||||
|
||||
Package.onTest(function (api) {
|
||||
api.versionsFrom('1.0');
|
||||
|
||||
api.use([
|
||||
//CFS packages
|
||||
'wekan-cfs-access-point',
|
||||
'wekan-cfs-standard-packages@0.0.2',
|
||||
'wekan-cfs-gridfs@0.0.0',
|
||||
//Core packages
|
||||
'test-helpers',
|
||||
'http',
|
||||
'tinytest',
|
||||
'underscore',
|
||||
'ejson',
|
||||
'ordered-dict',
|
||||
'random',
|
||||
'deps'
|
||||
]);
|
||||
|
||||
api.addFiles('tests/client-tests.js', 'client');
|
||||
api.addFiles('tests/server-tests.js', 'server');
|
||||
});
|
||||
Loaded 100 of 365 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user