From b68b635e6515b9556327a6475e6dd3ec08cfa3c9 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 27 Apr 2021 18:02:24 +0200 Subject: [PATCH 1/2] Remove XXX and fix restricted calendar --- www/calendar/inner.js | 5 ++--- www/common/outer/calendar.js | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/www/calendar/inner.js b/www/calendar/inner.js index 865fe0a6e..66803a188 100644 --- a/www/calendar/inner.js +++ b/www/calendar/inner.js @@ -318,7 +318,6 @@ Messages.calendar_noNotification = "None"; } }; - // XXX Note: always create calendars in your own proxy. If you want a team calendar, you can share it with the team later. var editCalendar = function (id) { var isNew = !id; var data = APP.calendars[id]; @@ -453,7 +452,7 @@ Messages.calendar_noNotification = "None"; pathname: "/calendar/", friends: friends, title: title, - password: cal.password, // XXX support passwords + password: cal.password, calendar: { title: title, color: color, @@ -480,7 +479,7 @@ Messages.calendar_noNotification = "None"; var href = Hash.hashToHref(h.editHash || h.viewHash, 'calendar'); Access.getAccessModal(common, { title: title, - password: cal.password, // XXX support passwords + password: cal.password, calendar: { title: title, color: color, diff --git a/www/common/outer/calendar.js b/www/common/outer/calendar.js index 1bb5fd570..33453b6ee 100644 --- a/www/common/outer/calendar.js +++ b/www/common/outer/calendar.js @@ -114,7 +114,7 @@ define([ } } - // XXX add a limit to make sure we don't go too far in the past? + // XXX add a limit to make sure we don't go too far in the past? ==> 1 week var missed = useLastVisit && ev.start > last && ev.end <= now; if (ev.end <= now && !missed) { // No reminder for past events @@ -283,7 +283,6 @@ define([ var onDeleted = function () { // Remove this calendar from all our teams - // XXX Maybe not? don't remove automatically so that we can tell the user to do so. c.stores.forEach(function (storeId) { var store = getStore(ctx, storeId); if (!store || !store.rpc || !store.proxy.calendars) { return; } @@ -412,6 +411,7 @@ define([ } if (info.error === "ERESTRICTED" ) { c.restricted = true; + setTimeout(update); } cb(info); }); @@ -846,7 +846,7 @@ define([ Calendar.init = function (cfg, waitFor, emit) { var calendar = {}; var store = cfg.store; - if (!store.loggedIn || !store.proxy.edPublic) { return; } // XXX logged in only? + if (!store.loggedIn || !store.proxy.edPublic) { return; } // XXX logged in only? we should al least allow read-only for URL calendars var ctx = { store: store, Store: cfg.Store, From 390e36ea849858e1e667141e6e2a7a560559bc2e Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 27 Apr 2021 18:09:45 +0200 Subject: [PATCH 2/2] Replace 'My calendars' with the current user data --- www/calendar/inner.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/calendar/inner.js b/www/calendar/inner.js index 66803a188..25b3fc47d 100644 --- a/www/calendar/inner.js +++ b/www/calendar/inner.js @@ -70,7 +70,6 @@ Messages.calendar_deleteConfirm = "Are you sure you want to delete this calendar Messages.calendar_deleteTeamConfirm = "Are you sure you want to delete this calendar from this team?"; Messages.calendar_deleteOwned = " It will still be visible for the users it has been shared with."; Messages.calendar_errorNoCalendar = "No editable calendar selected!"; -Messages.calendar_myCalendars = "My calendars"; Messages.calendar_tempCalendar = "Viewing"; Messages.calendar_import = "Import to my calendars"; Messages.calendar_import_temp = "Import this calendar"; @@ -720,8 +719,13 @@ Messages.calendar_noNotification = "None"; } var myCalendars = filter(1); if (myCalendars.length) { + var user = metadataMgr.getUserData(); + var avatar = h('span.cp-avatar'); + var name = user.name || Messages.anonymous; + common.displayAvatar($(avatar), user.avatar, name); APP.$calendars.append(h('div.cp-calendar-team', [ - h('span', Messages.calendar_myCalendars) + avatar, + h('span.cp-name', {title: name}, name) ])); } myCalendars.forEach(function (id) {