Skip to content

Commit 0a3f5c2

Browse files
authored
Done statuses, replaced circles with a tick and a cross (#2227)
Signed-off-by: Alexander Platov <[email protected]>
1 parent ef16731 commit 0a3f5c2

File tree

11 files changed

+95
-67
lines changed

11 files changed

+95
-67
lines changed

packages/theme/styles/_colors.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@
7878
--caret-color: #6e5ed2;
7979
--warning-color: #f2994a;
8080
--error-color: #eb5757;
81-
--done-color: #34DB80;
81+
--lost-color: #eb5757;
82+
--won-color: #34DB80;
8283

8384
--divider-color: #303236;
8485
--menu-bg-select: #2d2f36;
@@ -229,7 +230,8 @@
229230
--caret-color: #6e5ed2;
230231
--warning-color: #f2994a; // Dark
231232
--error-color: #eb5757; // Dark
232-
--done-color: #34DB80; // Dark
233+
--lost-color: #eb5757; // Dark
234+
--won-color: #34DB80; // Dark
233235

234236
--divider-color: #e0e0e0;
235237
--menu-bg-select: #f0f3f9;

packages/ui/src/components/TabList.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@
6262
}}
6363
>
6464
{#if item.icon}
65-
<div class="icon"><Icon icon={item.icon} size={size === 'small' ? 'x-small' : 'small'} /></div>
65+
<div class="icon">
66+
<Icon icon={item.icon} size={size === 'small' ? 'x-small' : 'small'} fill={item.color ?? 'currentColor'} />
67+
</div>
6668
{:else if item.color}
6769
<div class="color" style:background-color={item.color} />
6870
{/if}

plugins/task-resources/src/components/StatusTableView.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import { TableBrowser } from '@anticrm/view-resources'
2323
import task from '../plugin'
2424
import StatesBar from './state/StatesBar.svelte'
25+
import Won from './icons/Won.svelte'
26+
import Lost from './icons/Lost.svelte'
2527
2628
export let _class: Ref<Class<Task>>
2729
export let space: Ref<SpaceWithStates>
@@ -61,7 +63,8 @@
6163
return {
6264
id: s._id,
6365
label: s.title,
64-
color: s._class === task.class.WonState ? 'var(--done-color)' : 'var(--error-color)'
66+
icon: s._class === task.class.WonState ? Won : Lost,
67+
color: s._class === task.class.WonState ? 'var(--won-color)' : 'var(--lost-color)'
6568
}
6669
})
6770
itemsDS.unshift({ id: 'NoDoneState', labelIntl: task.string.NoDoneState })

plugins/task-resources/src/components/icons/Lost.svelte

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@
1515
-->
1616
<script lang="ts">
1717
export let size: 'small' | 'medium' | 'large'
18-
const fill: string = 'currentColor'
18+
export let style: 'normal' | 'circle' = 'normal'
19+
export let fill: string = 'var(--lost-color)'
1920
</script>
2021

