2021-08-07 17:03:06 +00:00
|
|
|
<!--
|
|
|
|
// Copyright © 2020 Anticrm Platform Contributors.
|
|
|
|
//
|
|
|
|
// 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 { createEventDispatcher } from 'svelte'
|
2021-11-02 08:45:08 +00:00
|
|
|
import { IconFolder, EditBox, ToggleWithLabel, Grid } from '@anticrm/ui'
|
2021-08-07 17:03:06 +00:00
|
|
|
|
2021-11-02 08:45:08 +00:00
|
|
|
import { getClient, SpaceCreateCard } from '@anticrm/presentation'
|
2021-08-07 17:03:06 +00:00
|
|
|
|
|
|
|
import recruit from '../plugin'
|
|
|
|
import core from '@anticrm/core'
|
|
|
|
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
|
|
|
|
let name: string = ''
|
|
|
|
let description: string = ''
|
|
|
|
|
2021-11-04 11:17:59 +00:00
|
|
|
export function canClose(): boolean {
|
|
|
|
return name === ''
|
|
|
|
}
|
|
|
|
|
2021-08-07 17:03:06 +00:00
|
|
|
const client = getClient()
|
|
|
|
|
|
|
|
function createCandidates() {
|
|
|
|
client.createDoc(recruit.class.Candidates, core.space.Model, {
|
|
|
|
name,
|
|
|
|
description,
|
|
|
|
private: false,
|
2021-12-21 09:08:22 +00:00
|
|
|
archived: false,
|
2021-08-07 17:03:06 +00:00
|
|
|
members: []
|
|
|
|
})
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2021-11-02 08:45:08 +00:00
|
|
|
<SpaceCreateCard
|
|
|
|
label={recruit.string.CreateCandidates}
|
|
|
|
okAction={createCandidates}
|
|
|
|
canSave={name ? true : false}
|
|
|
|
on:close={() => { dispatch('close') }}
|
|
|
|
>
|
|
|
|
<Grid column={1} rowGap={1.5}>
|
2021-12-17 09:06:08 +00:00
|
|
|
<EditBox label={recruit.string.CandidatesName} icon={IconFolder} bind:value={name} placeholder={'Talent Pool'} maxWidth={'16rem'} focus/>
|
2021-08-07 17:03:06 +00:00
|
|
|
<ToggleWithLabel label={recruit.string.MakePrivate} description={recruit.string.MakePrivateDescription}/>
|
|
|
|
</Grid>
|
2021-11-02 08:45:08 +00:00
|
|
|
</SpaceCreateCard>
|