diff --git a/public/index.html b/public/index.html index 6a376698ad706e6502589c10c3c65954ba37a01c..44da3063496ccc12ef3da382ac9419b91b08e474 100644 --- a/public/index.html +++ b/public/index.html @@ -2,7 +2,7 @@ <html> <head> <meta charset="UTF-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1"> + <!-- <meta name="viewport" content="width=device-width, initial-scale=1" /> --> <title>Example Application</title> <link rel="stylesheet" href="bootstrap.min.css" /> <link rel="stylesheet" href="Styling.css" /> diff --git a/src/taskCompleted.js b/src/taskCompleted.js index 0ae72abd6b5df6c401f7c1ed32af328016c2cc7f..4b71eb78ff8bf0200a53c352ed5bffdda36b2a4e 100644 --- a/src/taskCompleted.js +++ b/src/taskCompleted.js @@ -23,7 +23,7 @@ const history = createHashHistory(); class TaskCompleted extends Component { tasks = []; - categorys = [] + categorys = []; onlyPressedOnce = false; onlyPressedOncePrio = false; onlyPressedOnceDeadline = false; @@ -37,10 +37,10 @@ class TaskCompleted extends Component { Task-name <Icon.Alfa onClick={this.sortAlfa} /> </Column> <Column> - Priority <Icon.Prio onClick={this.prioSort} /> + Priority <Icon.Prio onClick={this.prioSort} /> </Column> <Column> - Category <Icon.Prio style={{pointerEvents: 'none'}} onClick={this.sortCategory} /> + Category <Icon.Prio style={{ pointerEvents: 'none' }} onClick={this.sortCategory} /> </Column> <Column>Completed</Column> <Column> </Column> @@ -48,29 +48,37 @@ class TaskCompleted extends Component { <br /> {this.tasks.map((task) => ( <div key={task.id} className="taskdiv"> - <Row key={task.id}> - <Column title="Task-name"> - <NavLink className="catobject" to={'/completed/' + task.id}> - {task.name} - </NavLink> - </Column> - <Column style={{marginTop: '0.2rem'}}>{task.priority ? <Icon.Priority style={{pointerEvents: 'none'}} /> : <Icon.NoPriority style={{pointerEvents: 'none'}} />}</Column> - <Column style={{marginTop: '0.31rem'}} title="Category" >{this.categorys.map((cate) => (task.categoryId == cate.id ? cate.name : " "))}</Column> - <Column style={{marginTop: '0.31rem'}}>{task.Completedate}</Column> - <Column style={{marginTop: '0.3rem'}}> - <div + <Row key={task.id}> + <Column title="Task-name"> + <NavLink className="catobject" to={'/completed/' + task.id}> + {task.name} + </NavLink> + </Column> + <Column style={{ marginTop: '0.2rem' }}> + {task.priority ? ( + <Icon.Priority style={{ pointerEvents: 'none' }} /> + ) : ( + <Icon.NoPriority style={{ pointerEvents: 'none' }} /> + )} + </Column> + <Column style={{ marginTop: '0.31rem' }} title="Category"> + {this.categorys.map((cate) => (task.categoryId == cate.id ? cate.name : ' '))} + </Column> + <Column style={{ marginTop: '0.31rem' }}>{task.Completedate}</Column> + <Column style={{ marginTop: '0.3rem' }}> + <div alt="Task delete button" title="Press to delete" style={{ display: 'inline' }} > - <Icon.Trash - onClick={() => { - this.delete(task); - }} - /> - </div> - </Column> - </Row> + <Icon.Trash + onClick={() => { + this.delete(task); + }} + /> + </div> + </Column> + </Row> </div> ))} </Card> @@ -83,9 +91,9 @@ class TaskCompleted extends Component { .getTasks() .then((tasks) => { this.tasks = tasks; - categoryService.getCategorys().then((category)=>{ - this.categorys = category - }) + categoryService.getCategorys().then((category) => { + this.categorys = category; + }); }) .catch((error) => { Alert.danger(error.message); @@ -205,4 +213,4 @@ class TaskCompleted extends Component { } } -export default TaskCompleted; // Exports this Componant to be used in index.js +export default TaskCompleted; // Exports this Componant to be used in index.js diff --git a/src/taskList.js b/src/taskList.js index b0ed0f0213a19fd6c87a61befb58bb68432168fc..f3e9221237e9f7e3ba2767b82268a6fd0d136085 100644 --- a/src/taskList.js +++ b/src/taskList.js @@ -68,29 +68,33 @@ class TaskList extends Component { </Column> <Column> {task.priority ? ( - <Icon.Priority - onClick={() => { - // Changes the priority when the star icon is pressed - task.priority = 0; - this.prioSave(task); - }} - style={{ marginTop: '95%' }} - /> + <div title="Press to untoggle priority" alt="Task priority"> + <Icon.Priority + onClick={() => { + // Changes the priority when the star icon is pressed + task.priority = 0; + this.prioSave(task); + }} + style={{ marginTop: '95%' }} + /> + </div> ) : ( - <Icon.NoPriority - onClick={() => { - // Changes the priority when the star icon is pressed - task.priority = 1; - this.prioSave(task); - }} - style={{ marginTop: '95%' }} - /> + <div title="Press to toggle priority" alt="Task priority"> + <Icon.NoPriority + onClick={() => { + // Changes the priority when the star icon is pressed + task.priority = 1; + this.prioSave(task); + }} + style={{ marginTop: '95%' }} + /> + </div> )} </Column> <Column title="Category"> <div style={{ marginTop: '23%' }}> {this.categorys.map((cate) => (task.categoryId == cate.id ? cate.name : ' '))}{' '} - {/*Addes which category each task belongs to */} + {/*Addes which category each task belongs to */} </div> </Column> <Column>