-
-
-
+
+
{{ item.textString }}
+ @input="saveEditableText(index, $event)" spellcheck="false">
+ {{ item.textString }}
+
@@ -56,7 +64,7 @@
/* eslint-disable*/
import DateInput from './DateInput.vue';
-import CheckedBox from './CheckBox.vue';
+import BooleanSlider from './BooleanSlider.vue';
import CheckBoxOneWay from './CheckboxOneWay.vue';
import TimeInput from './TimeInput.vue';
import MinuteInput from './MinuteInput.vue';
@@ -72,6 +80,8 @@ export default {
data() {
return {
title: this.listName,
+ listType: null,
+ parentPage: 'dashboard',
itemsArray: [],
titlesArray: [],
completedItemsArray: [],
@@ -82,35 +92,34 @@ export default {
debugMode: false,
textString: '',
- dueDateCheckbox: false,
- dueDateDate: null,
- dueDateTime: null,
- timeEstimate: null,
+ listOrigin: '',
+ scheduledCheckbox: false,
+ scheduledDate: null,
+ scheduledTime: null,
+ timeEstimate: 30,
recurringTask: false,
recurringTaskEndDate: null,
- addToCalendarCheckbox: false,
- completedDateTime: null,
- timeUntilComplete: null,
-
+ dueDateCheckbox: false,
+ dueDate: null,
- defaultDueDateCheckbox: false,
- defaultDueDateDate: null,
- defaultDueDateTime: null,
- defaultTaskTimeEstimate: 0,
+ defaultscheduledCheckbox: false,
+ defaultscheduledDate: null,
+ defaultscheduledTime: null,
+ defaultTaskTimeEstimate: 30,
defaultRecurringTask: false,
defaultRecurringTaskEndDate: null,
- defaultAddToCalendarCheckbox: false,
- defaultCompletedDateTime: null,
+ defaultDueDateCheckbox: false,
+ defaultDueDate: null
};
},
created() {
// Call a method to load initial data
- this.clearStorage();
+ //this.clearStorage();
this.loadInitialData();
},
components: {
DateInput,
- CheckedBox,
+ BooleanSlider,
CheckBoxOneWay,
TimeInput,
MinuteInput,
@@ -120,7 +129,6 @@ export default {
},
watch: {
initialMinutes(newValue) {
- console.log("initialMinutes changed to: ", newValue); // Check if this is called
if (newValue > 0) {
handleUpdateTimeEstimate(newValue);
}
@@ -131,11 +139,22 @@ export default {
initialDateTime(newDateTime) {
handleTimeChange(newDateTime); // Update the selected date when prop changes
},
+ scheduledToggled(scheduledCheckbox) {
+ handlescheduledToggled();
+ },
+ dueDateCheckToggled() {
+ handleDueCheckbox();
+ },
+ dueDateChange(dueDate) {
+ handleDueDateChange(dueDate);
+ }
+
},
methods: {
loadInitialData() {
const storedTitle = localStorage.getItem('title');
if (storedTitle) {
+ console.log(title);
this.title = storedTitle;
}
@@ -155,12 +174,12 @@ export default {
}
},
handleDateChange(date) {
- this.dueDateDate = date; // Update the parent component's selectedDate
- this.itemsArray[this.selectedItemIndex].dueDateDate = date;
+ this.scheduledDate = date; // Update the parent component's selectedDate
+ this.itemsArray[this.selectedItemIndex].scheduledDate = date;
},
- handleCheckboxToggled() {
- this.dueDateCheckbox = !this.dueDateCheckbox;
- this.itemsArray[this.selectedItemIndex].dueDateCheckbox = this.dueDateCheckbox; // Update the checkbox state in the items array
+ handlescheduledToggled() {
+ this.scheduledCheckbox = !this.scheduledCheckbox;
+ this.itemsArray[this.selectedItemIndex].scheduledCheckbox = this.scheduledCheckbox; // Update the checkbox state in the items array
},
handleRecurringTask() {
this.recurringTask = !this.recurringTask;
@@ -168,25 +187,40 @@ export default {
},
handleTimeChange(time) {
- this.dueDateTime = time;
- this.itemsArray[this.selectedItemIndex].dueDateTime = time; // Update the time in the items array
+ this.scheduledTime = time;
+ this.itemsArray[this.selectedItemIndex].scheduledTime = time; // Update the time in the items array
},
handleUpdateTimeEstimate(newMinutes) {
this.taskTimeEstimate = newMinutes;
this.itemsArray[this.selectedItemIndex].taskTimeEstimate = newMinutes;
- console.log('time updated: ' + this.taskTimeEstimate + " for index " + this.selectedItemIndex);
},
- handleCalendarVisible() {
- //needs implementation
+ handleDueCheckbox() {
+ this.dueDateCheckbox = !this.dueDateCheckbox;
+ console.log(this.dueDateCheckbox);
+ this.itemsArray[this.selectedItemIndex].dueDateCheckbox = this.dueDateCheckbox;
+ },
+ saveEditableText(index, event) {
+ this.itemsArray[index].textString = event.target.innerText;
+ this.saveList(); // Persist changes immediately
+ },
+ handleDueDateChange(dueDate) {
+ this.dueDate = dueDate;
+ this.itemsArray[this.selectedItemIndex].dueDate = dueDate; // Update the time in the items array
},
swapItemValues(index) {
const item = this.itemsArray[index];
- this.dueDateDate = item.dueDateDate;
- this.dueDateTime = item.dueDateTime;
- this.dueDateCheckbox = item.dueDateCheckbox;
- this.recurringTask = item.recurringTask;
- this.taskTimeEstimate = item.taskTimeEstimate;
+
+ // Ensure all the required fields are swapped properly
+ this.scheduledDate = item.scheduledDate ?? this.defaultscheduledDate;
+ this.scheduledTime = item.scheduledTime ?? this.defaultscheduledTime;
+ this.scheduledCheckbox = item.scheduledCheckbox ?? this.defaultscheduledCheckbox;
+ //console.log(this.scheduledCheckbox);
+ this.recurringTask = item.recurringTask ?? this.defaultRecurringTask;
+ this.taskTimeEstimate = item.taskTimeEstimate ?? this.defaultTaskTimeEstimate;
+ this.dueDateCheckbox = item.dueDateCheckbox ?? this.defaultDueDateCheckbox;
+ this.dueDate = item.dueDate ?? this.defaultDueDate;
+ this.saveList();
},
completeItem(index) {
if (this.itemsArray[index].textString != '') {
@@ -195,14 +229,15 @@ export default {
this.removeItemByIndex(index);
},
updateTitle() {
+ //Deprecated method.
+
this.saveList();//Save the current list items to the title before changing the title
const titleElement = this.$refs.titleInput.innerText;
this.title = titleElement;
let flag = true;
+ this.createNewItem();
if (this.titlesArray.length !== 0) {
for (let i = 0; i < this.titlesArray.length; i++) {
- // console.log(this.titlesArray[i]);
- // console.log(this.title);
if (this.titlesArray[i] === this.title) {
flag = false;
}
@@ -217,8 +252,15 @@ export default {
this.itemsArray = JSON.parse(textStrings);
},
saveList() {
- localStorage.setItem(this.title, JSON.stringify(this.itemsArray));
+ //localStorage.setItem(this.title, JSON.stringify(this.itemsArray));
//localStorage.setItem(this.title) needs to retrieve previous items
+ this.emitTaskUpdates();
+ },
+ emitTaskUpdates() {
+ this.$emit('update-tasks', {
+ currentTasks: this.itemsArray,
+ completedTasks: this.completedItemsArray,
+ });
},
saveTitlesArray() {
localStorage.setItem('titlesArray', JSON.stringify(this.titlesArray));
@@ -227,16 +269,17 @@ export default {
//future makes api call to get this user's default values
},
createNewItem(text) {
- console.log('newitem created');
return {
textString: text,
- dueDateCheckbox: false,
- dueDateDate: null,
- dueDateTime: null,
- taskTimeEstimate: 0,
+ scheduledCheckbox: false,
+ scheduledDate: null,
+ scheduledTime: null,
+ taskTimeEstimate: 0,
recurringTask: false,
recurringTaskEndDate: null,
addToCalendarCheckbox: false,
+ dueDateCheckbox: false,
+ dueDate: null,
};
},
createItemWithExistingValues(text) {
@@ -244,16 +287,23 @@ export default {
//These could all instead be replaced with
textString: text,
- dueDateCheckbox: this.dueDateCheckbox,
- dueDateDate: this.dueDateDate,
- dueDateTime: this.dueDateTime,
+ scheduledCheckbox: this.scheduledCheckbox,
+ scheduledDate: this.scheduledDate,
+ scheduledTime: this.scheduledTime,
taskTimeEstimate: this.taskTimeEstimate,
recurringTask: this.recurringTask,
recurringTaskEndDate: this.recurringTaskEndDate,
addToCalendarCheckbox: this.addToCalendarCheckbox,
+ dueDateCheckbox: this.dueDateCheckbox,
+ dueDate: this.dueDate,
}
},
dragStart(index) {
+ const element = this.$refs.itemSpan[index];
+ if (element) {
+ this.itemsArray[index].textString = element.innerText; // Capture the current text
+ this.saveList(); // Save the latest changes before drag starts
+ }
this.draggedIndex = index;
},
dragOver(event) {
@@ -261,27 +311,27 @@ export default {
},
drop(index) {
const draggedItem = this.itemsArray[this.draggedIndex];
+ this.swapItemValues(index);
this.itemsArray.splice(this.draggedIndex, 1);
this.itemsArray.splice(index, 0, draggedItem);
this.draggedIndex = null;
this.saveList();
- },/*
+ },
+ /*
populateCurrentValues(index) {
this.textString = this.itemsArray.textString[index];
- this.dueDateCheckbox = this.itemsArray.textString[index];
- this.dueDateDate = this.itemsArray[index];
- this.dueDateTime = this.itemsArray[index];
+ this.scheduledCheckbox = this.itemsArray.textString[index];
+ this.scheduledDate = this.itemsArray[index];
+ this.scheduledTime = this.itemsArray[index];
this.taskTimeEstimate = this.itemsArray[index];
this.recurringTask = this.itemsArray[index];
this.recurringTaskEndDate = this.itemsArray[index];
this.addToCalendarCheckbox = this.itemsArray[index];
},*/
focusEditable(index, position = null) {
- // if (this.selectedItemIndex != index) {
- console.log('focusing on index:' + index);
- this.swapItemValues(index);
- // }
+ this.swapItemValues(index); // Now swap the new values
this.selectedItemIndex = index;
+
this.$nextTick(() => {
const element = this.$refs.itemSpan[index];
if (element) {
@@ -305,7 +355,6 @@ export default {
this.$nextTick(() => {
this.focusEditable(index + 1, 0);
- console.log('focusing from enter');
});
this.saveList();
},
@@ -334,7 +383,7 @@ export default {
if (event.target.innerText.length === 0 && index - 1 >= 0) {
event.preventDefault(); // Prevent default arrow key behavior
this.focusEditable(index - 1, this.itemsArray[index - 1].length);
- console.log('focusing on arrow up and length = 0');
+
}
const selection = window.getSelection();
const range = selection.getRangeAt(0);
@@ -347,14 +396,12 @@ export default {
if ((isTopRow || event.target.innerText.length === 0) && index - 1 >= 0) {
event.preventDefault(); // Prevent default arrow key behavior
this.focusEditable(index - 1, this.itemsArray[index - 1].length);
- console.log('focusing on arrow up and length = 0 + its top row');
}
},
handleArrowDown(index, event) {
if (event.target.innerText.length === 0 && index + 1 < this.itemsArray.length) {
event.preventDefault(); // Prevent default arrow key behavior
this.focusEditable(index + 1, 0);
- console.log('focusing on arrow down and length = 0');
}
const selection = window.getSelection();
const range = selection.getRangeAt(0);
@@ -366,12 +413,10 @@ export default {
if ((isBottomRow || event.target.innerText.length === 0) && index + 1 < this.itemsArray.length) {
event.preventDefault(); // Prevent default arrow key behavior
this.focusEditable(index + 1, 0);
- console.log('focusing on arrow down and length = 0 and is bottom row');
}
},
removeItem() {
this.itemsArray.splice(this.selectedItemIndex, 1);
- this.saveList();
// Ensure at least one empty item remains
if (this.itemsArray.length === 0) {
@@ -383,33 +428,31 @@ export default {
const newIndex = this.selectedItemIndex === this.itemsArray.length ? this.selectedItemIndex - 1 : this.selectedItemIndex;
this.$nextTick(() => {
this.focusEditable(newIndex);
- console.log('focusing on remove normal');
});
}
+ this.saveList();
},
removeItemByIndex(index) {
- this.saveList();
-
// Ensure at least one empty item remains
if (this.itemsArray.length === 0) {
this.itemsArray.push(this.createNewItem(''));
}
if (this.itemsArray.length > 0) {
- let newIndex = index >= this.itemsArray.length ? this.itemsArray.length - 1 : index;
+ let newIndex = index - 1;
+
if (newIndex < 0) newIndex = 0;
this.$nextTick(() => {
this.focusEditable(newIndex);
- console.log('focusing on remove by index');
});
this.itemsArray.splice(index, 1);
if (this.itemsArray.length === 0) {
this.itemsArray.push(this.createNewItem('')); // Add an empty item as a base case
}
+ this.saveList();
}
},
-
setCaretPosition(element, position) {
const range = document.createRange();
const sel = window.getSelection();
diff --git a/src/components/ListItems/MinuteInput.vue b/src/components/ListItems/MinuteInput.vue
index c37a43e..814be73 100644
--- a/src/components/ListItems/MinuteInput.vue
+++ b/src/components/ListItems/MinuteInput.vue
@@ -8,7 +8,7 @@
@focus="showTooltip"
@blur="hideTooltip"
class="minute-input-field"
- placeholder="Minute Estimate"
+ placeholder="Duration"
/>
diff --git a/src/components/ListItems/SliderSelect.vue b/src/components/ListItems/SliderSelect.vue
index f345212..e4de965 100644
--- a/src/components/ListItems/SliderSelect.vue
+++ b/src/components/ListItems/SliderSelect.vue
@@ -11,37 +11,69 @@
+
diff --git a/src/views/Settings.vue b/src/views/Settings.vue
index f7e2dfb..b35da27 100644
--- a/src/views/Settings.vue
+++ b/src/views/Settings.vue
@@ -1,37 +1,5 @@
@@ -77,7 +45,7 @@
export default {
name: 'SettingsWorld',
components: {
- colorPicker,
+ //colorPicker,
}
}
diff --git a/src/views/cssViews/Dashboard.css b/src/views/cssViews/Dashboard.css
new file mode 100644
index 0000000..a933589
--- /dev/null
+++ b/src/views/cssViews/Dashboard.css
@@ -0,0 +1,69 @@
+/* Ensure body and html fill the entire viewport */
+html, body {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+}
+
+/* Top row styling */
+.top-row {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+ height: 10vh; /* Fixed height of 10% of the viewport */
+ padding: 0 20px;
+}
+
+.heroText {
+ font-size: 24px;
+ color: white;
+}
+
+.button-container {
+ display: flex;
+ gap: 20px;
+}
+
+.bigButton {
+ color: white;
+ border-radius: 10px;
+ padding: 10px;
+ background-color: #555;
+ cursor: pointer;
+ transition: background-color 0.3s;
+}
+
+.bigButton:hover {
+ background-color: #777;
+}
+
+/* Page container styling */
+.page-container {
+ display: flex;
+ height: calc(100vh - 10vh); /* Take the full viewport height minus the top row height */
+ overflow: hidden;
+}
+
+/* Lists container (1/4 + 1/4 of the page) */
+.lists-container {
+ display: flex;
+ flex: 2;
+ flex-direction: row;
+ width: 50%;
+ background-color: #f4f4f4;
+ border-right: 1px solid #ccc;
+ box-sizing: border-box;
+ height: 100%; /* Ensure it stretches to fill the remaining height */
+}
+
+/* Each ListElement should take 1/4 of the page width */
+.lists-container > * {
+ flex: 1;
+}
+
+/* Ensure no horizontal scroll */
+body {
+ overflow-x: hidden;
+}
\ No newline at end of file