21-
<svg class="svg-{size}" {fill} viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
22-
<path
23-
d="M8,1.5C4.4,1.5,1.5,4.4,1.5,8s2.9,6.5,6.5,6.5s6.5-2.9,6.5-6.5S11.6,1.5,8,1.5z M2.5,8c0-1.3,0.5-2.6,1.3-3.5l7.7,7.7 c-1,0.8-2.2,1.3-3.5,1.3C5,13.5,2.5,11,2.5,8z M12.2,11.5L4.5,3.8C5.4,3,6.7,2.5,8,2.5c3,0,5.5,2.5,5.5,5.5 C13.5,9.3,13,10.6,12.2,11.5z"
24-
/>
22+
<svg class="svg-{size}" {fill} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
23+
{#if style === 'circle'}
24+
<path
25+
d="M15.7,8.3c-0.1-0.1-0.2-0.2-0.3-0.2C15.3,8,15.1,8,15,8s-0.3,0-0.4,0.1c-0.1,0.1-0.2,0.1-0.3,0.2L12,10.6L9.7,8.3C9.5,8.1,9.3,8,9,8S8.5,8.1,8.3,8.3C8.1,8.5,8,8.7,8,9c0,0.3,0.1,0.5,0.3,0.7l2.3,2.3l-2.3,2.3c-0.1,0.1-0.2,0.2-0.2,0.3C8,14.7,8,14.9,8,15s0,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0.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-4.3C17.9,7.5,18,7.3,18,7s-0.1-0.5-0.3-0.7C17.5,6.1,17.3,6,17,6s-0.5,0.1-0.7,0.3L12,10.6L7.7,6.3C7.5,6.1,7.3,6,7,6S6.5,6.1,6.3,6.3C6.1,6.5,6,6.7,6,7s0.1,0.5,0.3,0.7l4.3,4.3l-4.3,4.3c-0.1,0.1-0.2,0.2-0.2,0.3S6,16.9,6,17c0,0.1,0,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0.1,0.2,0.2,0.3,0.2C6.7,18,6.9,18,7,18s0.3,0,0.4-0.1c0.1-0.1,0.2-0.1,0.3-0.2l4.3-4.3l4.3,4.3c0.1,0.1,0.2,0.2,0.3,0.2C16.7,18,16.9,18,17,18c0.1,0,0.3,0,0.4-0.1c0.1-0.1,0.2-0.1,0.3-0.2c0.1-0.1,0.2-0.2,0.2-0.3C18,17.3,18,17.1,18,17C18,16.9,18,16.7,17.9,16.6z"
30+
/>
31+
{/if}
2532
</svg>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!--
2+
// Copyright © 2020, 2021 Anticrm Platform Contributors.
3+
// Copyright © 2021 Hardcore Engineering Inc.
4+
//
5+
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License. You may
7+
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
//
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
-->
16+
<script lang="ts">
17+
export let size: 'small' | 'medium' | 'large'
18+
export let style: 'normal' | 'circle' = 'normal'
19+
export let fill: string = 'var(--dark-color)'
20+
</script>
21+
22+
<svg class="svg-{size}" {fill} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
23+
{#if style === 'circle'}
24+
<path
25+
d="M12,2c-2,0-3.9,0.6-5.6,1.7C4.8,4.8,3.5,6.3,2.8,8.2C2,10,1.8,12,2.2,14s1.3,3.7,2.7,5.1c1.4,1.4,3.2,2.4,5.1,2.7c1.9,0.4,4,0.2,5.8-0.6c1.8-0.8,3.4-2,4.5-3.7C21.4,15.9,22,14,22,12c0-1.3-0.3-2.6-0.8-3.8C20.7,7,20,5.9,19.1,4.9c-0.9-0.9-2-1.7-3.2-2.2C14.6,2.3,13.3,2,12,2z M12,20c-1.6,0-3.1-0.5-4.4-1.3c-1.3-0.9-2.3-2.1-2.9-3.6S3.8,12,4.2,10.4c0.3-1.6,1.1-3,2.2-4.1s2.5-1.9,4.1-2.2C12,3.8,13.6,4,15.1,4.6c1.5,0.6,2.7,1.6,3.6,2.9C19.5,8.9,20,10.4,20,12c0,2.1-0.8,4.2-2.3,5.7C16.2,19.2,14.1,20,12,20z M16,11H8c-0.3,0-0.5,0.1-0.7,0.3C7.1,11.5,7,11.7,7,12s0.1,0.5,0.3,0.7C7.5,12.9,7.7,13,8,13h8c0.3,0,0.5-0.1,0.7-0.3S17,12.3,17,12s-0.1-0.5-0.3-0.7S16.3,11,16,11z"
26+
/>
27+
{:else}
28+
<path
29+
d="M16,11H8c-0.3,0-0.5,0.1-0.7,0.3S7,11.7,7,12s0.1,0.5,0.3,0.7S7.7,13,8,13h8c0.3,0,0.5-0.1,0.7-0.3S17,12.3,17,12s-0.1-0.5-0.3-0.7S16.3,11,16,11z"
30+
/>
31+
{/if}
32+
</svg>

plugins/task-resources/src/components/icons/Won.svelte

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@
1515
-->
1616
<script lang="ts">
1717
export let size: 'small' | 'medium' | 'large'
18-
const fill: string = 'currentColor'
18+
export let style: 'normal' | 'circle' = 'normal'
19+
export let fill: string = 'var(--won-color)'
1920
</script>
2021

21-
<svg class="svg-{size}" {fill} viewBox="0 0 16 16" xmlns="http://www.w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,4.9c-0.9-0.9-2-1.7-3.2-2.2C14.6,2.3,13.3,2,12,2z M12,20c-1.6,0-3.1-0.5-4.4-1.3c-1.3-0.9-2.3-2.1-2.9-3.6S3.8,12,4.2,10.4c0.3-1.6,1.1-3,2.2-4.1s2.5-1.9,4.1-2.2C12,3.8,13.6,4,15.1,4.6c1.5,0.6,2.7,1.6,3.6,2.9C19.5,8.9,20,10.4,20,12c0,2.1-0.8,4.2-2.3,5.7C16.2,19.2,14.1,20,12,20z"
26+
/>
27+
{:else}
28+
<path
29+
d="M18.9,7.5c-0.1-0.1-0.1-0.2-0.2-0.3C18.6,7.1,18.5,7,18.4,7c-0.1-0.1-0.3-0.1-0.4-0.1c-0.1,0-0.3,0-0.4,0.1c-0.1,0.1-0.2,0.1-0.3,0.2l-7.5,7.5l-3.1-3.1c-0.1-0.1-0.2-0.2-0.3-0.2S6.1,11.2,6,11.2c-0.1,0-0.3,0-0.4,0.1c-0.1,0.1-0.2,0.1-0.3,0.2S5.1,11.8,5,11.9C5,12,5,12.1,5,12.3c0,0.1,0,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3l3.8,3.8c0.1,0.1,0.2,0.2,0.3,0.2c0.1,0.1,0.3,0.1,0.4,0.1s0.3,0,0.4-0.1c0.1-0.1,0.2-0.1,0.3-0.2l8.2-8.2c0.1-0.1,0.2-0.2,0.2-0.3C19,8.2,19,8.1,19,7.9C19,7.8,19,7.7,18.9,7.5z"
30+
/>
31+
{/if}
2532
</svg>

plugins/task-resources/src/components/kanban/KanbanDragDone.svelte

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import type { Kanban } from '@anticrm/task'
1919
import task, { DoneState, LostState, WonState } from '@anticrm/task'
2020
import { createEventDispatcher } from 'svelte'
21+
import Won from '../icons/Won.svelte'
22+
import Lost from '../icons/Lost.svelte'
2123
2224
export let kanban: Kanban
2325
let wonStates: WonState[] = []
@@ -58,7 +60,7 @@
5860
on:dragover|preventDefault={() => {}}
5961
on:drop={onDone(wonState)}
6062
>
61-
<div class="done-icon won mr-2" />
63+
<div class="mr-2"><Won size={'small'} /></div>
6264
{wonState.title}
6365
</div>
6466
{/each}
@@ -77,7 +79,7 @@
7779
on:dragover|preventDefault={() => {}}
7880
on:drop={onDone(lostState)}
7981
>
80-
<div class="done-icon lost mr-2" />
82+
<div class="mr-2"><Lost size={'small'} /></div>
8183
{lostState.title}
8284
</div>
8385
{/each}
@@ -111,17 +113,4 @@
111113
border-color: var(--theme-dialog-divider);
112114
}
113115
}
114-
115-
.done-icon {
116-
width: 0.5rem;
117-
height: 0.5rem;
118-
border-radius: 50%;
119-
120-
&.won {
121-
background-color: #27b166;
122-
}
123-
&.lost {
124-
background-color: #f96e50;
125-
}
126-
}
127116
</style>

