mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +00:00
remove spaces from vacancy name (#7417)
Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>
This commit is contained in:
parent
9421887f01
commit
417a6ac084
@ -103,7 +103,7 @@
|
||||
type: typeId as Ref<ProjectType>
|
||||
}
|
||||
export function canClose (): boolean {
|
||||
return name === '' && typeId !== undefined
|
||||
return name.trim() === '' && typeId !== undefined
|
||||
}
|
||||
|
||||
const client = getClient()
|
||||
@ -185,7 +185,7 @@
|
||||
const resId: Ref<Issue> = generateId()
|
||||
const identifier = `${project?.identifier}-${number}`
|
||||
const data: AttachedData<Issue> = {
|
||||
title: template.title + ` (${name})`,
|
||||
title: template.title + ` (${name.trim()})`,
|
||||
description: null,
|
||||
assignee: template.assignee,
|
||||
component: template.component,
|
||||
@ -240,7 +240,7 @@
|
||||
const incResult = await client.update(sequence, { $inc: { sequence: 1 } }, true)
|
||||
const data: Data<Vacancy> = {
|
||||
...vacancyData,
|
||||
name,
|
||||
name: name.trim(),
|
||||
description: template?.shortDescription ?? '',
|
||||
fullDescription: null,
|
||||
private: false,
|
||||
@ -336,7 +336,7 @@
|
||||
<Card
|
||||
label={recruit.string.CreateVacancy}
|
||||
okAction={createVacancy}
|
||||
canSave={!!name}
|
||||
canSave={name.trim() !== ''}
|
||||
gap={'gapV-4'}
|
||||
on:close={() => {
|
||||
dispatch('close')
|
||||
|
@ -101,9 +101,13 @@
|
||||
|
||||
const updates: Partial<Data<Vacancy>> = {}
|
||||
const trimmedName = rawName.trim()
|
||||
const trimmedNameOld = object.name?.trim()
|
||||
|
||||
if (trimmedName.length > 0 && trimmedName !== object.name?.trim()) {
|
||||
if (trimmedName.length > 0 && (trimmedName !== trimmedNameOld || trimmedNameOld !== object.name)) {
|
||||
updates.name = trimmedName
|
||||
rawName = trimmedName
|
||||
} else {
|
||||
rawName = object.name
|
||||
}
|
||||
|
||||
if (rawDesc !== object.description) {
|
||||
|
Loading…
Reference in New Issue
Block a user