Merge branch 'upgrade-meteor-2.6' of https://github.com/majus/wekan into upgrade-meteor

This commit is contained in:
Lauri Ojansivu 2022-04-18 21:25:47 +03:00
commit 0c3ca14699
268 changed files with 3109 additions and 10419 deletions

View file

@ -42,7 +42,7 @@ template(name="addReactionPopup")
span.add-comment-reaction(data-codepoint="#{codepoint}") !{codepoint}
template(name="activity")
.activity
.activity(data-id=activity._id)
+userAvatar(userId=activity.user._id)
p.activity-desc
span.activity-member
@ -152,10 +152,10 @@ template(name="activity")
+editOrDeleteComment
if($eq activity.activityType 'deleteComment')
| {{{_ 'activity-deleteComment' currentData.commentId}}}.
| {{{_ 'activity-deleteComment' activity.commentId}}}.
if($eq activity.activityType 'editComment')
| {{{_ 'activity-editComment' currentData.commentId}}}.
| {{{_ 'activity-editComment' activity.commentId}}}.
else
//- if we are not in card mode we only display a summary of the comment
if($eq activity.activityType 'addComment')

View file

@ -1,4 +1,5 @@
import DOMPurify from 'dompurify';
import { TAPi18n } from '/imports/i18n';
const activitiesPerPage = 500;

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
const subManager = new SubsManager();
const { calculateIndex } = Utils;
const swimlaneWhileSortingHeight = 150;
@ -267,9 +269,10 @@ BlazeComponent.extendComponent({
openNewListForm() {
if (this.isViewSwimlanes()) {
this.childComponents('swimlane')[0]
.childComponents('addListAndSwimlaneForm')[0]
.open();
// The form had been removed in 416b17062e57f215206e93a85b02ef9eb1ab4902
// this.childComponents('swimlane')[0]
// .childComponents('addListAndSwimlaneForm')[0]
// .open();
} else if (this.isViewLists()) {
this.childComponents('listsGroup')[0]
.childComponents('addListForm')[0]

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
/*
const DOWNCLS = 'fa-sort-down';
const UPCLS = 'fa-sort-up';

View file

@ -13,7 +13,7 @@ template(name="boardList")
select.js-AllBoardOrgs#jsAllBoardOrgs("multiple")
option(value="-1") {{_ 'organizations'}} :
each orgsDatas
option(value="{{orgId}}") {{_ orgDisplayName}}
option(value="{{orgId}}") {{orgDisplayName}}
//li.AllBoardTemplates
// if userHasTemplates

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
const subManager = new SubsManager();
Template.boardListHeaderBar.events({
@ -33,7 +35,6 @@ BlazeComponent.extendComponent({
}
if (userLanguage) {
TAPi18n.setLanguage(userLanguage);
T9n.setLanguage(userLanguage);
}
},

View file

@ -20,7 +20,7 @@ template(name="attachmentsGalery")
each attachments
.attachment-item
a.attachment-thumbnail.swipebox(href="{{link}}" title="{{name}}")
if link
if isUploaded
if isImage
img.attachment-thumbnail-img(src="{{link}}")
else if($eq extension 'mp3')
@ -38,7 +38,7 @@ template(name="attachmentsGalery")
else
span.attachment-thumbnail-ext= extension
else
+spinner
span.attachment-thumbnail-ext= extension
p.attachment-details
= name
span.file-size ({{fileSize size}} KB)

View file

@ -1,3 +1,5 @@
import moment from 'moment';
import { TAPi18n } from '/imports/i18n';
import { DatePicker } from '/client/lib/datepicker';
import Cards from '/models/cards';

View file

@ -1,3 +1,5 @@
import moment from 'moment';
import { TAPi18n } from '/imports/i18n';
import { DatePicker } from '/client/lib/datepicker';
Template.dateBadge.helpers({

View file

@ -1,3 +1,5 @@
import moment from 'moment';
import { TAPi18n } from '/imports/i18n';
import { DatePicker } from '/client/lib/datepicker';
import Cards from '/models/cards';
import Boards from '/models/boards';
@ -7,7 +9,6 @@ import Users from '/models/users';
import Lists from '/models/lists';
import CardComments from '/models/cardComments';
import { ALLOWED_COLORS } from '/config/const';
import moment from 'moment';
import { UserAvatar } from '../users/userAvatar';
const subManager = new SubsManager();
@ -1795,6 +1796,7 @@ Template.cardAssigneePopup.helpers({
return user && user.isBoardAdmin() ? 'admin' : 'normal';
},
/*
presenceStatusClassName() {
const user = Users.findOne(this.userId);
const userPresence = presences.findOne({ userId: this.userId });
@ -1804,7 +1806,7 @@ Template.cardAssigneePopup.helpers({
return 'active';
else return 'idle';
},
*/
isCardAssignee() {
const card = Template.parentData();
const cardAssignees = card.getAssignees();

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
BlazeComponent.extendComponent({
template() {
return 'editCardSpentTime';

View file

@ -1,3 +1,4 @@
import { TAPi18n } from '/imports/i18n';
import Cards from '/models/cards';
import Boards from '/models/boards';

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
// Template.cards.events({
// 'click .member': Popup.open('cardMember')
// });

View file

@ -1,3 +1,4 @@
import { TAPi18n } from '/imports/i18n';
require('/client/lib/jquery-ui.js')
const { calculateIndex } = Utils;

View file

@ -1,3 +1,4 @@
import { TAPi18n } from '/imports/i18n';
import { Spinner } from '/client/lib/spinner';
const subManager = new SubsManager();
@ -42,7 +43,6 @@ BlazeComponent.extendComponent({
const position = this.currentData().position;
const title = textarea.val().trim();
const formComponent = this.childComponents('addCardForm')[0];
let sortIndex;
if (position === 'top') {
sortIndex = Utils.calculateIndex(null, firstCardDom).base;
@ -50,6 +50,7 @@ BlazeComponent.extendComponent({
sortIndex = Utils.calculateIndex(lastCardDom, null).base;
}
const formComponent = this.cardFormComponent();
const members = formComponent.members.get();
const labelIds = formComponent.labels.get();
const customFields = formComponent.customFields.get();
@ -131,6 +132,16 @@ BlazeComponent.extendComponent({
}
},
cardFormComponent() {
for (const inlinedForm of this.childComponents('inlinedForm')) {
const [addCardForm] = inlinedForm.childComponents('addCardForm');
if (addCardForm) {
return addCardForm;
}
}
return null;
},
scrollToBottom() {
const container = this.firstNode();
$(container).animate({

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
let listsColors;
Meteor.startup(() => {
listsColors = Lists.simpleSchema()._schema.color.allowedValues;

View file

@ -1,3 +1,4 @@
import { TAPi18n } from '/imports/i18n';
import { CardSearchPagedComponent } from '../../lib/cardSearch';
import Boards from '../../../models/boards';
import { Query, QueryErrors } from '../../../config/query-classes';

View file

@ -1,10 +1,6 @@
BlazeLayout.setRoot('body');
import { TAPi18n } from '/imports/i18n';
const i18nTagToT9n = i18nTag => {
// t9n/i18n tags are same now, see: https://github.com/softwarerero/meteor-accounts-t9n/pull/129
// but we keep this conversion function here, to be aware that that they are different system.
return i18nTag;
};
BlazeLayout.setRoot('body');
let alreadyCheck = 1;
let isCheckDone = false;
@ -73,11 +69,6 @@ Template.userFormsLayout.onRendered(() => {
AccountsTemplates.state.form.keys,
validator,
);
const i18nTag = navigator.language;
if (i18nTag) {
T9n.setLanguage(i18nTagToT9n(i18nTag));
}
EscapeActions.executeAll();
});
@ -102,11 +93,11 @@ Template.userFormsLayout.helpers({
getLegalNoticeWithWritTraduction(){
let spanLegalNoticeElt = $("#legalNoticeSpan");
if(spanLegalNoticeElt != null && spanLegalNoticeElt != undefined){
spanLegalNoticeElt.html(TAPi18n.__('acceptance_of_our_legalNotice', {}, T9n.getLanguage() || 'en'));
spanLegalNoticeElt.html(TAPi18n.__('acceptance_of_our_legalNotice', {}));
}
let atLinkLegalNoticeElt = $("#legalNoticeAtLink");
if(atLinkLegalNoticeElt != null && atLinkLegalNoticeElt != undefined){
atLinkLegalNoticeElt.html(TAPi18n.__('legalNotice', {}, T9n.getLanguage() || 'en'));
atLinkLegalNoticeElt.html(TAPi18n.__('legalNotice', {}));
}
return true;
},
@ -124,116 +115,27 @@ Template.userFormsLayout.helpers({
},
languages() {
return _.map(TAPi18n.getLanguages(), (lang, code) => {
const tag = code;
let name = lang.name;
if (lang.name === 'br') {
name = 'Brezhoneg';
} else if (lang.name === 'ar-EG') {
// ar-EG = Arabic (Egypt), simply Masri (مَصرى, [ˈmɑsˤɾi], Egyptian, Masr refers to Cairo)
name = 'مَصرى';
} else if (lang.name === 'cs-CZ') {
name = 'čeština (Česká republika)';
} else if (lang.name === 'de-CH') {
name = 'Deutsch (Schweiz)';
} else if (lang.name === 'de-AT') {
name = 'Deutsch (Österreich)';
} else if (lang.name === 'en-BR') {
name = 'English (Brazil)';
} else if (lang.name === 'en-DE') {
name = 'English (Germany)';
} else if (lang.name === 'et-EE') {
name = 'eesti keel (Eesti)';
} else if (lang.name === 'fa-IR') {
// fa-IR = Persian (Iran)
name = 'فارسی/پارسی (ایران‎)';
} else if (lang.name === 'fr-BE') {
name = 'Français (Belgique)';
} else if (lang.name === 'fr-CA') {
name = 'Français (Canada)';
} else if (lang.name === 'fr-CH') {
name = 'Français (Schweiz)';
} else if (lang.name === 'gu-IN') {
// gu-IN = Gurajati (India)
name = 'ગુજરાતી';
} else if (lang.name === 'hi-IN') {
// hi-IN = Hindi (India)
name = 'हिंदी (भारत)';
} else if (lang.name === 'ig') {
name = 'Igbo';
} else if (lang.name === 'lv') {
name = 'Latviešu';
} else if (lang.name === 'latviešu valoda') {
name = 'Latviešu';
} else if (lang.name === 'ms-MY') {
// ms-MY = Malay (Malaysia)
name = 'بهاس ملايو';
} else if (lang.name === 'en-IT') {
name = 'English (Italy)';
} else if (lang.name === 'el-GR') {
// el-GR = Greek (Greece)
name = 'Ελληνικά (Ελλάδα)';
} else if (lang.name === 'Español') {
name = 'español';
} else if (lang.name === 'es_419') {
name = 'español de América Latina';
} else if (lang.name === 'es-419') {
name = 'español de América Latina';
} else if (lang.name === 'Español de América Latina') {
name = 'español de América Latina';
} else if (lang.name === 'es-LA') {
name = 'español de América Latina';
} else if (lang.name === 'Español de Argentina') {
name = 'español de Argentina';
} else if (lang.name === 'Español de Chile') {
name = 'español de Chile';
} else if (lang.name === 'Español de Colombia') {
name = 'español de Colombia';
} else if (lang.name === 'Español de México') {
name = 'español de México';
} else if (lang.name === 'es-PY') {
name = 'español de Paraguayo';
} else if (lang.name === 'Español de Paraguayo') {
name = 'español de Paraguayo';
} else if (lang.name === 'Español de Perú') {
name = 'español de Perú';
} else if (lang.name === 'Español de Puerto Rico') {
name = 'español de Puerto Rico';
} else if (lang.name === 'gl-ES') {
name = 'Galego (España)';
} else if (lang.name === 'oc') {
name = 'Occitan';
} else if (lang.name === 'ru-UA') {
name = 'Русский (Украина)';
} else if (lang.name === 'st') {
name = 'Sãotomense';
} else if (lang.name === 'uk-UA') {
name = 'українська (Україна)';
} else if (lang.name === '繁体中文(台湾)') {
// Traditional Chinese (Taiwan)
name = '繁體中文(台灣)';
}
return { tag, name };
}).sort(function(a, b) {
if (a.name === b.name) {
return 0;
} else {
return a.name > b.name ? 1 : -1;
}
});
return TAPi18n.getSupportedLanguages()
.map(({ isoCode, name }) => ({ tag: isoCode, name }))
.sort((a, b) => {
if (a.name === b.name) {
return 0;
} else {
return a.name > b.name ? 1 : -1;
}
});
},
isCurrentLanguage() {
const t9nTag = i18nTagToT9n(this.tag);
const curLang = T9n.getLanguage() || 'en';
return t9nTag === curLang;
const curLang = TAPi18n.getLanguage();
return this.tag === curLang;
},
});
Template.userFormsLayout.events({
'change .js-userform-set-language'(event) {
const i18nTag = $(event.currentTarget).val();
T9n.setLanguage(i18nTagToT9n(i18nTag));
const tag = $(event.currentTarget).val();
TAPi18n.setLanguage(tag);
event.preventDefault();
},
'click #at-btn'(event, templateInstance) {

View file

@ -71,14 +71,14 @@ template(name="myCards")
.my-cards-board-badge(class=board.colorClass, id="header")
.my-cards-card-title-table
a.minicard-wrapper(href=card.originRelativeUrl)
{{card.title}}
| {{card.title}}
td
{{list.title}}
| {{list.title}}
td
a(href=board.originRelativeUrl)
{{board.title}}
| {{board.title}}
td
{{swimlane.title}}
| {{swimlane.title}}
unless isMiniScreen
td
@ -90,10 +90,10 @@ template(name="myCards")
.div
each label in card.labelIds
span.card-label(class="card-label-{{labelColor board label}}" title=name)
{{labelName board label}}
| {{labelName board label}}
td
if card.dueAt
{{ moment card.dueAt 'LLL' }}
| {{ moment card.dueAt 'LLL' }}
template(name="myCardsViewChangePopup")
if currentUser

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
BlazeComponent.extendComponent({
onCreated() {
this.subscribe('allRules');

View file

@ -1,3 +1,4 @@
import { TAPi18n } from '/imports/i18n';
import { AttachmentStorage } from '/models/attachments';
import { CardSearchPagedComponent } from '/client/lib/cardSearch';
import SessionData from '/models/usersessiondata';

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
BlazeComponent.extendComponent({
onCreated() {
this.info = new ReactiveVar({});

View file

@ -403,7 +403,7 @@ template(name="editUserPopup")
select.js-orgs#jsOrgs
option(value="-1") {{_ 'organizations'}} :
each value in orgsDatas
option(value="{{value._id}}") {{_ value.orgDisplayName}}
option(value="{{value._id}}") {{value.orgDisplayName}}
input#jsUserOrgsInPut.js-userOrgs(type="text" value=user.orgsUserBelongs, disabled)
input#jsUserOrgIdsInPut.js-userOrgIds.hide(type="text" value=user.orgIdsUserBelongs)
label
@ -543,7 +543,7 @@ template(name="newUserPopup")
select.js-orgsNewUser#jsOrgsNewUser
option(value="-1") {{_ 'organizations'}} :
each value in orgsDatas
option(value="{{value._id}}") {{_ value.orgDisplayName}}
option(value="{{value._id}}") {{value.orgDisplayName}}
input#jsUserOrgsInPutNewUser.js-userOrgsNewUser(type="text" value=user.orgsUserBelongs, disabled)
input#jsUserOrgIdsInPutNewUser.js-userOrgIdsNewUser.hide(type="text" value=user.orgIdsUserBelongs)
label

View file

@ -1,3 +1,4 @@
import { TAPi18n } from '/imports/i18n';
import { ALLOWED_WAIT_SPINNERS } from '/config/const';
BlazeComponent.extendComponent({

View file

@ -529,7 +529,7 @@ template(name="addBoardOrgPopup")
select.js-boardOrgs#jsBoardOrgs
option(value="-1") {{_ 'organizations'}} :
each value in orgsDatas
option(value="{{value._id}}") {{_ value.orgDisplayName}}
option(value="{{value._id}}") {{value.orgDisplayName}}
template(name="removeBoardOrgPopup")
form

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
Sidebar = null;
const defaultView = 'home';

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
//archivedRequested = false;
const subManager = new SubsManager();

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
BlazeComponent.extendComponent({
customFields() {
return CustomFields.find({

View file

@ -26,6 +26,7 @@ Template.userAvatar.helpers({
return user && user.isBoardAdmin() ? 'admin' : 'normal';
},
/*
presenceStatusClassName() {
const user = Users.findOne(this.userId);
const userPresence = presences.findOne({ userId: this.userId });
@ -35,6 +36,8 @@ Template.userAvatar.helpers({
return 'active';
else return 'idle';
},
*/
});
Template.userAvatarInitials.helpers({

View file

@ -1,3 +1,5 @@
import { TAPi18n } from '/imports/i18n';
Template.headerUserBar.events({
'click .js-open-header-member-menu': Popup.open('memberMenu'),
'click .js-change-avatar': Popup.open('changeAvatar'),
@ -256,105 +258,15 @@ Template.changePasswordPopup.onRendered(function() {
Template.changeLanguagePopup.helpers({
languages() {
return _.map(TAPi18n.getLanguages(), (lang, code) => {
// Same code in /client/components/main/layouts.js
// TODO : Make code reusable
const tag = code;
let name = lang.name;
if (lang.name === 'br') {
name = 'Brezhoneg';
} else if (lang.name === 'ar-EG') {
// ar-EG = Arabic (Egypt), simply Masri (مَصرى, [ˈmɑsˤɾi], Egyptian, Masr refers to Cairo)
name = 'مَصرى';
} else if (lang.name === 'cs-CZ') {
name = 'čeština (Česká republika)';
} else if (lang.name === 'de-CH') {
name = 'Deutsch (Schweiz)';
} else if (lang.name === 'de-AT') {
name = 'Deutsch (Österreich)';
} else if (lang.name === 'en-BR') {
name = 'English (Brazil)';
} else if (lang.name === 'en-DE') {
name = 'English (Germany)';
} else if (lang.name === 'et-EE') {
name = 'eesti keel (Eesti)';
} else if (lang.name === 'fa-IR') {
// fa-IR = Persian (Iran)
name = 'فارسی/پارسی (ایران‎)';
} else if (lang.name === 'fr-BE') {
name = 'Français (Belgique)';
} else if (lang.name === 'fr-CA') {
name = 'Français (Canada)';
} else if (lang.name === 'fr-CH') {
name = 'Français (Schweiz)';
} else if (lang.name === 'gu-IN') {
// gu-IN = Gurajati (India)
name = 'ગુજરાતી';
} else if (lang.name === 'hi-IN') {
// hi-IN = Hindi (India)
name = 'हिंदी (भारत)';
} else if (lang.name === 'ig') {
name = 'Igbo';
} else if (lang.name === 'lv') {
name = 'Latviešu';
} else if (lang.name === 'latviešu valoda') {
name = 'Latviešu';
} else if (lang.name === 'ms-MY') {
// ms-MY = Malay (Malaysia)
name = 'بهاس ملايو';
} else if (lang.name === 'en-IT') {
name = 'English (Italy)';
} else if (lang.name === 'el-GR') {
// el-GR = Greek (Greece)
name = 'Ελληνικά (Ελλάδα)';
} else if (lang.name === 'Español') {
name = 'español';
} else if (lang.name === 'es_419') {
name = 'español de América Latina';
} else if (lang.name === 'es-419') {
name = 'español de América Latina';
} else if (lang.name === 'Español de América Latina') {
name = 'español de América Latina';
} else if (lang.name === 'es-LA') {
name = 'español de América Latina';
} else if (lang.name === 'Español de Argentina') {
name = 'español de Argentina';
} else if (lang.name === 'Español de Chile') {
name = 'español de Chile';
} else if (lang.name === 'Español de Colombia') {
name = 'español de Colombia';
} else if (lang.name === 'Español de México') {
name = 'español de México';
} else if (lang.name === 'es-PY') {
name = 'español de Paraguayo';
} else if (lang.name === 'Español de Paraguayo') {
name = 'español de Paraguayo';
} else if (lang.name === 'Español de Perú') {
name = 'español de Perú';
} else if (lang.name === 'Español de Puerto Rico') {
name = 'español de Puerto Rico';
} else if (lang.name === 'gl-ES') {
name = 'Galego (España)';
} else if (lang.name === 'oc') {
name = 'Occitan';
} else if (lang.name === 'ru-UA') {
name = 'Русский (Украина)';
} else if (lang.name === 'st') {
name = 'Sãotomense';
} else if (lang.name === 'uk-UA') {
name = 'українська (Україна)';
} else if (lang.name === '繁体中文(台湾)') {
// Traditional Chinese (Taiwan)
name = '繁體中文(台灣)';
}
return { tag, name };
}).sort(function(a, b) {
if (a.name === b.name) {
return 0;
} else {
return a.name > b.name ? 1 : -1;
}
});
return TAPi18n.getSupportedLanguages()
.map(({ isoCode, name }) => ({ tag: isoCode, name }))
.sort((a, b) => {
if (a.name === b.name) {
return 0;
} else {
return a.name > b.name ? 1 : -1;
}
});
},
isCurrentLanguage() {