-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Artyom Grigorovich <grigorovichartyom@gmail.com>
- Loading branch information
1 parent
c6b757d
commit ae13a1f
Showing
29 changed files
with
1,079 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
// This file is read by tools that parse documentation comments conforming to the TSDoc standard. | ||
// It should be published with your NPM package. It should not be tracked by Git. | ||
{ | ||
"tsdocVersion": "0.12", | ||
"toolPackages": [ | ||
{ | ||
"packageName": "@microsoft/api-extractor", | ||
"packageVersion": "7.23.0" | ||
} | ||
] | ||
} | ||
// This file is read by tools that parse documentation comments conforming to the TSDoc standard. | ||
// It should be published with your NPM package. It should not be tracked by Git. | ||
{ | ||
"tsdocVersion": "0.12", | ||
"toolPackages": [ | ||
{ | ||
"packageName": "@microsoft/api-extractor", | ||
"packageVersion": "7.23.0" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
plugins/tracker-resources/src/components/CommonTrackerDatePresenter.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!-- | ||
// Copyright © 2022 Hardcore Engineering Inc. | ||
// | ||
// Licensed under the Eclipse Public License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. You may | ||
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
--> | ||
<script lang="ts"> | ||
import { Timestamp } from '@anticrm/core' | ||
import { DatePresenter, Tooltip, getDaysDifference } from '@anticrm/ui' | ||
import DueDatePopup from './DueDatePopup.svelte' | ||
import { getDueDateIconModifier } from '../utils' | ||
export let dateMs: number | null = null | ||
export let shouldRender: boolean = true | ||
export let onDateChange: (newDate: number | null) => void | ||
$: today = new Date(new Date(Date.now()).setHours(0, 0, 0, 0)) | ||
$: isOverdue = dateMs !== null && dateMs < today.getTime() | ||
$: dueDate = dateMs === null ? null : new Date(dateMs) | ||
$: daysDifference = dueDate === null ? null : getDaysDifference(today, dueDate) | ||
$: iconModifier = getDueDateIconModifier(isOverdue, daysDifference) | ||
$: formattedDate = !dateMs ? '' : new Date(dateMs).toLocaleString('default', { month: 'short', day: 'numeric' }) | ||
const handleDueDateChanged = async (event: CustomEvent<Timestamp>) => { | ||
const newDate = event.detail | ||
if (newDate === undefined || dateMs === newDate) { | ||
return | ||
} | ||
onDateChange(newDate) | ||
} | ||
</script> | ||
|
||
{#if shouldRender} | ||
{#if formattedDate} | ||
<Tooltip | ||
direction={'top'} | ||
component={DueDatePopup} | ||
props={{ | ||
formattedDate: formattedDate, | ||
daysDifference: daysDifference, | ||
isOverdue: isOverdue, | ||
iconModifier: iconModifier | ||
}} | ||
> | ||
<DatePresenter | ||
value={dateMs} | ||
editable={true} | ||
shouldShowLabel={false} | ||
icon={iconModifier} | ||
on:change={handleDueDateChanged} | ||
/> | ||
</Tooltip> | ||
{:else} | ||
<DatePresenter | ||
value={dateMs} | ||
editable={true} | ||
shouldShowLabel={false} | ||
icon={iconModifier} | ||
on:change={handleDueDateChanged} | ||
/> | ||
{/if} | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
plugins/tracker-resources/src/components/projects/IconPresenter.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- | ||
// Copyright © 2022 Hardcore Engineering Inc. | ||
// | ||
// Licensed under the Eclipse Public License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. You may | ||
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
--> | ||
<script lang="ts"> | ||
import { WithLookup } from '@anticrm/core' | ||
import { Project } from '@anticrm/tracker' | ||
import { Button } from '@anticrm/ui' | ||
export let value: WithLookup<Project> | ||
</script> | ||
|
||
<Button size="small" kind="link" icon={value.icon} /> |
Oops, something went wrong.