Skip to content

Commit a4bafcc

Browse files
Project Click Functionality
- If you click from topic -> subtopic -> project it will populate the inputs needed so you can click start and start clocking - Easy way to organize projects
1 parent 508c978 commit a4bafcc

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ ipcMain.handle('project-handler', async (req, data) => {
461461
await editProject(data.projectID, data.newName);
462462
break;
463463
case 'Delete':
464-
console.log('Delete');
465464
await deleteProject(data.topicID, data.subtopicID, data.projectName);
466465
break;
467466
}
@@ -475,7 +474,6 @@ async function getProjects(){
475474
}
476475

477476
async function deleteProject(topicID, subtopicID, projectName){
478-
console.log(topicID, subtopicID, projectName);
479477
const clockSqlStatement = `DELETE FROM clock WHERE topicID = ? AND subtopicID = ? AND project = ?`;
480478
const params = [topicID, subtopicID, projectName];
481479
const clockResult = databaseHandler('run', clockSqlStatement, params);

src/projectView.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ async function populateProjects(subtopicID, label){
2323

2424
// Add event listener using a closure to capture the current value of 'element'
2525
projectItemDiv_el.addEventListener('click', async () => {
26-
console.log('You clicked the project!');
26+
topicSelect_el.value = currentSelectedTopic.id;
27+
await populateSubtopicSelect(currentSelectedTopic.id);
28+
subtopicSelect_el.value = currentSelectedSubtopic;
29+
projectInput_el.value = element.project;
2730
});
2831

2932
projectItemDiv_el.addEventListener('contextmenu', (event) => {

src/recentProjects.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ async function populateRecentProjects(){
3434
}
3535

3636
function projectEventListener(div, topicID, subtopicID, project){
37-
div.addEventListener('click', () => {
37+
div.addEventListener('click', async () => {
3838
topicSelect_el.value = topicID;
39-
populateSubtopicSelect(topicID);
39+
await populateSubtopicSelect(topicID);
4040
subtopicSelect_el.value = subtopicID;
4141
projectInput_el.value = project;
4242
});

src/subtopicView.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ async function populateSubtopics(topicID, topic) {
1919
noSubtopicTimeText_el.textContent = time;
2020

2121
noSubtopicItem_el.addEventListener('click', async () => {
22-
console.log('No subtopic');
2322
subjectViewLocation = 2;
2423
currentSelectedSubtopic = 'null';
2524
await populateProjects('null', 'Projects');
@@ -50,6 +49,7 @@ async function populateSubtopics(topicID, topic) {
5049
subtopicItemDiv_el.addEventListener('click', async () => {
5150
subjectViewLocation = 2;
5251
currentSelectedSubtopic = element.id;
52+
console.log(currentSelectedSubtopic);
5353
await populateProjects(element.id, 'Projects');
5454
await populateSpecificQuickTimes('subtopic', element.id);
5555
});
@@ -68,9 +68,9 @@ subtopicViewBackButton_el.addEventListener('click', async () => {
6868
subtopicViewBackButton_el.style.display = 'none';
6969
await populateQuickTimes();
7070
await populateTopicView();
71+
currentSelectedTopic = null;
7172
} else if (subjectViewLocation === 1){
7273
await populateSubtopics(currentSelectedTopic.id, currentSelectedTopic.topic);
7374
await populateSpecificQuickTimes('topic', currentSelectedTopic.id);
7475
}
75-
currentSelectedTopic = null;
7676
});

0 commit comments

Comments
 (0)