mirror of
https://github.com/wekan/wekan.git
synced 2026-02-26 09:54:08 +01:00
Migrate wekan-fullcalendar to npm FullCalendar v5 and remove Meteor moment package
This commit is contained in:
parent
d796c4d9bb
commit
1b74fd8d4e
21 changed files with 415 additions and 233 deletions
|
|
@ -189,15 +189,15 @@ template(name="activity")
|
|||
if(currentData.timeKey)
|
||||
| {{_ activity.activityType }}
|
||||
= ' '
|
||||
i(title=currentData.timeValue).activity-meta {{ moment currentData.timeValue 'LLL' }}
|
||||
i(title=currentData.timeValue).activity-meta {{ displayDate currentData.timeValue 'LLL' }}
|
||||
if (currentData.timeOldValue)
|
||||
= ' '
|
||||
| {{{_ "previous_as" }}}
|
||||
= ' '
|
||||
i(title=currentData.timeOldValue).activity-meta {{ moment currentData.timeOldValue 'LLL' }}
|
||||
i(title=currentData.timeOldValue).activity-meta {{ displayDate currentData.timeOldValue 'LLL' }}
|
||||
= ' @'
|
||||
else if(currentData.timeValue)
|
||||
| {{_ activity.activityType currentData.timeValue}}
|
||||
|
||||
if($neq mode 'none')
|
||||
div(title=activity.createdAt).activity-meta {{ moment activity.createdAt }}
|
||||
div(title=activity.createdAt).activity-meta {{ displayDate activity.createdAt }}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ template(name="comment")
|
|||
+viewer
|
||||
= text
|
||||
+commentReactions(reactions=reactions commentId=_id)
|
||||
span(title=createdAt).comment-meta {{ moment createdAt }}
|
||||
span(title=createdAt).comment-meta {{ displayDate createdAt }}
|
||||
if($eq currentUser._id userId)
|
||||
+editOrDeleteComment
|
||||
else if currentUser.isBoardAdmin
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ template(name="archivedBoards")
|
|||
i.fa.fa-undo
|
||||
| {{_ 'restore-board'}}
|
||||
= title
|
||||
span {{ moment archivedAt 'LLL' }}
|
||||
span {{ displayDate archivedAt 'LLL' }}
|
||||
else
|
||||
li.no-items-message {{_ 'no-archived-boards'}}
|
||||
|
||||
|
|
|
|||
|
|
@ -226,16 +226,22 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
|
||||
// Observe for new popups/menus and set focus (but exclude swimlane content)
|
||||
const popupObserver = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
mutation.addedNodes.forEach(function(node) {
|
||||
if (node.nodeType === 1 &&
|
||||
(node.classList.contains('popup') || node.classList.contains('modal') || node.classList.contains('menu')) &&
|
||||
!node.closest('.js-swimlanes') &&
|
||||
!node.closest('.swimlane') &&
|
||||
!node.closest('.list') &&
|
||||
!node.closest('.minicard')) {
|
||||
setTimeout(function() { focusFirstInteractive(node); }, 10);
|
||||
const popupObserver = new MutationObserver(function (mutations) {
|
||||
mutations.forEach(function (mutation) {
|
||||
mutation.addedNodes.forEach(function (node) {
|
||||
if (
|
||||
node.nodeType === 1 &&
|
||||
(node.classList.contains('popup') ||
|
||||
node.classList.contains('modal') ||
|
||||
node.classList.contains('menu')) &&
|
||||
!node.closest('.js-swimlanes') &&
|
||||
!node.closest('.swimlane') &&
|
||||
!node.closest('.list') &&
|
||||
!node.closest('.minicard')
|
||||
) {
|
||||
setTimeout(function () {
|
||||
focusFirstInteractive(node);
|
||||
}, 10);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -898,30 +904,35 @@ BlazeComponent.extendComponent({
|
|||
document.documentElement.lang = TAPi18n.getLanguage();
|
||||
|
||||
this.autorun(function () {
|
||||
$('#calendar-view').fullCalendar('refetchEvents');
|
||||
const calendarEl = document.getElementById('calendar-view');
|
||||
if (calendarEl && calendarEl._wekanCalendar) {
|
||||
calendarEl._wekanCalendar.refetchEvents();
|
||||
}
|
||||
});
|
||||
},
|
||||
calendarOptions() {
|
||||
return {
|
||||
id: 'calendar-view',
|
||||
defaultView: 'month',
|
||||
initialView: 'dayGridMonth',
|
||||
editable: true,
|
||||
selectable: true,
|
||||
timezone: 'local',
|
||||
weekNumbers: true,
|
||||
// Use non-localized AM/PM time format to avoid confusing notations like 上/下/中
|
||||
// Use full 'am'/'pm' instead of single-letter 'a'/'p' for clarity
|
||||
timeFormat: 'h:mma',
|
||||
slotLabelFormat: 'h:mma',
|
||||
extraSmallTimeFormat: 'h(:mm)a',
|
||||
smallTimeFormat: 'h(:mm)a',
|
||||
mediumTimeFormat: 'h:mma',
|
||||
hourFormat: 'ha',
|
||||
noMeridiemTimeFormat: 'h:mm',
|
||||
header: {
|
||||
eventTimeFormat: {
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
meridiem: 'short',
|
||||
},
|
||||
slotLabelFormat: {
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
meridiem: 'short',
|
||||
},
|
||||
headerToolbar: {
|
||||
left: 'title today prev,next',
|
||||
center:
|
||||
'agendaDay,listDay,timelineDay agendaWeek,listWeek,timelineWeek month,listMonth',
|
||||
'timeGridDay,listDay timeGridWeek,listWeek dayGridMonth,listMonth',
|
||||
right: '',
|
||||
},
|
||||
buttonText: {
|
||||
|
|
@ -939,12 +950,12 @@ BlazeComponent.extendComponent({
|
|||
nowIndicator: true,
|
||||
businessHours: {
|
||||
// days of week. an array of zero-based day of week integers (0=Sunday)
|
||||
dow: [1, 2, 3, 4, 5], // Monday - Friday
|
||||
daysOfWeek: [1, 2, 3, 4, 5], // Monday - Friday
|
||||
start: '8:00',
|
||||
end: '18:00',
|
||||
},
|
||||
locale: TAPi18n.getLanguage(),
|
||||
events(start, end, timezone, callback) {
|
||||
events(fetchInfo, callback) {
|
||||
const currentBoard = Utils.getCurrentBoard();
|
||||
const events = [];
|
||||
const pushEvent = function (card, title, start, end, extraCls) {
|
||||
|
|
@ -970,12 +981,12 @@ BlazeComponent.extendComponent({
|
|||
});
|
||||
};
|
||||
currentBoard
|
||||
.cardsInInterval(start.toDate(), end.toDate())
|
||||
.cardsInInterval(fetchInfo.start, fetchInfo.end)
|
||||
.forEach(function (card) {
|
||||
pushEvent(card);
|
||||
});
|
||||
currentBoard
|
||||
.cardsDueInBetween(start.toDate(), end.toDate())
|
||||
.cardsDueInBetween(fetchInfo.start, fetchInfo.end)
|
||||
.forEach(function (card) {
|
||||
pushEvent(
|
||||
card,
|
||||
|
|
@ -989,36 +1000,36 @@ BlazeComponent.extendComponent({
|
|||
});
|
||||
callback(events);
|
||||
},
|
||||
eventResize(event, delta, revertFunc) {
|
||||
eventResize(info) {
|
||||
let isOk = false;
|
||||
const card = ReactiveCache.getCard(event.id);
|
||||
const card = ReactiveCache.getCard(info.event.id);
|
||||
|
||||
if (card) {
|
||||
card.setEnd(event.end.toDate());
|
||||
card.setEnd(info.event.end);
|
||||
isOk = true;
|
||||
}
|
||||
if (!isOk) {
|
||||
revertFunc();
|
||||
info.revert();
|
||||
}
|
||||
},
|
||||
eventDrop(event, delta, revertFunc) {
|
||||
eventDrop(info) {
|
||||
let isOk = false;
|
||||
const card = ReactiveCache.getCard(event.id);
|
||||
const card = ReactiveCache.getCard(info.event.id);
|
||||
if (card) {
|
||||
// TODO: add a flag for allDay events
|
||||
if (!event.allDay) {
|
||||
if (!info.event.allDay) {
|
||||
// https://github.com/wekan/wekan/issues/2917#issuecomment-1236753962
|
||||
//card.setStart(event.start.toDate());
|
||||
//card.setEnd(event.end.toDate());
|
||||
card.setDue(event.start.toDate());
|
||||
//card.setStart(info.event.start);
|
||||
//card.setEnd(info.event.end);
|
||||
card.setDue(info.event.start);
|
||||
isOk = true;
|
||||
}
|
||||
}
|
||||
if (!isOk) {
|
||||
revertFunc();
|
||||
info.revert();
|
||||
}
|
||||
},
|
||||
select: function (startDate) {
|
||||
select: function (selectionInfo) {
|
||||
const currentBoard = Utils.getCurrentBoard();
|
||||
const currentUser = ReactiveCache.getCurrentUser();
|
||||
const modalElement = document.createElement('div');
|
||||
|
|
@ -1056,7 +1067,7 @@ BlazeComponent.extendComponent({
|
|||
currentBoard._id,
|
||||
firstList._id,
|
||||
myTitle,
|
||||
startDate.toDate(),
|
||||
selectionInfo.start,
|
||||
firstSwimlane._id,
|
||||
function (error, result) {
|
||||
if (error) {
|
||||
|
|
|
|||
|
|
@ -1077,7 +1077,7 @@ template(name="cardMorePopup")
|
|||
option(value="{{_id}}") {{title}}
|
||||
br
|
||||
| {{_ 'added'}}
|
||||
span.date(title=card.createdAt) {{ moment createdAt 'LLL' }}
|
||||
span.date(title=card.createdAt) {{ displayDate createdAt 'LLL' }}
|
||||
if currentUser.isBoardAdmin
|
||||
a.js-delete(title="{{_ 'card-delete-notice'}}") {{_ 'delete'}}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ template(name="editChecklistItemForm")
|
|||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-submit-edit-checklist-item-form(type="submit") {{_ 'save'}}
|
||||
a.fa.fa-times-thin.js-close-inlined-form(title="{{_ 'close-edit-checklist-item'}}")
|
||||
span(title=createdAt) {{ moment createdAt }}
|
||||
span(title=createdAt) {{ displayDate createdAt }}
|
||||
if canModifyCard
|
||||
a.js-delete-checklist-item {{_ "delete"}}...
|
||||
a.js-convert-checklist-item-to-card
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ template(name="editSubtaskItemForm")
|
|||
.edit-controls.clearfix
|
||||
button.primary.confirm.js-submit-edit-subtask-item-form(type="submit") {{_ 'save'}}
|
||||
a.js-close-inlined-form
|
||||
span(title=createdAt) {{ moment createdAt }}
|
||||
span(title=createdAt) {{ displayDate createdAt }}
|
||||
if canModifyCard
|
||||
if currentUser.isBoardAdmin
|
||||
a.js-delete-subtask-item {{_ "delete"}}...
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ template(name="listHeader")
|
|||
span.cardCount {{cardsCount}}
|
||||
if isMiniScreen
|
||||
h2.list-header-name(
|
||||
title="{{ moment modifiedAt 'LLL' }}"
|
||||
title="{{ displayDate modifiedAt 'LLL' }}"
|
||||
class="{{#if currentUser.isBoardMember}}{{#unless currentUser.isCommentOnly}}{{#unless currentUser.isWorker}}js-open-inlined-form is-editable{{/unless}}{{/unless}}{{/if}}")
|
||||
+viewer
|
||||
= title
|
||||
|
|
@ -37,7 +37,7 @@ template(name="listHeader")
|
|||
i.fa.fa-caret-down
|
||||
div(class="{{#if collapsed}}list-rotated{{/if}}")
|
||||
h2.list-header-name(
|
||||
title="{{ moment modifiedAt 'LLL' }}"
|
||||
title="{{ displayDate modifiedAt 'LLL' }}"
|
||||
class="{{#unless collapsed}}{{#if currentUser.isBoardMember}}{{#unless currentUser.isCommentOnly}}{{#unless currentUser.isWorker}}js-open-inlined-form is-editable{{/unless}}{{/unless}}{{/if}}{{/unless}}")
|
||||
+viewer
|
||||
= title
|
||||
|
|
@ -193,7 +193,7 @@ template(name="listMorePopup")
|
|||
i.fa(class="{{#if currentBoard.isPublic}}fa-globe{{else}}fa-lock{{/if}}")
|
||||
input.inline-input(type="text" readonly value="{{ rootUrl }}")
|
||||
| {{_ 'added'}}
|
||||
span.date(title=list.createdAt) {{ moment createdAt 'LLL' }}
|
||||
span.date(title=list.createdAt) {{ displayDate createdAt 'LLL' }}
|
||||
//unless currentUser.isWorker
|
||||
//
|
||||
if currentUser.isBoardAdmin
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ template(name="myCards")
|
|||
| {{labelName board label}}
|
||||
td
|
||||
if card.dueAt
|
||||
| {{ moment card.dueAt 'LLL' }}
|
||||
| {{ displayDate card.dueAt 'LLL' }}
|
||||
|
||||
template(name="myCardsViewChangePopup")
|
||||
if currentUser
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { ReactiveCache } from '/imports/reactiveCache';
|
||||
import { formatDateByUserPreference } from '/imports/lib/dateUtils';
|
||||
|
||||
Template.notification.events({
|
||||
'click .read-status .materialCheckBox'() {
|
||||
|
|
@ -38,9 +39,15 @@ Template.notification.helpers({
|
|||
const user = ReactiveCache.getCurrentUser();
|
||||
if (!user) return '';
|
||||
|
||||
const dateFormat = user.getDateFormat ? user.getDateFormat() : 'L';
|
||||
const timeFormat = user.getTimeFormat ? user.getTimeFormat() : 'LT';
|
||||
const dateObj = new Date(activity.createdAt);
|
||||
if (Number.isNaN(dateObj.getTime())) return '';
|
||||
|
||||
return moment(activity.createdAt).format(`${dateFormat} ${timeFormat}`);
|
||||
const dateFormat = user.getDateFormat ? user.getDateFormat() : 'YYYY-MM-DD';
|
||||
const datePart = formatDateByUserPreference(dateObj, dateFormat, false);
|
||||
const timePart = dateObj.toLocaleTimeString([], {
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
});
|
||||
return `${datePart} ${timePart}`.trim();
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -190,9 +190,9 @@ template(name="orgRow")
|
|||
else
|
||||
td <s>{{ orgData.orgWebsite }}</s>
|
||||
if orgData.orgIsActive
|
||||
td {{ moment orgData.createdAt 'LLL' }}
|
||||
td {{ displayDate orgData.createdAt 'LLL' }}
|
||||
else
|
||||
td <s>{{ moment orgData.createdAt 'LLL' }}</s>
|
||||
td <s>{{ displayDate orgData.createdAt 'LLL' }}</s>
|
||||
td
|
||||
if orgData.orgIsActive
|
||||
| {{_ 'yes'}}
|
||||
|
|
@ -224,9 +224,9 @@ template(name="teamRow")
|
|||
else
|
||||
td <s>{{ teamData.teamWebsite }}</s>
|
||||
if teamData.teamIsActive
|
||||
td {{ moment teamData.createdAt 'LLL' }}
|
||||
td {{ displayDate teamData.createdAt 'LLL' }}
|
||||
else
|
||||
td <s>{{ moment teamData.createdAt 'LLL' }}</s>
|
||||
td <s>{{ displayDate teamData.createdAt 'LLL' }}</s>
|
||||
td
|
||||
if teamData.teamIsActive
|
||||
| {{_ 'yes'}}
|
||||
|
|
@ -284,9 +284,9 @@ template(name="peopleRow")
|
|||
span.text-green.js-toggle-lock-status.emoji-icon(data-user-id=userData._id, data-is-locked="false", title="{{_ 'accounts-lockout-user-unlocked'}}")
|
||||
i.fa.fa-unlock
|
||||
if userData.loginDisabled
|
||||
td <s>{{ moment userData.createdAt 'LLL' }}</s>
|
||||
td <s>{{ displayDate userData.createdAt 'LLL' }}</s>
|
||||
else
|
||||
td {{ moment userData.createdAt 'LLL' }}
|
||||
td {{ displayDate userData.createdAt 'LLL' }}
|
||||
if userData.loginDisabled
|
||||
td
|
||||
input.selectUserChkBox(type="checkbox", disabled="disabled", id="{{userData._id}}")
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ import {
|
|||
cronMigrationEtaSeconds,
|
||||
cronMigrationElapsedSeconds,
|
||||
cronMigrationCurrentNumber,
|
||||
cronMigrationCurrentName
|
||||
cronMigrationCurrentName,
|
||||
} from '/imports/cronMigrationClient';
|
||||
|
||||
import { format } from '/imports/lib/dateUtils';
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
onCreated() {
|
||||
|
|
@ -66,7 +66,6 @@ BlazeComponent.extendComponent({
|
|||
}
|
||||
},
|
||||
|
||||
|
||||
setError(error) {
|
||||
this.error.set(error);
|
||||
},
|
||||
|
|
@ -82,7 +81,9 @@ BlazeComponent.extendComponent({
|
|||
return this.accountSetting && this.accountSetting.get();
|
||||
},
|
||||
isTableVisibilityModeSetting() {
|
||||
return this.tableVisibilityModeSetting && this.tableVisibilityModeSetting.get();
|
||||
return (
|
||||
this.tableVisibilityModeSetting && this.tableVisibilityModeSetting.get()
|
||||
);
|
||||
},
|
||||
isAnnouncementSetting() {
|
||||
return this.announcementSetting && this.announcementSetting.get();
|
||||
|
|
@ -174,7 +175,7 @@ BlazeComponent.extendComponent({
|
|||
const steps = cronMigrationSteps.get() || [];
|
||||
return steps.map((step, idx) => ({
|
||||
...step,
|
||||
index: idx + 1
|
||||
index: idx + 1,
|
||||
}));
|
||||
},
|
||||
|
||||
|
|
@ -237,7 +238,9 @@ BlazeComponent.extendComponent({
|
|||
|
||||
isUpdatingMigrationDropdown() {
|
||||
const status = this.migrationStatus();
|
||||
return status && status.startsWith('Updating Select Migration dropdown menu');
|
||||
return (
|
||||
status && status.startsWith('Updating Select Migration dropdown menu')
|
||||
);
|
||||
},
|
||||
|
||||
migrationErrors() {
|
||||
|
|
@ -251,7 +254,7 @@ BlazeComponent.extendComponent({
|
|||
|
||||
formatDateTime(date) {
|
||||
if (!date) return '';
|
||||
return moment(date).format('YYYY-MM-DD HH:mm:ss');
|
||||
return format(date, 'YYYY-MM-DD HH:mm:ss');
|
||||
},
|
||||
|
||||
formatDurationSeconds(seconds) {
|
||||
|
|
@ -331,18 +334,22 @@ BlazeComponent.extendComponent({
|
|||
});
|
||||
} else {
|
||||
// Run specific migration
|
||||
Meteor.call('cron.startSpecificMigration', selectedIndex - 1, (error, result) => {
|
||||
this.setLoading(false);
|
||||
if (error) {
|
||||
alert(TAPi18n.__('migration-start-failed') + ': ' + error.reason);
|
||||
} else if (result && result.skipped) {
|
||||
cronIsMigrating.set(false);
|
||||
cronMigrationStatus.set(TAPi18n.__('migration-not-needed'));
|
||||
alert(TAPi18n.__('migration-not-needed'));
|
||||
} else {
|
||||
alert(TAPi18n.__('migration-started'));
|
||||
}
|
||||
});
|
||||
Meteor.call(
|
||||
'cron.startSpecificMigration',
|
||||
selectedIndex - 1,
|
||||
(error, result) => {
|
||||
this.setLoading(false);
|
||||
if (error) {
|
||||
alert(TAPi18n.__('migration-start-failed') + ': ' + error.reason);
|
||||
} else if (result && result.skipped) {
|
||||
cronIsMigrating.set(false);
|
||||
cronMigrationStatus.set(TAPi18n.__('migration-not-needed'));
|
||||
alert(TAPi18n.__('migration-not-needed'));
|
||||
} else {
|
||||
alert(TAPi18n.__('migration-started'));
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -490,9 +497,7 @@ BlazeComponent.extendComponent({
|
|||
checkField(selector) {
|
||||
const value = $(selector).val();
|
||||
if (!value || value.trim() === '') {
|
||||
$(selector)
|
||||
.parents('li.smtp-form')
|
||||
.addClass('has-error');
|
||||
$(selector).parents('li.smtp-form').addClass('has-error');
|
||||
throw Error('blank field');
|
||||
} else {
|
||||
return value;
|
||||
|
|
@ -514,7 +519,8 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
toggleForgotPassword() {
|
||||
this.setLoading(true);
|
||||
const forgotPasswordClosed = ReactiveCache.getCurrentSetting().disableForgotPassword;
|
||||
const forgotPasswordClosed =
|
||||
ReactiveCache.getCurrentSetting().disableForgotPassword;
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
$set: { disableForgotPassword: !forgotPasswordClosed },
|
||||
});
|
||||
|
|
@ -522,7 +528,8 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
toggleRegistration() {
|
||||
this.setLoading(true);
|
||||
const registrationClosed = ReactiveCache.getCurrentSetting().disableRegistration;
|
||||
const registrationClosed =
|
||||
ReactiveCache.getCurrentSetting().disableRegistration;
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
$set: { disableRegistration: !registrationClosed },
|
||||
});
|
||||
|
|
@ -629,11 +636,11 @@ BlazeComponent.extendComponent({
|
|||
.join(',')
|
||||
.split(',');
|
||||
const boardsToInvite = [];
|
||||
$('.js-toggle-board-choose .materialCheckBox.is-checked').each(function() {
|
||||
$('.js-toggle-board-choose .materialCheckBox.is-checked').each(function () {
|
||||
boardsToInvite.push($(this).data('id'));
|
||||
});
|
||||
const validEmails = [];
|
||||
emails.forEach(email => {
|
||||
emails.forEach((email) => {
|
||||
if (email && SimpleSchema.RegEx.Email.test(email.trim())) {
|
||||
validEmails.push(email.trim());
|
||||
}
|
||||
|
|
@ -656,12 +663,8 @@ BlazeComponent.extendComponent({
|
|||
try {
|
||||
const host = this.checkField('#mail-server-host');
|
||||
const port = this.checkField('#mail-server-port');
|
||||
const username = $('#mail-server-username')
|
||||
.val()
|
||||
.trim();
|
||||
const password = $('#mail-server-password')
|
||||
.val()
|
||||
.trim();
|
||||
const username = $('#mail-server-username').val().trim();
|
||||
const password = $('#mail-server-password').val().trim();
|
||||
const from = this.checkField('#mail-server-from');
|
||||
const tls = $('#mail-server-tls.is-checked').length > 0;
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
|
|
@ -686,21 +689,37 @@ BlazeComponent.extendComponent({
|
|||
$('li').removeClass('has-error');
|
||||
|
||||
const productName = ($('#product-name').val() || '').trim();
|
||||
const customLoginLogoImageUrl = ($('#custom-login-logo-image-url').val() || '').trim();
|
||||
const customLoginLogoLinkUrl = ($('#custom-login-logo-link-url').val() || '').trim();
|
||||
const customLoginLogoImageUrl = (
|
||||
$('#custom-login-logo-image-url').val() || ''
|
||||
).trim();
|
||||
const customLoginLogoLinkUrl = (
|
||||
$('#custom-login-logo-link-url').val() || ''
|
||||
).trim();
|
||||
const customHelpLinkUrl = ($('#custom-help-link-url').val() || '').trim();
|
||||
const textBelowCustomLoginLogo = ($('#text-below-custom-login-logo').val() || '').trim();
|
||||
const automaticLinkedUrlSchemes = ($('#automatic-linked-url-schemes').val() || '').trim();
|
||||
const customTopLeftCornerLogoImageUrl = ($('#custom-top-left-corner-logo-image-url').val() || '').trim();
|
||||
const customTopLeftCornerLogoLinkUrl = ($('#custom-top-left-corner-logo-link-url').val() || '').trim();
|
||||
const customTopLeftCornerLogoHeight = ($('#custom-top-left-corner-logo-height').val() || '').trim();
|
||||
const textBelowCustomLoginLogo = (
|
||||
$('#text-below-custom-login-logo').val() || ''
|
||||
).trim();
|
||||
const automaticLinkedUrlSchemes = (
|
||||
$('#automatic-linked-url-schemes').val() || ''
|
||||
).trim();
|
||||
const customTopLeftCornerLogoImageUrl = (
|
||||
$('#custom-top-left-corner-logo-image-url').val() || ''
|
||||
).trim();
|
||||
const customTopLeftCornerLogoLinkUrl = (
|
||||
$('#custom-top-left-corner-logo-link-url').val() || ''
|
||||
).trim();
|
||||
const customTopLeftCornerLogoHeight = (
|
||||
$('#custom-top-left-corner-logo-height').val() || ''
|
||||
).trim();
|
||||
|
||||
const oidcBtnText = ($('#oidcBtnTextvalue').val() || '').trim();
|
||||
const mailDomainName = ($('#mailDomainNamevalue').val() || '').trim();
|
||||
const legalNotice = ($('#legalNoticevalue').val() || '').trim();
|
||||
const hideLogoChange = $('input[name=hideLogo]:checked').val() === 'true';
|
||||
const hideCardCounterListChange = $('input[name=hideCardCounterList]:checked').val() === 'true';
|
||||
const hideBoardMemberListChange = $('input[name=hideBoardMemberList]:checked').val() === 'true';
|
||||
const hideCardCounterListChange =
|
||||
$('input[name=hideCardCounterList]:checked').val() === 'true';
|
||||
const hideBoardMemberListChange =
|
||||
$('input[name=hideBoardMemberList]:checked').val() === 'true';
|
||||
const displayAuthenticationMethod =
|
||||
$('input[name=displayAuthenticationMethod]:checked').val() === 'true';
|
||||
const defaultAuthenticationMethod = $('#defaultAuthenticationMethod').val();
|
||||
|
|
@ -740,7 +759,9 @@ BlazeComponent.extendComponent({
|
|||
|
||||
toggleSupportPage() {
|
||||
this.setLoading(true);
|
||||
const supportPageEnabled = !$('.js-toggle-support .materialCheckBox').hasClass('is-checked');
|
||||
const supportPageEnabled = !$(
|
||||
'.js-toggle-support .materialCheckBox',
|
||||
).hasClass('is-checked');
|
||||
$('.js-toggle-support .materialCheckBox').toggleClass('is-checked');
|
||||
$('.support-content').toggleClass('hide');
|
||||
Settings.update(Settings.findOne()._id, {
|
||||
|
|
@ -751,7 +772,9 @@ BlazeComponent.extendComponent({
|
|||
|
||||
toggleSupportPublic() {
|
||||
this.setLoading(true);
|
||||
const supportPagePublic = !$('.js-toggle-support-public .materialCheckBox').hasClass('is-checked');
|
||||
const supportPagePublic = !$(
|
||||
'.js-toggle-support-public .materialCheckBox',
|
||||
).hasClass('is-checked');
|
||||
$('.js-toggle-support-public .materialCheckBox').toggleClass('is-checked');
|
||||
Settings.update(Settings.findOne()._id, {
|
||||
$set: { supportPagePublic },
|
||||
|
|
@ -761,7 +784,9 @@ BlazeComponent.extendComponent({
|
|||
|
||||
toggleCustomHead() {
|
||||
this.setLoading(true);
|
||||
const customHeadEnabled = !$('.js-toggle-custom-head .materialCheckBox').hasClass('is-checked');
|
||||
const customHeadEnabled = !$(
|
||||
'.js-toggle-custom-head .materialCheckBox',
|
||||
).hasClass('is-checked');
|
||||
$('.js-toggle-custom-head .materialCheckBox').toggleClass('is-checked');
|
||||
$('.custom-head-settings').toggleClass('hide');
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
|
|
@ -772,7 +797,9 @@ BlazeComponent.extendComponent({
|
|||
|
||||
toggleCustomManifest() {
|
||||
this.setLoading(true);
|
||||
const customManifestEnabled = !$('.js-toggle-custom-manifest .materialCheckBox').hasClass('is-checked');
|
||||
const customManifestEnabled = !$(
|
||||
'.js-toggle-custom-manifest .materialCheckBox',
|
||||
).hasClass('is-checked');
|
||||
$('.js-toggle-custom-manifest .materialCheckBox').toggleClass('is-checked');
|
||||
$('.custom-manifest-settings').toggleClass('hide');
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
|
|
@ -829,7 +856,9 @@ BlazeComponent.extendComponent({
|
|||
const errorMsg = e.message;
|
||||
|
||||
// If error is "unexpected non-whitespace character after JSON data"
|
||||
if (errorMsg.includes('unexpected non-whitespace character after JSON data')) {
|
||||
if (
|
||||
errorMsg.includes('unexpected non-whitespace character after JSON data')
|
||||
) {
|
||||
try {
|
||||
// Try to find and extract valid JSON by finding matching braces/brackets
|
||||
const trimmed = content.trim();
|
||||
|
|
@ -896,8 +925,12 @@ BlazeComponent.extendComponent({
|
|||
|
||||
toggleCustomAssetLinks() {
|
||||
this.setLoading(true);
|
||||
const customAssetLinksEnabled = !$('.js-toggle-custom-assetlinks .materialCheckBox').hasClass('is-checked');
|
||||
$('.js-toggle-custom-assetlinks .materialCheckBox').toggleClass('is-checked');
|
||||
const customAssetLinksEnabled = !$(
|
||||
'.js-toggle-custom-assetlinks .materialCheckBox',
|
||||
).hasClass('is-checked');
|
||||
$('.js-toggle-custom-assetlinks .materialCheckBox').toggleClass(
|
||||
'is-checked',
|
||||
);
|
||||
$('.custom-assetlinks-settings').toggleClass('hide');
|
||||
Settings.update(ReactiveCache.getCurrentSetting()._id, {
|
||||
$set: { customAssetLinksEnabled },
|
||||
|
|
@ -978,8 +1011,10 @@ BlazeComponent.extendComponent({
|
|||
'click button.js-save': this.saveMailServerInfo,
|
||||
'click button.js-send-smtp-test-email': this.sendSMTPTestEmail,
|
||||
'click a.js-toggle-hide-logo': this.toggleHideLogo,
|
||||
'click a.js-toggle-hide-card-counter-list': this.toggleHideCardCounterList,
|
||||
'click a.js-toggle-hide-board-member-list': this.toggleHideBoardMemberList,
|
||||
'click a.js-toggle-hide-card-counter-list':
|
||||
this.toggleHideCardCounterList,
|
||||
'click a.js-toggle-hide-board-member-list':
|
||||
this.toggleHideBoardMemberList,
|
||||
'click button.js-save-layout': this.saveLayout,
|
||||
'click a.js-toggle-support': this.toggleSupportPage,
|
||||
'click a.js-toggle-support-public': this.toggleSupportPublic,
|
||||
|
|
@ -988,9 +1023,10 @@ BlazeComponent.extendComponent({
|
|||
'click a.js-toggle-custom-manifest': this.toggleCustomManifest,
|
||||
'click button.js-custom-head-save': this.saveCustomHeadSettings,
|
||||
'click a.js-toggle-custom-assetlinks': this.toggleCustomAssetLinks,
|
||||
'click button.js-custom-assetlinks-save': this.saveCustomAssetLinksSettings,
|
||||
'click a.js-toggle-display-authentication-method': this
|
||||
.toggleDisplayAuthenticationMethod,
|
||||
'click button.js-custom-assetlinks-save':
|
||||
this.saveCustomAssetLinksSettings,
|
||||
'click a.js-toggle-display-authentication-method':
|
||||
this.toggleDisplayAuthenticationMethod,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
@ -1018,15 +1054,23 @@ BlazeComponent.extendComponent({
|
|||
// Brute force lockout settings method moved to lockedUsersBody.js
|
||||
|
||||
allowEmailChange() {
|
||||
return AccountSettings.findOne('accounts-allowEmailChange')?.booleanValue || false;
|
||||
return (
|
||||
AccountSettings.findOne('accounts-allowEmailChange')?.booleanValue ||
|
||||
false
|
||||
);
|
||||
},
|
||||
|
||||
allowUserNameChange() {
|
||||
return AccountSettings.findOne('accounts-allowUserNameChange')?.booleanValue || false;
|
||||
return (
|
||||
AccountSettings.findOne('accounts-allowUserNameChange')?.booleanValue ||
|
||||
false
|
||||
);
|
||||
},
|
||||
|
||||
allowUserDelete() {
|
||||
return AccountSettings.findOne('accounts-allowUserDelete')?.booleanValue || false;
|
||||
return (
|
||||
AccountSettings.findOne('accounts-allowUserDelete')?.booleanValue || false
|
||||
);
|
||||
},
|
||||
|
||||
// Lockout settings helper methods moved to lockedUsersBody.js
|
||||
|
|
@ -1054,7 +1098,8 @@ BlazeComponent.extendComponent({
|
|||
'click button.js-accounts-save': this.saveAccountsChange,
|
||||
},
|
||||
{
|
||||
'click button.js-all-boards-hide-activities': this.allBoardsHideActivities,
|
||||
'click button.js-all-boards-hide-activities':
|
||||
this.allBoardsHideActivities,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
@ -1069,7 +1114,9 @@ BlazeComponent.extendComponent({
|
|||
});
|
||||
},
|
||||
allowPrivateOnly() {
|
||||
return TableVisibilityModeSettings.findOne('tableVisibilityMode-allowPrivateOnly').booleanValue;
|
||||
return TableVisibilityModeSettings.findOne(
|
||||
'tableVisibilityMode-allowPrivateOnly',
|
||||
).booleanValue;
|
||||
},
|
||||
allBoardsHideActivities() {
|
||||
Meteor.call('setAllBoardsHideActivities', (err, ret) => {
|
||||
|
|
@ -1091,10 +1138,12 @@ BlazeComponent.extendComponent({
|
|||
events() {
|
||||
return [
|
||||
{
|
||||
'click button.js-tableVisibilityMode-save': this.saveTableVisibilityChange,
|
||||
'click button.js-tableVisibilityMode-save':
|
||||
this.saveTableVisibilityChange,
|
||||
},
|
||||
{
|
||||
'click button.js-all-boards-hide-activities': this.allBoardsHideActivities,
|
||||
'click button.js-all-boards-hide-activities':
|
||||
this.allBoardsHideActivities,
|
||||
},
|
||||
];
|
||||
},
|
||||
|
|
@ -1114,9 +1163,7 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
saveMessage() {
|
||||
const message = $('#admin-announcement')
|
||||
.val()
|
||||
.trim();
|
||||
const message = $('#admin-announcement').val().trim();
|
||||
Announcements.update(Announcements.findOne()._id, {
|
||||
$set: { body: message },
|
||||
});
|
||||
|
|
@ -1162,18 +1209,14 @@ BlazeComponent.extendComponent({
|
|||
|
||||
saveAccessibility() {
|
||||
this.setLoading(true);
|
||||
const title = $('#admin-accessibility-title')
|
||||
.val()
|
||||
.trim();
|
||||
const content = $('#admin-accessibility-content')
|
||||
.val()
|
||||
.trim();
|
||||
const title = $('#admin-accessibility-title').val().trim();
|
||||
const content = $('#admin-accessibility-content').val().trim();
|
||||
|
||||
try {
|
||||
AccessibilitySettings.update(AccessibilitySettings.findOne()._id, {
|
||||
$set: {
|
||||
title: title,
|
||||
body: content
|
||||
body: content,
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
|
|
@ -1209,7 +1252,7 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
}).register('accessibilitySettings');
|
||||
|
||||
Template.selectAuthenticationMethod.onCreated(function() {
|
||||
Template.selectAuthenticationMethod.onCreated(function () {
|
||||
this.authenticationMethods = new ReactiveVar([]);
|
||||
|
||||
Meteor.call('getAuthenticationsEnabled', (_, result) => {
|
||||
|
|
@ -1220,8 +1263,8 @@ Template.selectAuthenticationMethod.onCreated(function() {
|
|||
{ value: 'password' },
|
||||
// Gets only the authentication methods availables
|
||||
...Object.entries(result)
|
||||
.filter(e => e[1])
|
||||
.map(e => ({ value: e[0] })),
|
||||
.filter((e) => e[1])
|
||||
.map((e) => ({ value: e[0] })),
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
|
@ -1244,4 +1287,3 @@ Template.selectSpinnerName.helpers({
|
|||
return Template.instance().data.spinnerName === match;
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ template(name="archivesSidebar")
|
|||
p.quiet
|
||||
if this.archivedAt
|
||||
| {{_ 'archived-at' }}
|
||||
| | {{ moment this.archivedAt 'LLL' }}
|
||||
| | {{ displayDate this.archivedAt 'LLL' }}
|
||||
br
|
||||
a.js-restore-card {{_ 'restore'}}
|
||||
if currentUser.isBoardAdmin
|
||||
|
|
@ -51,7 +51,7 @@ template(name="archivesSidebar")
|
|||
p.quiet
|
||||
if this.archivedAt
|
||||
| {{_ 'archived-at' }}
|
||||
| | {{ moment this.archivedAt 'LLL' }}
|
||||
| | {{ displayDate this.archivedAt 'LLL' }}
|
||||
br
|
||||
a.js-restore-list {{_ 'restore'}}
|
||||
if currentUser.isBoardAdmin
|
||||
|
|
@ -80,7 +80,7 @@ template(name="archivesSidebar")
|
|||
p.quiet
|
||||
if this.archivedAt
|
||||
| {{_ 'archived-at' }}
|
||||
| | {{ moment this.archivedAt 'LLL' }}
|
||||
| | {{ displayDate this.archivedAt 'LLL' }}
|
||||
br
|
||||
a.js-restore-swimlane {{_ 'restore'}}
|
||||
if currentUser.isBoardAdmin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue