Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add edit funtionality to mgt-todo #2783

Merged
merged 37 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9e9dbfb
add edit todo functionality
Mnickii Oct 12, 2023
3b7b690
Merge branch 'main' into feat/edit-todos
Mnickii Oct 17, 2023
acacb67
Merge branch 'main' into feat/edit-todos
Mnickii Oct 25, 2023
7fff785
rewrite edit option to apply focus on input element, remove the fluen…
Mnickii Oct 25, 2023
9ce9ddc
fix input selector
Mnickii Oct 25, 2023
f4be12e
fix dot icon, fix title display
Mnickii Oct 25, 2023
b5b6a33
add edit date funtionality
Mnickii Oct 26, 2023
a4bca40
remove dot-options, change calendar colors to secondary, fix calendar…
Mnickii Nov 1, 2023
4de776a
Merge branch 'main' into feat/edit-todos
Mnickii Nov 1, 2023
34a4efd
fix date display
Mnickii Nov 1, 2023
fe02e03
fix display title bug
Mnickii Nov 2, 2023
1f20763
remove duplicate styling
Mnickii Nov 2, 2023
6acf0e3
Merge branch 'main' into feat/edit-todos
Mnickii Nov 2, 2023
da53fb3
add tests, remove duplicate date style
Mnickii Nov 3, 2023
0d0299e
fix date update bug
Mnickii Nov 3, 2023
b0754f1
fix test
Mnickii Nov 3, 2023
fc2b0d1
Merge branch 'main' into feat/edit-todos
Mnickii Nov 6, 2023
54bf15c
Merge branch 'main' into feat/edit-todos
Mnickii Nov 7, 2023
f6ae414
Merge branch 'main' into feat/edit-todos
Mnickii Nov 8, 2023
edbffb6
fix date update in the case of clearing out date
Mnickii Nov 8, 2023
b039dcc
fix blur functionality on keyboard
Mnickii Nov 9, 2023
6ceff20
Remove eslint suppression
Mnickii Nov 14, 2023
d707267
remove additional eslint suppression
Mnickii Nov 14, 2023
364f519
Merge branch 'main' into feat/edit-todos
Mnickii Nov 14, 2023
61c0669
Merge branch 'main' into feat/edit-todos
musale Nov 14, 2023
a14c7c7
fix date update clear functionality
Mnickii Nov 15, 2023
d70b21f
fix date blur bug
Mnickii Nov 15, 2023
2000d0f
fix date update bug
Mnickii Nov 20, 2023
9644d66
use string comparison for completed tasks sort
Mnickii Nov 20, 2023
83cdc64
fix clear date bug
Mnickii Nov 21, 2023
8160c27
Merge branch 'main' into feat/edit-todos
Mnickii Nov 21, 2023
3c6c5dc
check for task being updated
Mnickii Nov 22, 2023
45c823f
use optional chaining to check for updated task
Mnickii Nov 22, 2023
e80f246
fix error with adding new task
Mnickii Nov 30, 2023
94f7dbf
fix date edit error
Mnickii Nov 30, 2023
a6654bf
fix bug with empty taskData
Mnickii Dec 1, 2023
ead85b2
Merge branch 'main' into feat/edit-todos
gavinbarron Dec 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 51 additions & 53 deletions packages/mgt-components/src/components/mgt-todo/mgt-todo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
margin-block: 1px;
box-shadow: $task-box-shadow;
width: 100%;
display: flex;
background-color: $task-background-color;

&.new-task {
Expand All @@ -25,9 +26,15 @@
}

&.complete {
text-decoration: line-through;
border: 1px solid $task-border-completed;
background: $task-background-color-completed;

.task-details {
.title,
.task-due {
text-decoration: line-through;
}
}
}

&.read-only {
Expand All @@ -47,6 +54,7 @@
padding: 2px;
line-height: 24px;
border-radius: 4px;
width: 100%;

.task {
> div {
Expand All @@ -56,12 +64,13 @@
}
}

.title {
flex-grow: 1;
.task-delete {
display: flex;
}

.task-delete {
.container {
display: flex;
width: 100%;
}

.task-due {
Expand All @@ -70,21 +79,6 @@
height: 32px;
text-decoration: inherit;
display: flex;

.task-calendar {
display: flex;
margin-top: 5px;
margin-inline-end: 10px;

svg {
fill: $task-color;
}
}

.task-due-date {
display: flex;
margin-top: 5px;
}
}
}
}
Expand Down Expand Up @@ -132,16 +126,6 @@
color: $task-color;
width: auto;
cursor: pointer;

&::after {
border-bottom: none;
}

&.dark {
&::part(control) {
color-scheme: dark;
}
}
}

input {
Expand All @@ -156,16 +140,32 @@
border-bottom: 1px solid $task-date-input-hover-color;
}

input:active {
border-bottom: 1px solid $task-date-input-active-color;
}

input:active,
input:focus {
border-bottom: 1px solid $task-date-input-active-color;
}
}
}
}

&.title {
flex-grow: 1;
display: inline;
}

&.date {
color: $task-detail-color;
}

&::after {
border-bottom: none;
}

&.dark {
Mnickii marked this conversation as resolved.
Show resolved Hide resolved
&::part(control) {
color-scheme: dark;
}
}
}

fluent-button {
Expand All @@ -186,38 +186,36 @@
}

fluent-checkbox {
&.task {
&.complete {
div > svg {
.filled {
display: block;
}

.regular {
display: none;
}

path {
fill: $task-radio-background-color;
}
}
}

&.complete {
div > svg {
.filled {
display: none;
display: block;
}

.regular {
display: block;
display: none;
}

path {
fill: $task-background-color;
fill: $task-radio-background-color;
}
}
}

div > svg {
.filled {
display: none;
}

.regular {
display: block;
}

path {
fill: $task-background-color;
}
}

&::part(control) {
margin-inline-start: 10px;
background: none;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
* -------------------------------------------------------------------------------------------
*/

import { expect } from '@open-wc/testing';
import { MockProvider, Providers } from '@microsoft/mgt-element';
import { MgtTodo, registerMgtTodoComponent } from './mgt-todo';

describe('mgt-todo - tests', () => {
before(() => {
registerMgtTodoComponent();
Providers.globalProvider = new MockProvider();
});

it('has required scopes', () => {
expect(MgtTodo.requiredScopes).to.have.members(['tasks.readwrite', 'tasks.read']);
});
});
Loading
Loading