platform/plugins/tracker-resources/src/components/projects/Projects.svelte
Alexander Platov bde8549e5d
Removed full-size panel mode. Integrate views for channels provider. (#1575)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
2022-04-28 16:53:35 +07:00

89 lines
2.1 KiB
Svelte

<!--
// 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 { FindOptions, Ref, SortingOrder } from '@anticrm/core'
import { Button, IconAdd, Label, showPopup } from '@anticrm/ui'
import { Table } from '@anticrm/view-resources'
import contact from '@anticrm/contact'
import { Project, Team } from '@anticrm/tracker'
import NewProject from './NewProject.svelte'
import plugin from '../../plugin'
export let space: Ref<Team>
const options: FindOptions<Project> = {
sort: {
startDate: SortingOrder.Ascending
},
lookup: {
lead: contact.class.Employee
}
}
async function showCreateDialog () {
showPopup(NewProject, { space, targetElement: null }, null)
}
</script>
<div>
<div class="header">
<div class="header-left">
<Label label={plugin.string.Projects} />
</div>
<div class="header-right">
<Button
icon={IconAdd}
label={plugin.string.Project}
kind="secondary"
on:click={showCreateDialog}
/>
</div>
</div>
<Table
_class={plugin.class.Project}
config={[
{
key: '',
presenter: plugin.component.ProjectPresenter,
label: plugin.string.Project,
sortingKey: 'name'
}
]}
query={{}}
{options}
/>
</div>
<style>
.header {
width: 100%;
height: 50px;
display: flex;
border-bottom: 0.5px solid #666666;
align-items: center;
justify-content: space-between;
}
.header-left {
margin-left: 10px;
}
.header-right {
margin-right: 10px;
}
</style>