-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also move the issue editor to the separate component Signed-off-by: Sergei Ogorelkov <sergei.ogorelkov@xored.com>
- Loading branch information
Sergei Ogorelkov
committed
May 4, 2022
1 parent
8d7e307
commit 8f392aa
Showing
9 changed files
with
87 additions
and
55 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
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
68 changes: 68 additions & 0 deletions
68
plugins/tracker-resources/src/components/issues/StatusEditor.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,68 @@ | ||
<!-- | ||
// 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 { Ref, WithLookup } from '@anticrm/core' | ||
import { Issue, IssueStatus, Team } from '@anticrm/tracker' | ||
import { getClient } from '@anticrm/presentation' | ||
import { Tooltip } from '@anticrm/ui' | ||
import tracker from '../../plugin' | ||
import StatusSelector from '../StatusSelector.svelte' | ||
export let value: Issue | ||
export let statuses: WithLookup<IssueStatus>[] | ||
export let currentSpace: Ref<Team> | undefined = undefined | ||
export let isEditable: boolean = true | ||
export let shouldShowLabel: boolean = false | ||
const client = getClient() | ||
const handleStatusChanged = async (newStatus: Ref<IssueStatus> | undefined) => { | ||
if (!isEditable || newStatus === undefined) { | ||
return | ||
} | ||
const currentIssue = await client.findOne(tracker.class.Issue, { space: currentSpace, _id: value._id }) | ||
if (currentIssue === undefined) { | ||
return | ||
} | ||
await client.update(currentIssue, { status: newStatus }) | ||
} | ||
</script> | ||
|
||
{#if value} | ||
{#if isEditable} | ||
<Tooltip direction={'bottom'} label={tracker.string.SetStatus}> | ||
<StatusSelector | ||
kind={'icon'} | ||
{isEditable} | ||
{shouldShowLabel} | ||
{statuses} | ||
selectedStatusId={value.status} | ||
onStatusChange={handleStatusChanged} | ||
/> | ||
</Tooltip> | ||
{:else} | ||
<StatusSelector | ||
kind={'icon'} | ||
{isEditable} | ||
{shouldShowLabel} | ||
{statuses} | ||
selectedStatusId={value.status} | ||
onStatusChange={handleStatusChanged} | ||
/> | ||
{/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