plugins/task-resources/src/components/state/DoneStateEditor.svelte

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import DoneStatePresenter from './DoneStatePresenter.svelte'
2323
import DoneStatesPopup from './DoneStatesPopup.svelte'
2424
import task from '../../plugin'
25+
import Unknown from '../icons/Unknown.svelte'
2526
2627
export let value: Ref<DoneState> | null | undefined
2728
export let onChange: (value: any) => void
@@ -47,6 +48,7 @@
4748
)
4849
} else {
4950
query.unsubscribe()
51+
state = undefined
5052
}
5153
</script>
5254

@@ -78,19 +80,9 @@
7880
<div class="pointer-events-none"><DoneStatePresenter value={state} showTitle /></div>
7981
{:else}
8082
<div class="flex-row-center pointer-events-none">
81-
<div class="color background-card-divider" />
83+
<div class="dark-color mr-2"><Unknown size={'small'} /></div>
8284
<span class="overflow-label"><Label label={task.string.NoDoneState} /></span>
8385
</div>
8486
{/if}
8587
</svelte:fragment>
8688
</Button>
87-
88-
<style lang="scss">
89-
.color {
90-
margin-right: 0.75rem;
91-
min-width: 0.5rem;
92-
width: 0.5rem;
93-
height: 0.5rem;
94-
border-radius: 0.5rem;
95-
}
96-
</style>

plugins/task-resources/src/components/state/DoneStatePresenter.svelte

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import type { DoneState } from '@anticrm/task'
1818
import task from '@anticrm/task'
1919
import { getPlatformColor } from '@anticrm/ui'
20+
import Won from '../icons/Won.svelte'
21+
import Lost from '../icons/Lost.svelte'
2022
2123
export let value: DoneState
2224
export let showTitle: boolean = false
@@ -26,20 +28,11 @@
2628

2729
{#if value}
2830
<div class="flex-center">
29-
<div class="state-container" class:state-container-title={showTitle} style="background-color: {color};" />
31+
<div class:mr-2={showTitle} style="color: {color};">
32+
<svelte:component this={value._class === task.class.WonState ? Won : Lost} size={'small'} />
33+
</div>
3034
{#if showTitle}
3135
{value.title}
3236
{/if}
3337
</div>
3438
{/if}
35-
36-
<style lang="scss">
37-
.state-container {
38-
width: 0.5rem;
39-
height: 0.5rem;
40-
border-radius: 0.5rem;
41-
}
42-
.state-container-title {
43-
margin-right: 0.75rem;
44-
}
45-
</style>

plugins/task-resources/src/components/state/DoneStatesPopup.svelte

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
import { getPlatformColor, Label } from '@anticrm/ui'
2121
import { createEventDispatcher } from 'svelte'
2222
import task from '../../plugin'
23+
import Won from '../icons/Won.svelte'
24+
import Lost from '../icons/Lost.svelte'
25+
import Unknown from '../icons/Unknown.svelte'
2326
2427
export let space: Ref<SpaceWithStates>
2528
let states: DoneState[] = []
@@ -53,7 +56,9 @@
5356
dispatch('close', state)
5457
}}
5558
>
56-
<div class="color" style="background-color: {getColor(state._class)}" />
59+
<div class="mr-2" style="color: {getColor(state._class)}">
60+
<svelte:component this={state._class === task.class.WonState ? Won : Lost} size={'small'} />
61+
</div>
5762
<span class="label">{state.title}</span>
5863
</button>
5964
{/each}
@@ -63,19 +68,9 @@
6368
dispatch('close', null)
6469
}}
6570
>
66-
<div class="color background-card-divider" />
67-
<Label label={task.string.NoDoneState} />
71+
<div class="dark-color mr-2"><Unknown size={'small'} /></div>
72+
<span class="overflow-label"><Label label={task.string.NoDoneState} /></span>
6873
</button>
6974
</div>
7075
</div>
7176
</div>
72-
73-
<style lang="scss">
74-
.color {
75-
flex-shrink: 0;
76-
margin-right: 0.75rem;
77-
width: 0.5rem;
78-
height: 0.5rem;
79-
border-radius: 0.5rem;
80-
}
81-
</style>

0 commit comments

Comments
 (0)