diff --git a/CHANGELOG b/CHANGELOG index 066c34f..90e4396 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,18 @@ +v0.1.8 +- Features added to Gantt view: + - Double click edits task + - Drag and drop, expansion/contraction enabled. + - Added help option. +- Fixed type error in HomeTasks.tsx +- Fixed mysql port variable in docker-compose.yml.sample +- Bumped up some @fullcalendar packages. Meant to fix some bugs with fullcalendar not working with NextJS. +- Bumped version to 0.1.8 +- Calendar Views now have more options + - Switch to enable showing tasks + - Option to select displayed calendars +- API Change: caldav/calendars/events/db/all now also includes caldav_accounts_id for each event in output +- Bug fix: Done tasks being shown in lists filtered just with Labels. + v0.1.7 - Added constant VERSION_NUMBER - Breaking change: diff --git a/COMMITMESSAGE.md b/COMMITMESSAGE.md index b93570f..789dd49 100644 --- a/COMMITMESSAGE.md +++ b/COMMITMESSAGE.md @@ -1 +1 @@ -- Bumped up some @fullcalendar packages. Meant to fix some bugs with fullcalendar not working with NextJS. \ No newline at end of file +- Bug fix: Done tasks being shown in lists filtered just with Labels. \ No newline at end of file diff --git a/package.json b/package.json index 1613f38..9a1c911 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "manage-my-damn-life-nextjs", - "version": "0.1.7", + "version": "0.1.8", "private": true, "scripts": { "dev": "next dev", diff --git a/src/components/fullcalendar/DashboardView.js b/src/components/fullcalendar/DashboardView.js index 3623c2c..bd1f219 100644 --- a/src/components/fullcalendar/DashboardView.js +++ b/src/components/fullcalendar/DashboardView.js @@ -12,20 +12,20 @@ import { getEmptyEventDataObject, getParsedEvent, isAllDayEvent, majorTaskFilter import bootstrap from "@fullcalendar/bootstrap"; import interactionPlugin from '@fullcalendar/interaction' import Offcanvas from 'react-bootstrap/Offcanvas'; -import { BiTask } from "react-icons/bi"; import rrulePlugin from '@fullcalendar/rrule' -import { ISODatetoHuman, ISODatetoHumanISO, getI18nObject } from "@/helpers/frontend/general"; +import { getI18nObject } from "@/helpers/frontend/general"; import EventEditor from "../events/EventEditor"; import moment from "moment"; import { getRandomString } from "@/helpers/crypto"; import { getObjectForAPICall, makeGenerateICSRequest } from "@/helpers/frontend/ics"; import { toast } from "react-toastify"; import { getMessageFromAPIResponse } from "@/helpers/frontend/response"; -import { FULLCALENDAR_BUSINESS_HOURS } from "@/config/constants"; import { withRouter } from "next/router"; import { RecurrenceHelper } from "@/helpers/frontend/classes/RecurrenceHelper"; import { FULLCALENDAR_VIEWLIST } from "./FullCalendarHelper"; import { getDefaultViewForCalendar } from "@/helpers/frontend/settings"; +import { ListGroupCalDAVAccounts } from "./ListGroupCalDAVAccounts"; +import { Preference_CalendarsToShow } from "@/helpers/frontend/classes/UserPreferences/Preference_CalendarsToShow"; class DashboardView extends Component { calendarRef = React.createRef() @@ -34,7 +34,7 @@ class DashboardView extends Component { super(props) this.i18next = getI18nObject() var initialViewCalendar = "timeGridDay" - this.state = { showEventEditor: false, viewValue: initialViewCalendar, events: null, eventEdited: false, eventDataDashBoard: {}, initialViewCalendar: initialViewCalendar, allEvents: {}, recurMap: {}, selectedID: "", calendarAR: props.calendarAR } + this.state = { showEventEditor: false, viewValue: initialViewCalendar, events: null, eventEdited: false, eventDataDashBoard: {}, initialViewCalendar: initialViewCalendar, allEvents: {}, recurMap: {}, selectedID: "", calendarAR: props.calendarAR,showTasksChecked: false, allEventsFromServer: null, caldav_accounts:null } this.viewChanged = this.viewChanged.bind(this) this.eventClick = this.eventClick.bind(this) this.handleDateClick = this.handleDateClick.bind(this) @@ -43,6 +43,9 @@ class DashboardView extends Component { this.eventDrop = this.eventDrop.bind(this) this.eventResize = this.eventResize.bind(this) this.scheduleEvent = this.scheduleEvent.bind(this) + this.showTasksChanged = this.showTasksChanged.bind(this) + this.addEventsToCalendar = this.addEventsToCalendar.bind(this) + this.userPreferencesChanged = this.userPreferencesChanged.bind(this) } @@ -57,7 +60,7 @@ class DashboardView extends Component { const view = await getDefaultViewForCalendar() calendarApi.changeView(view) - this.setState({viewValue: view}) + this.setState({viewValue: view, showTasksChecked: true}) } @@ -65,7 +68,7 @@ class DashboardView extends Component { var caldav_accounts = await getCaldavAccountsfromServer() if (caldav_accounts != null && caldav_accounts.success == true) { if (caldav_accounts.data.message.length > 0) { - + this.setState({caldav_accounts: caldav_accounts.data.message}) } else { this.props.router.push("/accounts/caldav?message=ADD_A_CALDAV_ACCOUNT") } @@ -287,13 +290,18 @@ class DashboardView extends Component { return false } - async getAllEventsfromServer() { - var allEvents = await getAllEvents() + async addEventsToCalendar(allEvents){ var finalEvents = [] + + if (isValidResultArray(allEvents.data.message)) { for (let i = 0; i < allEvents.data.message.length; i++) { for (const j in allEvents.data.message[i].events) { + var userWantsToSee = Preference_CalendarsToShow.getShowValueForCalendar(allEvents.data.message[i].info.caldav_accounts_id, allEvents.data.message[i].events[j].calendar_id) + if(userWantsToSee ==false){ + continue + } var event = allEvents.data.message[i].events[j] if (event.deleted == "1" || event.deleted == "TRUE") { continue @@ -422,7 +430,7 @@ class DashboardView extends Component { this.state.allEvents[data.uid] = { data: data, event: allEvents.data.message[i].events[j] } } - else if (event.type == "VTODO") { + else if (event.type == "VTODO" && this.state.showTasksChecked==true) { var data = returnGetParsedVTODO(allEvents.data.message[i].events[j].data) if (varNotEmpty(data) == false) { continue @@ -495,8 +503,41 @@ class DashboardView extends Component { } this.setState({ events: finalEvents }) + + } + async getAllEventsfromServer() { + var allEvents = await getAllEvents() + this.setState({allEventsFromServer: allEvents}) + + this.addEventsToCalendar(allEvents) + } + + showTasksChanged(e) + { + this.setState(({ showTasksChecked }) => ( + { + showTasksChecked: !showTasksChecked + } + ), function () { + if(this.state.allEventsFromServer!=null) + { + this.addEventsToCalendar(this.state.allEventsFromServer) + }else{ + this.getAllEventsfromServer() + } + }); + + } + userPreferencesChanged(){ + if(this.state.allEventsFromServer!=null) + { + this.addEventsToCalendar(this.state.allEventsFromServer) + }else{ + this.getAllEventsfromServer() + } + } render() { const eventDataDashBoard = this.state.eventDataDashBoard @@ -508,13 +549,34 @@ class DashboardView extends Component { { options.push( ) } + + var calendarsSelect= null + if(varNotEmpty(this.state.caldav_accounts) && Array.isArray(this.state.caldav_accounts) && this.state.caldav_accounts.length>0) + { + calendarsSelect = + } return (<> - - + + + {options} + + + + + + + {calendarsSelect} + void; + +} +export function ListGroupCalDAVAccounts(props: customProps ){ + const [modalShow, setModalShow] = useState(false); + const i18next = getI18nObject() + const [prefObject, setPrefObject] =useState(getLatestPreferenceObject(props.caldav_accounts)) + + + + const onChangeChecked = (e, indexInPreferenceObject) =>{ + var index = JSON.parse(e.target.id) + Preference_CalendarsToShow.update(index, e.target.checked) + setPrefObject(getLatestPreferenceObject(props.caldav_accounts)) + if(props.onChange()!=undefined){ + props.onChange() + } + } + var output=[] + if(props.caldav_accounts.length>0 ) + { + for(const i in props.caldav_accounts){ + + output.push(

{props.caldav_accounts[i].account.name}

) + var calendarOutput =[] + if(varNotEmpty(props.caldav_accounts[i].calendars) && props.caldav_accounts[i].calendars) + for(const j in props.caldav_accounts[i].calendars){ + var indexInPreferenceObject = Preference_CalendarsToShow.findIndex_Calendar(prefObject, props.caldav_accounts[i].account.caldav_accounts_id, props.caldav_accounts[i].calendars[j].calendars_id) + if(varNotEmpty(indexInPreferenceObject) && Array.isArray(indexInPreferenceObject) && indexInPreferenceObject.length>0) + { + calendarOutput.push( onChangeChecked( e, indexInPreferenceObject)} label={props.caldav_accounts[i].calendars[j].displayName}/>) + + } + + } + + output.push(
{calendarOutput}
) + + } + } + return( + <> + setModalShow(false)} + size="lg" + aria-labelledby="contained-modal-title-vcenter" + centered + > + + + {i18next.t("SELECT_CALENDARS_TO_SHOW")} + + + + {output} + + + + + + + {i18next.t("SELECT_CALENDARS_TO_SHOW")} + + + }> + + + + + ) + +} + + +function getLatestPreferenceObject(caldav_accounts: {account:{name: string, caldav_accounts_id: number}, calendars: any }[]){ + var calendarstoShow = Preference_CalendarsToShow.get() + if(Preference_CalendarsToShow.isValidObject(calendarstoShow) && Preference_CalendarsToShow.isUptoDate(caldav_accounts)){ + return calendarstoShow + }else{ + var newObj=Preference_CalendarsToShow.generateFromCaldavObject(caldav_accounts) + return newObj + } +} diff --git a/src/components/tasks/GenerateTaskUIList.js b/src/components/tasks/GenerateTaskUIList.js index b2d667f..ea0846d 100644 --- a/src/components/tasks/GenerateTaskUIList.js +++ b/src/components/tasks/GenerateTaskUIList.js @@ -25,6 +25,7 @@ export default class GenerateTaskUIList extends Component{ } componentDidMount(){ + this.setState({showDone: this.props.showDone, }) //this.renderTasks(false) @@ -171,6 +172,7 @@ export default class GenerateTaskUIList extends Component{ var hardFilter= todoList[1][key].todo.summary!=null && todoList[1][key].todo.summary!=undefined && (todoList[1][key].todo.deleted == null || todoList[1][key].todo.deleted == "") var showTask = false const showDone= this.state.showDone + console.log("showDone", showDone) if(showDone) { showTask=true diff --git a/src/components/tasks/TaskView.js b/src/components/tasks/TaskView.js index 9c0aa9d..0d1a143 100644 --- a/src/components/tasks/TaskView.js +++ b/src/components/tasks/TaskView.js @@ -63,7 +63,7 @@ export function TaskView(props) { var output_list=( - ) + ) } else diff --git a/src/config/constants.js b/src/config/constants.js index 5aaa70c..2d43c9b 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -1,4 +1,4 @@ -export const VERSION_NUMBER = "0.1.7" +export const VERSION_NUMBER = "0.1.8" /* * SYSTEM_DEFAULT_LABEL_PREFIX: Default prefix applied to all system generated labels like * "My Day" diff --git a/src/helpers/frontend/classes/UserPreferences/Preference_CalendarsToShow.ts b/src/helpers/frontend/classes/UserPreferences/Preference_CalendarsToShow.ts new file mode 100644 index 0000000..6e6eab5 --- /dev/null +++ b/src/helpers/frontend/classes/UserPreferences/Preference_CalendarsToShow.ts @@ -0,0 +1,172 @@ +import Cookies from "js-cookie"; +import { varNotEmpty } from "@/helpers/general"; + +export class Preference_CalendarsToShow{ + + + static get(){ + var cookie = null + try{ + cookie = JSON.parse(Cookies.get("USER_PREFERENCE_CALENDARS_TO_SHOW")) + }catch(e) + { + console.error(e, "Preference_CalendarsToShow.get") + } + + return cookie + } + + static set(preferenceObject: {account:{caldav_accounts_id: number}, calendars: any }[]){ + Cookies.remove("USER_PREFERENCE_CALENDARS_TO_SHOW") + Cookies.set("USER_PREFERENCE_CALENDARS_TO_SHOW", JSON.stringify(preferenceObject), { expires: 10000 }) + + } + + static generateFromCaldavObject(caldav_accounts: {account:{name: string, caldav_accounts_id: number}, calendars: any }[]){ + + var objToReturn = [] + for(const i in caldav_accounts){ + var entry = {} + + + + if(varNotEmpty(caldav_accounts[i].calendars) && Array.isArray(caldav_accounts[i].calendars) && caldav_accounts[i].calendars.length>0) + { + var newCalendarEntry = [] + + + for(const k in caldav_accounts[i].calendars){ + if(varNotEmpty(caldav_accounts[i].calendars[k].caldav_accounts_id) && varNotEmpty(caldav_accounts[i].calendars[k].calendars_id && varNotEmpty(caldav_accounts[i].calendars[k].displayName))){ + newCalendarEntry.push({ + calendars_id: caldav_accounts[i].calendars[k].calendars_id, + caldav_accounts_id: caldav_accounts[i].calendars[k].caldav_accounts_id, + show: true + }) + } + } + + if(newCalendarEntry.length>0) + { + entry["account"]={ + caldav_accounts_id:caldav_accounts[i].account.caldav_accounts_id, + } + entry["calendars"]=newCalendarEntry + + objToReturn.push(entry) + } + + } + + + } + Preference_CalendarsToShow.set(objToReturn) + return objToReturn + } + + static isValidObject(preferenceObject: any): boolean{ + if(varNotEmpty(preferenceObject) && Array.isArray(preferenceObject) && preferenceObject.length>0) + { + for(const i in preferenceObject) + { + if(!varNotEmpty(preferenceObject[i].account) ||!varNotEmpty( preferenceObject[i].account.caldav_accounts_id) || !varNotEmpty(preferenceObject[i].calendars) || Array.isArray(preferenceObject[i].calendars) ==false ) { + return false + } + } + + }else{ + return false + } + + + return true + + } + + static isUptoDate(caldav_accounts:{account:{name: string, caldav_accounts_id: number}, calendars: any }[]){ + var fromStorage = Preference_CalendarsToShow.get() + if(varNotEmpty(fromStorage) && Array.isArray(fromStorage)){ + for(const i in caldav_accounts){ + if(this.findIndex_CaldavAccount(fromStorage, caldav_accounts[i].account.caldav_accounts_id)==null){ + return false + }else{ + for (const j in caldav_accounts[i].calendars) + { + var index = this.findIndex_Calendar(fromStorage, caldav_accounts[i].account.caldav_accounts_id,caldav_accounts[i].calendars[j].calendars_id) + + if(index==null ){ + return false + } + + } + } + } + }else{ + return false + } + + + return true + } + + static findIndex_CaldavAccount(objectFromStorage, caldav_accounts_id,){ + + for(const i in objectFromStorage){ + + if(objectFromStorage[i].account.caldav_accounts_id==caldav_accounts_id) + { + return i + } + } + + return null + } + + static findIndex_Calendar(objectFromStorage, caldav_accounts_id, calendars_id){ + for(const i in objectFromStorage){ + + if(objectFromStorage[i].account.caldav_accounts_id==caldav_accounts_id) + { + for(const j in objectFromStorage[i].calendars){ + if(objectFromStorage[i].calendars[j].calendars_id==calendars_id) + { + return [i, j] + } + } + } + } + + return null + + } + + static update(indexToUpdate: number[], newValue: boolean){ + + var fromStorage = this.get() + fromStorage[indexToUpdate[0]].calendars[indexToUpdate[1]].show=newValue + this.set(fromStorage) + + + return null + } + + static getShowValueForCalendar(caldav_accounts_id: number | string, calendars_id: number | string ): boolean{ + + var objectFromStorage = this.get() + + if(this.isValidObject(objectFromStorage)) + { + var index= this.findIndex_Calendar(objectFromStorage, caldav_accounts_id, calendars_id) + if(varNotEmpty(index)){ + + var toReturn=objectFromStorage[index[0]].calendars[index[1]].show + if(varNotEmpty(toReturn) && typeof(toReturn) =="boolean") + { + return toReturn + } + } + + } + + return true + } +} \ No newline at end of file diff --git a/src/helpers/frontend/settings.js b/src/helpers/frontend/settings.js index d7f6b3b..1a8da29 100644 --- a/src/helpers/frontend/settings.js +++ b/src/helpers/frontend/settings.js @@ -64,4 +64,6 @@ export async function getDefaultViewForCalendar() } }) -} \ No newline at end of file +} + + diff --git a/src/helpers/frontend/userpreference.ts b/src/helpers/frontend/userpreference.ts new file mode 100644 index 0000000..29a2484 --- /dev/null +++ b/src/helpers/frontend/userpreference.ts @@ -0,0 +1,31 @@ +import Cookies from "js-cookie"; +import { varNotEmpty } from "../general"; + +export function getCalendarsToShow(){ + return Cookies.get("USER_PREFERENCE_CALENDARS_TO_SHOW") +} + +export function setCalendarstoShow(preferenceObject: {account:{caldav_accounts_id: number, show: boolean}, calendars: {calendars_id: number, caldav_accounts_id: number, show: boolean,}[] }[]){ + Cookies.set("USER_PREFERENCE_CALENDARS_TO_SHOW", JSON.stringify(preferenceObject), { expires: 10000 }) + +} + + export function isValid_UserPreference_CalendarsToShow(preferenceObject: any): boolean{ + + + if(varNotEmpty(preferenceObject) && Array.isArray(preferenceObject) && preferenceObject.length>0) + { + for(const i in preferenceObject) + { + if(!varNotEmpty(preferenceObject[i].account) || varNotEmpty( preferenceObject[i].account.caldav_accounts_id) || !varNotEmpty(preferenceObject[i].account.show) || typeof(preferenceObject[i].account.show)!="boolean" || !varNotEmpty(preferenceObject[i].calendars) || Array.isArray(preferenceObject[i].calendars) ==false ) { + return false + } + } + + }else{ + return false + } + + + return true +} \ No newline at end of file diff --git a/src/i18n/strings.json b/src/i18n/strings.json index 1159bda..6f347c5 100644 --- a/src/i18n/strings.json +++ b/src/i18n/strings.json @@ -1,200 +1,206 @@ { - "en" :{ + "en": { "translation": { - "APP_NAME": "Manage my Damn Life", - "APP_NAME_TITLE": "MMDL", - "NAME": "Name", - "TASKS":"Tasks", - "LOGIN": "Login", - "EMAIL": "Email", - "REGISTER": "Register", - "USERS": "Users", - "USERNAME": "Username", - "CREATED_ON": "Created On", - "ENTER_USERNAME": "Enter username", - "ADMIN": "Admin", - "YES": "Yes", - "NO": "No", - "INVALID_USERNAME":"Invalid username.", - "ENTER_EMAIL": "Enter email", - "INVALID_EMAIL": "Invalid email.", - "RESET_PASSWORD": "Reset your password", - "ENTER_A_PASSWORD":"Enter a password", - "REENTER_PASSWORD" : "Reenter Password", - "INVALID_PASSWORD" : "Invalid password.", - "PASSWORD_DONT_MATCH" : "Passwords don't match", - "INVALID_INPUT" : "Server responded: Invalid input.", - "INVALID_METHOD" : "Server responded: Invalid method.", - "PLEASE_LOGIN": "User not logged in. Login and try again.", - "ERROR" : "Error", - "DELETE_OK": "Deleted successfully.", - "DELETE": "Delete", - "DELETE_CALDAV_ACCOUNT_CONFIRMATION": "Are you sure you want to delete the following CalDAV account?", - "DELETE_USER_CONFIRMATION": "Are you sure you want to delete this user?", - "ERROR_GENERIC": "Something went wrong. Please try again later. Try checking logs for more details.", - "NO_RESPONSE_FROM_SERVER":"Couldn't reach server.", - "MY_DAY": "My day", - "DUE_TODAY": "Due Today", - "DUE": "Due", - "HIGH_PROIRITY":"High Priority", - "ALL_TASKS": "All Tasks", - "DUE_NEXT_SEVEN_DAYS": "Due in Next Seven Days", - "THIS_WEEK": "This Week", - "ADD": "Add", - "CLOSE":"Close", - "CONTINUE": "Continue", - "SAVE": "Save", - "TASK": "Task", - "EDIT_EVENT": "Edit Event", - "EDIT_TASK": "Edit Task", - "TODAY":"Today", - "EDITING_IN_PROGRESS": "Editing in Progress", - "FROM": "From", - "TO":"To", - "ALL_DAY_EVENT": "All Day Event", - "EVENT_SUMMARY" : "Event Summary", - "SUBMIT" : "Submit", - "BACK": "Back", - "HELP":"Help", - "ACCOUNT_INFO" : "Account Information", - "QUICK_ADD":"Quick Add", - "QUICK_ADD_DESC1":"To make it quicker to add tasks, we have a quick add syntax that you can use to assign a due date, labels, or priority to a task.\nThese will be only triggered if you try to add tasks via add task bar.", - "SHORTCUTS": "Shortcuts", - "SYNTAX": "Syntax", - "QUICK_ADD_DATE_DESCRIPTION":"Quickly assign a due date", - "QUICK_ADD_PRIORITY_DESCRIPTION":"Quickly assign a priority", - "QUICK_ADD_LABEL_DESCRIPTION":"Quickly assign a label", - "LEARN_MORE":"Learn more.", - "VERSION": "Version", - "DESCRIPTION":"Description", - "CALDAV_ACCOUNTS": "CalDAV Accounts", - "CALDAV_USERNAME_PLACEHOLDER": "Enter your CalDAV username.", - "CALDAV_PASSWORD_PLACEHOLDER": "Enter your CalDAV password.", - "MANAGE":"Manage", - "NO_CALDAV_ACCOUNTS_TO_SHOW": "No CalDAV accounts to show.", - "ENTER_A_SERVER_NAME": "Enter a valid server URL.", - "ENTER_ACCOUNT_NAME" :"Enter an account name.", - "ENTER_CALDAV_USERNAME": "Enter CalDAV user name", - "ENTER_CALDAV_PASSWORD" :"Enter CalDAV password", - "CALDAV_ACCOUNT_ADDED_SUCCESSFULLY": "CalDAV account added successfully.", - "CALDAV_ACCOUNT_DELETED": "CalDAV account deleted successfully.", - "INVALID_CALDAV_DETAILS": "Invalid CalDAV account details.", - "TASK_VIEW":"Task View", - "CALENDAR_VIEW": "Calendar View", - "GANTT_VIEW": "Gantt View", - "GANTT_VIEW_HELP":"Double click on the task to edit.", - "GANTT_VIEW_HELP_2":"You can also drag and drop tasks to edit start and due date.", - "GANTT_VIEW_HELP_3":"Click on 'Today' to jump to today's date.", - "MANAGE_FILTERS": "Manage Filters", - "MANAGE_FILTERS_DESC": "You can manage your filters here.", - "FILTERS": "Filters", - "YOUR_FILTERS": "Your Filters", - "ADD_NEW_FILTER": "Add New Filter", - "NO_FILTERS_TO_SHOW": "No filters to show.", - "FILTER_NAME": "Filter Name", - "ENTER_FILTER_NAME":"Enter filter name.", - "FILTER_LOGIC": "Filter Logic", - "FILTER_BY_DUE": "Filter by Due", - "FILTER_BY_LABEL": "Filter by Label", - "FILTER_BY_MIN_PRIORITY": "Filter by Minimum Priority", - "PRIORITY": "Priority", - "FILTER_RESULT": "Filter Results:", - "FILTER_RESULT_DESC":"Your current parameters will create the following filter:", - "FILTER_INSERT_OK":"Filter was added successfully.", - "INVALID_FILTER_DETAILS": "Invalid filter details.", - "ENTER_VALID_FILTER_NAME": "Enter a valid filter name.", - "STATUS": "Status", - "EDIT": "Edit", - "LIST": "List", - "NOTHING_TO_SHOW": "Nothing to show.", - "MONTH_VIEW": "Month View", - "SHOW_DONE_TASKS": "Show Done Tasks", - "WEEK_VIEW": "Week View", - "DAY_VIEW": "Day View", - "LIST_VIEW": "List View", - "VIEW": "View", - "SHOW_CHILDREN" : "Show Children", - "SHOW_TASKS_WITH_NO_DUE": "Show tasks with no due date", - "HOME": "Home", - "USER_INSERT_OK": "User was created successfully!", - "ENTER_OTP": "Enter OTP", - "OTP_SENT_TO_EMAIL": "OTP sent to email.", - "PASSWORD_RESET_OK": "Password was set successfully!", - "INSERT_OK": "Inserted successfully!", - "UPDATE_OK" : "Updated successfully!", - "EVENT_SUBMIT_OK": "Event successfully added.", - "CALENDARS": "Calendars", - "CALENDAR": "Calendar", - "DEFAULT": "Default", - "TOTAL": "Total", - "ADD_NEW_CALENDAR": "Add New Calendar", - "CALENDAR_ADDED_SUCCESSFULLY": "Calendar added successfully!", - "ADD_A_CALDAV_ACCOUNT": "You need to add atleast one CalDav Account", - "REFRESHING_CALENDAR_LIST": "Refreshing calendar lists...", - "TASK_ALREADY_IN_MY_DAY": "Task already is in 'My Day'", - "SEARCH":"Search", - "LABEL_MANAGER": "Label Manager", - "LABEL":"Label", - "LABELS":"Labels", - "LABEL_UPDATED": "Label updated successfully!", - "UPDATE_LABEL_CACHE": "Update Label Cache", - "SAVING_LABEL_COLOR": "Saving label color to database...", - "TENTATIVE" : "Tentative", - "CONFIRMED" : "Confirmed", - "CANCELLED" : "Cancelled", - "RECURRENCE": "Recurrence", - "DAILY" : "Daily", - "MONTHLY": "Monthly", - "WEEKLY": "Weekly", - "DAY": "Day", - "DAYS": "Days", - "MONTH": "Month", - "MONTHS": "Months", - "WEEK": "Week", - "WEEKS": "Weeks", - "EVERY": "Every", - "UNTIL": "Until", - "LOCATION":"Location", - "LAST_MODIFIED": "Last Modified", - "ALARM_ALREADY_SET":"Alarm already set.", - "SCHEDULE": "Schedule", - "ADD_SUBTASK": "Add Subtask", - "REMOVE_FROM_MY_DAY" : "Remove from My Day", - "ADD_TO_MY_DAY": "Add to My Day", - "ALARMS": "Alarms", - "REPEAT_TASK_MESSAGE": "This is a repeating task. Some changes (like summary, description, etc.) you make will affect all instances. Current instance being edited: ", - "ALARM_DESCRIPTION_BEFORE_START": "minutes before event start", - "ALARM_DESCRIPTION_BEFORE_END":"minutes before event ends", - "MINUTES_BEFORE": "minutes before", - "START":"Start", - "END": "End", - "NO_ACCESS_TO_DB": "You don't have access to database specified in your configuration. Check your database settings in your .env file.", - "INSTALL": "Install", - "INSTALL_SUCESSFUL": "MMDL was installed successfully! You can now proceed to create your first account, which would be the default admin account.", - "ALREADY_INSTALLED": "MMDL has already been installed. Redirecting...", - "ERROR_DB_CON_ERROR": "Error connecting to database. Check your database settings. Here's some more information:", - "READY_TO_INSTALL": "Your database settings seem fine. You're all set for installation.", - "SETTINGS": "Settings", - "SETTING": "Setting", - "GENERAL_SETTINGS": "General Settings", - "CALENDAR_VIEW_DEFAULT":"Default View for Calendar View", - "ALLOW_REGISTRATION": "Allow user registration", - "RRULE_EMPTY_FREQ": "Please select a frequency of recurrence.", - "ERROR_RRULE_UNTIL_BEFORE_START": "Until date cannot be before start date.", - "DELETE_EVENT_CONFIRMATION": "Are you sure you want to delete this event?", - "ERROR_LOGIN_WITH_PASSWORD": "Server reponded: User already regisered. Kindly login.", - "ERROR_EMAIL_SENDING_FAILED": "Server responded: Error while sending email.", - "ERROR_PASSWORD_RESET_FAILED": "Password reset failed. Please try again.", - "ERROR_ADDING_CALENDER": "Calendar couldn't be added. Check the console log", - "ERROR_NO_ACCESS_TO_CALENDAR": "No access to the calendar.", - "CANT_CREATE_EMPTY_TASK": "Can't submit an event or a task with no summary.", - "EVENT_NEEDS_BOTH_FROM_AND_TO": "Event needs both a 'From' and 'To' date.", - "ERROR_PICK_A_CALENDAR": "Please pick a calendar for the event.", - "ERROR_START_DATE_REQUIRED_FOR_RECCURENCE":"Start date is required with recurrence rules.", - "ERROR_ENDDATE_SMALLER_THAN_START": "End date and due date must be after start date. ", - "ERROR_GETTING_SETTINGS": "Error getting settings. See console logs.", - "USER_REG_DISABLED_FROM_ENV": "User registration is disabled from env variable. You'll need to change the value there to enable it." - - } + "ACCOUNT_INFO": "Account Information", + "ADD": "Add", + "ADD_A_CALDAV_ACCOUNT": "You need to add atleast one CalDav Account", + "ADD_NEW_CALENDAR": "Add New Calendar", + "ADD_NEW_FILTER": "Add New Filter", + "ADD_SUBTASK": "Add Subtask", + "ADD_TO_MY_DAY": "Add to My Day", + "ADMIN": "Admin", + "ALARMS": "Alarms", + "ALARM_ALREADY_SET": "Alarm already set.", + "ALARM_DESCRIPTION_BEFORE_END": "minutes before event ends", + "ALARM_DESCRIPTION_BEFORE_START": "minutes before event start", + "ALLOW_REGISTRATION": "Allow user registration", + "ALL_DAY_EVENT": "All Day Event", + "ALL_TASKS": "All Tasks", + "ALREADY_INSTALLED": "MMDL has already been installed. Redirecting...", + "APP_NAME": "Manage my Damn Life", + "APP_NAME_TITLE": "MMDL", + "BACK": "Back", + "CALDAV_ACCOUNTS": "CalDAV Accounts", + "CALDAV_ACCOUNT_ADDED_SUCCESSFULLY": "CalDAV account added successfully.", + "CALDAV_ACCOUNT_DELETED": "CalDAV account deleted successfully.", + "CALDAV_PASSWORD_PLACEHOLDER": "Enter your CalDAV password.", + "CALDAV_USERNAME_PLACEHOLDER": "Enter your CalDAV username.", + "CALENDAR": "Calendar", + "CALENDARS": "Calendars", + "CALENDAR_ADDED_SUCCESSFULLY": "Calendar added successfully!", + "CALENDAR_VIEW": "Calendar View", + "CALENDAR_VIEW_DEFAULT": "Default View for Calendar View", + "CANCELLED": "Cancelled", + "CANT_CREATE_EMPTY_TASK": "Can't submit an event or a task with no summary.", + "CLOSE": "Close", + "CONFIRMED": "Confirmed", + "CONTINUE": "Continue", + "CREATED_ON": "Created On", + "DAILY": "Daily", + "DAY": "Day", + "DAYS": "Days", + "DAY_VIEW": "Day View", + "DEFAULT": "Default", + "DELETE": "Delete", + "DELETE_CALDAV_ACCOUNT_CONFIRMATION": "Are you sure you want to delete the following CalDAV account?", + "DELETE_EVENT_CONFIRMATION": "Are you sure you want to delete this event?", + "DELETE_OK": "Deleted successfully.", + "DELETE_USER_CONFIRMATION": "Are you sure you want to delete this user?", + "DESCRIPTION": "Description", + "DUE": "Due", + "DUE_NEXT_SEVEN_DAYS": "Due in Next Seven Days", + "DUE_TODAY": "Due Today", + "EDIT": "Edit", + "EDITING_IN_PROGRESS": "Editing in Progress", + "EDIT_EVENT": "Edit Event", + "EDIT_TASK": "Edit Task", + "EMAIL": "Email", + "END": "End", + "ENTER_ACCOUNT_NAME": "Enter an account name.", + "ENTER_A_PASSWORD": "Enter a password", + "ENTER_A_SERVER_NAME": "Enter a valid server URL.", + "ENTER_CALDAV_PASSWORD": "Enter CalDAV password", + "ENTER_CALDAV_USERNAME": "Enter CalDAV user name", + "ENTER_EMAIL": "Enter email", + "ENTER_FILTER_NAME": "Enter filter name.", + "ENTER_OTP": "Enter OTP", + "ENTER_USERNAME": "Enter username", + "ENTER_VALID_FILTER_NAME": "Enter a valid filter name.", + "ERROR": "Error", + "ERROR_ADDING_CALENDER": "Calendar couldn't be added. Check the console log", + "ERROR_DB_CON_ERROR": "Error connecting to database. Check your database settings. Here's some more information:", + "ERROR_EMAIL_SENDING_FAILED": "Server responded: Error while sending email.", + "ERROR_ENDDATE_SMALLER_THAN_START": "End date and due date must be after start date. ", + "ERROR_GENERIC": "Something went wrong. Please try again later. Try checking logs for more details.", + "ERROR_GETTING_SETTINGS": "Error getting settings. See console logs.", + "ERROR_LOGIN_WITH_PASSWORD": "Server reponded: User already regisered. Kindly login.", + "ERROR_NO_ACCESS_TO_CALENDAR": "No access to the calendar.", + "ERROR_PASSWORD_RESET_FAILED": "Password reset failed. Please try again.", + "ERROR_PICK_A_CALENDAR": "Please pick a calendar for the event.", + "ERROR_RRULE_UNTIL_BEFORE_START": "Until date cannot be before start date.", + "ERROR_START_DATE_REQUIRED_FOR_RECCURENCE": "Start date is required with recurrence rules.", + "EVENT_NEEDS_BOTH_FROM_AND_TO": "Event needs both a 'From' and 'To' date.", + "EVENT_SUBMIT_OK": "Event successfully added.", + "EVENT_SUMMARY": "Event Summary", + "EVERY": "Every", + "FILTERS": "Filters", + "FILTER_BY_DUE": "Filter by Due", + "FILTER_BY_LABEL": "Filter by Label", + "FILTER_BY_MIN_PRIORITY": "Filter by Minimum Priority", + "FILTER_INSERT_OK": "Filter was added successfully.", + "FILTER_LOGIC": "Filter Logic", + "FILTER_NAME": "Filter Name", + "FILTER_RESULT": "Filter Results:", + "FILTER_RESULT_DESC": "Your current parameters will create the following filter:", + "FROM": "From", + "GANTT_VIEW": "Gantt View", + "GANTT_VIEW_HELP": "Double click on the task to edit.", + "GANTT_VIEW_HELP_2": "You can also drag and drop tasks to edit start and due date.", + "GANTT_VIEW_HELP_3": "Click on 'Today' to jump to today's date.", + "GENERAL_SETTINGS": "General Settings", + "HELP": "Help", + "HIGH_PROIRITY": "High Priority", + "HOME": "Home", + "INSERT_OK": "Inserted successfully!", + "INSTALL": "Install", + "INSTALL_SUCESSFUL": "MMDL was installed successfully! You can now proceed to create your first account, which would be the default admin account.", + "INVALID_CALDAV_DETAILS": "Invalid CalDAV account details.", + "INVALID_EMAIL": "Invalid email.", + "INVALID_FILTER_DETAILS": "Invalid filter details.", + "INVALID_INPUT": "Server responded: Invalid input.", + "INVALID_METHOD": "Server responded: Invalid method.", + "INVALID_PASSWORD": "Invalid password.", + "INVALID_USERNAME": "Invalid username.", + "LABEL": "Label", + "LABELS": "Labels", + "LABEL_MANAGER": "Label Manager", + "LABEL_UPDATED": "Label updated successfully!", + "LAST_MODIFIED": "Last Modified", + "LEARN_MORE": "Learn more.", + "LIST": "List", + "LIST_VIEW": "List View", + "LOCATION": "Location", + "LOGIN": "Login", + "MANAGE": "Manage", + "MANAGE_FILTERS": "Manage Filters", + "MANAGE_FILTERS_DESC": "You can manage your filters here.", + "MINUTES_BEFORE": "minutes before", + "MONTH": "Month", + "MONTHLY": "Monthly", + "MONTHS": "Months", + "MONTH_VIEW": "Month View", + "MY_DAY": "My day", + "NAME": "Name", + "NO": "No", + "NOTHING_TO_SHOW": "Nothing to show.", + "NO_ACCESS_TO_DB": "You don't have access to database specified in your configuration. Check your database settings in your .env file.", + "NO_CALDAV_ACCOUNTS_TO_SHOW": "No CalDAV accounts to show.", + "NO_FILTERS_TO_SHOW": "No filters to show.", + "NO_RESPONSE_FROM_SERVER": "Couldn't reach server.", + "OTP_SENT_TO_EMAIL": "OTP sent to email.", + "PASSWORD_DONT_MATCH": "Passwords don't match", + "PASSWORD_RESET_OK": "Password was set successfully!", + "PLEASE_LOGIN": "User not logged in. Login and try again.", + "PRIORITY": "Priority", + "QUICK_ADD": "Quick Add", + "QUICK_ADD_DATE_DESCRIPTION": "Quickly assign a due date", + "QUICK_ADD_DESC1": "To make it quicker to add tasks, we have a quick add syntax that you can use to assign a due date, labels, or priority to a task.\nThese will be only triggered if you try to add tasks via add task bar.", + "QUICK_ADD_LABEL_DESCRIPTION": "Quickly assign a label", + "QUICK_ADD_PRIORITY_DESCRIPTION": "Quickly assign a priority", + "READY_TO_INSTALL": "Your database settings seem fine. You're all set for installation.", + "RECURRENCE": "Recurrence", + "REENTER_PASSWORD": "Reenter Password", + "REFRESHING_CALENDAR_LIST": "Refreshing calendar lists...", + "REGISTER": "Register", + "REMOVE_FROM_MY_DAY": "Remove from My Day", + "REPEAT_TASK_MESSAGE": "This is a repeating task. Some changes (like summary, description, etc.) you make will affect all instances. Current instance being edited: ", + "RESET_PASSWORD": "Reset your password", + "RRULE_EMPTY_FREQ": "Please select a frequency of recurrence.", + "SAVE": "Save", + "SAVING_LABEL_COLOR": "Saving label color to database...", + "SCHEDULE": "Schedule", + "SEARCH": "Search", + "SETTING": "Setting", + "SETTINGS": "Settings", + "SHORTCUTS": "Shortcuts", + "SHOW_CHILDREN": "Show Children", + "SHOW_DONE_TASKS": "Show Done Tasks", + "SHOW_TASKS": "Show Tasks", + "SELECT_CALENDARS_TO_SHOW": "Select Calendars to Show", + "SHOW_TASKS_WITH_NO_DUE": "Show tasks with no due date", + "START": "Start", + "STATUS": "Status", + "SUBMIT": "Submit", + "SYNTAX": "Syntax", + "TASK": "Task", + "TASKS": "Tasks", + "TASK_ALREADY_IN_MY_DAY": "Task already is in 'My Day'", + "TASK_VIEW": "Task View", + "TENTATIVE": "Tentative", + "THIS_WEEK": "This Week", + "TO": "To", + "TODAY": "Today", + "TOTAL": "Total", + "UNTIL": "Until", + "UPDATE_LABEL_CACHE": "Update Label Cache", + "UPDATE_OK": "Updated successfully!", + "USERNAME": "Username", + "USERS": "Users", + "USER_INSERT_OK": "User was created successfully!", + "USER_REG_DISABLED_FROM_ENV": "User registration is disabled from env variable. You'll need to change the value there to enable it.", + "VERSION": "Version", + "VIEW": "View", + "WEEK": "Week", + "WEEKLY": "Weekly", + "WEEKS": "Weeks", + "WEEK_VIEW": "Week View", + "YES": "Yes", + "YOUR_FILTERS": "Your Filters" } + }, + "hi":{ + "translation":{ + + } + } } \ No newline at end of file diff --git a/src/pages/api/caldav/calendars/events/db/all.js b/src/pages/api/caldav/calendars/events/db/all.js index 29f76f4..ce3d594 100644 --- a/src/pages/api/caldav/calendars/events/db/all.js +++ b/src/pages/api/caldav/calendars/events/db/all.js @@ -35,7 +35,7 @@ export default async function handler(req, res) { } - allCalendarEvents.push({info: {caldav_account: caldav_accounts[i].name, calendar:calendars[k].displayName, color: calendars[k].calendarColor}, events: allObjectsfromCalendar}) + allCalendarEvents.push({info: {caldav_account: caldav_accounts[i].name,caldav_accounts_id:caldav_accounts[i].caldav_accounts_id, calendar:calendars[k].displayName, color: calendars[k].calendarColor}, events: allObjectsfromCalendar}) } } diff --git a/src/pages/api/caldav/calendars/sync/all.js b/src/pages/api/caldav/calendars/sync/all.js index 26ff303..81888d0 100644 --- a/src/pages/api/caldav/calendars/sync/all.js +++ b/src/pages/api/caldav/calendars/sync/all.js @@ -131,7 +131,7 @@ async function processSyncCalendarResponse(caldav_accounts_id, response) for (const i in response.updated) { var calendarExists=await checkifCalendarExistforUser(response.updated[i],caldav_accounts_id) - console.log(calendarExists, caldav_accounts_id, response.updated[i].calendar_id) + //console.log(calendarExists, caldav_accounts_id, response.updated[i].calendar_id) if(calendarExists==true) { var updateResult= await updateCalendarinDB(response.updated[i], caldav_accounts_id)