Setup/Application-Status ve formix required()
This commit is contained in:
parent
f02a0f8830
commit
9da0b89b8a
22 changed files with 84 additions and 85 deletions
|
|
@ -30,7 +30,7 @@ public class SetupController : ControllerBase
|
||||||
_env = env;
|
_env = env;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("status")]
|
[HttpGet("application-status")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public IActionResult Status()
|
public IActionResult Status()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ internal static class SetupAppRunner
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
app.UseCors("Setup");
|
app.UseCors("Setup");
|
||||||
|
|
||||||
app.MapGet("/api/setup/status", (IConfiguration cfg) =>
|
app.MapGet("/api/setup/application-status", (IConfiguration cfg) =>
|
||||||
Results.Ok(new { dbExists = DatabaseIsReady(cfg) }));
|
Results.Ok(new { dbExists = DatabaseIsReady(cfg) }));
|
||||||
|
|
||||||
app.MapPost("/api/setup/migrate", async (IConfiguration cfg, IHostEnvironment env,
|
app.MapPost("/api/setup/migrate", async (IConfiguration cfg, IHostEnvironment env,
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,11 @@
|
||||||
import apiService from './api.service'
|
import apiService from './api.service'
|
||||||
import { applicationConfigurationUrl } from './abpConfig.service'
|
|
||||||
import { store } from '@/store'
|
import { store } from '@/store'
|
||||||
import { MigrateLogEntry, SetupStatusDto } from '@/proxy/setup/models'
|
import { MigrateLogEntry, SetupStatusDto } from '@/proxy/setup/models'
|
||||||
|
|
||||||
export const getSetupStatus = () =>
|
export const getSetupStatus = () =>
|
||||||
apiService.fetchData<SetupStatusDto>({
|
apiService.fetchData<SetupStatusDto>({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: '/api/setup/status',
|
url: '/api/setup/application-status',
|
||||||
})
|
})
|
||||||
|
|
||||||
export const getMigrateUrl = (): string => {
|
export const getMigrateUrl = (): string => {
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ import { useState } from 'react'
|
||||||
import JsonRowOpDialogPane from './json-row-operations/JsonRowOpDialogPane'
|
import JsonRowOpDialogPane from './json-row-operations/JsonRowOpDialogPane'
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
height: string().required('Height Required'),
|
height: string().required(),
|
||||||
name: string().required('Name Required'),
|
name: string().required(),
|
||||||
backgroundColor: string().notRequired(),
|
backgroundColor: string().notRequired(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ import { listFormDefaultLayoutOptions, listFormTypeOptions } from './options'
|
||||||
import { IdentityRoleDto, IdentityUserDto } from '@/proxy/admin/models'
|
import { IdentityRoleDto, IdentityUserDto } from '@/proxy/admin/models'
|
||||||
|
|
||||||
const schema = Yup.object().shape({
|
const schema = Yup.object().shape({
|
||||||
cultureName: Yup.string().required('Culture Name Required'),
|
cultureName: Yup.string().required(),
|
||||||
listFormType: Yup.string().required('List Form Type Required'),
|
listFormType: Yup.string().required(),
|
||||||
title: Yup.string().required('Title Required'),
|
title: Yup.string().required(),
|
||||||
name: Yup.string(),
|
name: Yup.string(),
|
||||||
description: Yup.string(),
|
description: Yup.string(),
|
||||||
isSubForm: Yup.boolean(),
|
isSubForm: Yup.boolean(),
|
||||||
|
|
|
||||||
|
|
@ -296,9 +296,9 @@ export function FormTabWorkflow(
|
||||||
}
|
}
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
approvalUserFieldName: string(),
|
approvalUserFieldName: string().required(),
|
||||||
|
approvalStatusFieldName: string().required(),
|
||||||
approvalDateFieldName: string(),
|
approvalDateFieldName: string(),
|
||||||
approvalStatusFieldName: string(),
|
|
||||||
approvalDescriptionFieldName: string(),
|
approvalDescriptionFieldName: string(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -322,6 +322,7 @@ export function FormTabWorkflow(
|
||||||
<Card className="my-2">
|
<Card className="my-2">
|
||||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-2">
|
<div className="grid grid-cols-1 md:grid-cols-4 gap-2">
|
||||||
<FormItem
|
<FormItem
|
||||||
|
asterisk
|
||||||
label={translate('::ListForms.ListFormEdit.Workflow.ApprovalUserFieldName')}
|
label={translate('::ListForms.ListFormEdit.Workflow.ApprovalUserFieldName')}
|
||||||
invalid={
|
invalid={
|
||||||
errors.workflowDto?.approvalUserFieldName &&
|
errors.workflowDto?.approvalUserFieldName &&
|
||||||
|
|
@ -346,30 +347,7 @@ export function FormTabWorkflow(
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
label={translate('::ListForms.ListFormEdit.Workflow.ApprovalDateFieldName')}
|
asterisk
|
||||||
invalid={
|
|
||||||
errors.workflowDto?.approvalDateFieldName &&
|
|
||||||
touched.workflowDto?.approvalDateFieldName
|
|
||||||
}
|
|
||||||
errorMessage={errors.workflowDto?.approvalDateFieldName}
|
|
||||||
>
|
|
||||||
<Field type="text" name="workflowDto.approvalDateFieldName">
|
|
||||||
{({ field, form }: FieldProps<SelectBoxOption>) => (
|
|
||||||
<Select
|
|
||||||
field={field}
|
|
||||||
form={form}
|
|
||||||
options={columnOptions}
|
|
||||||
isClearable={true}
|
|
||||||
value={columnOptions.filter(
|
|
||||||
(option) => option.value === values.workflowDto.approvalDateFieldName,
|
|
||||||
)}
|
|
||||||
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Field>
|
|
||||||
</FormItem>
|
|
||||||
|
|
||||||
<FormItem
|
|
||||||
label={translate('::ListForms.ListFormEdit.Workflow.ApprovalStatusFieldName')}
|
label={translate('::ListForms.ListFormEdit.Workflow.ApprovalStatusFieldName')}
|
||||||
invalid={
|
invalid={
|
||||||
errors.workflowDto?.approvalStatusFieldName &&
|
errors.workflowDto?.approvalStatusFieldName &&
|
||||||
|
|
@ -392,6 +370,30 @@ export function FormTabWorkflow(
|
||||||
)}
|
)}
|
||||||
</Field>
|
</Field>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem
|
||||||
|
label={translate('::ListForms.ListFormEdit.Workflow.ApprovalDateFieldName')}
|
||||||
|
invalid={
|
||||||
|
errors.workflowDto?.approvalDateFieldName &&
|
||||||
|
touched.workflowDto?.approvalDateFieldName
|
||||||
|
}
|
||||||
|
errorMessage={errors.workflowDto?.approvalDateFieldName}
|
||||||
|
>
|
||||||
|
<Field type="text" name="workflowDto.approvalDateFieldName">
|
||||||
|
{({ field, form }: FieldProps<SelectBoxOption>) => (
|
||||||
|
<Select
|
||||||
|
field={field}
|
||||||
|
form={form}
|
||||||
|
options={columnOptions}
|
||||||
|
isClearable={true}
|
||||||
|
value={columnOptions.filter(
|
||||||
|
(option) => option.value === values.workflowDto.approvalDateFieldName,
|
||||||
|
)}
|
||||||
|
onChange={(option) => form.setFieldValue(field.name, option?.value)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Field>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
label={translate(
|
label={translate(
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ import {
|
||||||
import { ChartSeriesDto } from '@/proxy/admin/charts/models'
|
import { ChartSeriesDto } from '@/proxy/admin/charts/models'
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
name: string().required('Name Required'),
|
name: string().required(),
|
||||||
backgroundColor: string().notRequired(),
|
backgroundColor: string().notRequired(),
|
||||||
height: number().notRequired(),
|
height: number().notRequired(),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ const schema = Yup.object().shape({
|
||||||
valueType: Yup.string().notRequired(),
|
valueType: Yup.string().notRequired(),
|
||||||
type: Yup.string().notRequired(),
|
type: Yup.string().notRequired(),
|
||||||
position: Yup.string().notRequired(),
|
position: Yup.string().notRequired(),
|
||||||
name: Yup.string().required('Name Required'),
|
name: Yup.string().required(),
|
||||||
title: Yup.string().notRequired(),
|
title: Yup.string().notRequired(),
|
||||||
width: Yup.number().min(0, 'Width must be greater than or equal to 0').notRequired(),
|
width: Yup.number().min(0, 'Width must be greater than or equal to 0').notRequired(),
|
||||||
grid: Yup.object().shape({
|
grid: Yup.object().shape({
|
||||||
|
|
|
||||||
|
|
@ -31,13 +31,13 @@ import {
|
||||||
import { UiCommandButtonPositionTypeEnum } from '@/proxy/form/models'
|
import { UiCommandButtonPositionTypeEnum } from '@/proxy/form/models'
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
buttonPosition: number().required('Button Position Required'),
|
buttonPosition: number().required(),
|
||||||
authName: string().required('Authorization Required'),
|
authName: string().required(),
|
||||||
text: string().required('Text Required'),
|
text: string().required(),
|
||||||
hint: string().required('Text Required'),
|
hint: string().required(),
|
||||||
icon: string().notRequired(),
|
icon: string().notRequired(),
|
||||||
url: string().notRequired(),
|
url: string().notRequired(),
|
||||||
urlTarget: string().required('Url Target Required'),
|
urlTarget: string().required(),
|
||||||
dialogName: string().notRequired(),
|
dialogName: string().notRequired(),
|
||||||
dialogParameters: string().notRequired(),
|
dialogParameters: string().notRequired(),
|
||||||
onClick: string().notRequired(),
|
onClick: string().notRequired(),
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,10 @@ import {
|
||||||
import { FieldCustomValueTypeEnum } from '@/proxy/form/models'
|
import { FieldCustomValueTypeEnum } from '@/proxy/form/models'
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
fieldName: string().required('Field Name Required'),
|
fieldName: string().required(),
|
||||||
customValueType: string().required('Custom Value Type Required'),
|
customValueType: string().required(),
|
||||||
fieldDbType: string().required('Field Type Required'),
|
fieldDbType: string().required(),
|
||||||
value: string().required('Value Required'),
|
value: string().required(),
|
||||||
sqlQuery: string().notRequired(),
|
sqlQuery: string().notRequired(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,10 @@ import {
|
||||||
import { EditingFormItemDto, PlatformEditorTypes } from '@/proxy/form/models'
|
import { EditingFormItemDto, PlatformEditorTypes } from '@/proxy/form/models'
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
itemType: string().required('Item Type Required'),
|
itemType: string().required(),
|
||||||
caption: string().notRequired(),
|
caption: string().notRequired(),
|
||||||
colCount: number().required('Column Count Required'),
|
colCount: number().required(),
|
||||||
colSpan: number().required('Column Span Required'),
|
colSpan: number().required(),
|
||||||
})
|
})
|
||||||
// gridBoxOptions: object().shape({
|
// gridBoxOptions: object().shape({
|
||||||
// columns: string(),
|
// columns: string(),
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,14 @@ import { groupBy } from 'lodash'
|
||||||
import { extraFilterControlTypeOptions } from '@/proxy/admin/list-form/options'
|
import { extraFilterControlTypeOptions } from '@/proxy/admin/list-form/options'
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
fieldName: string().required('Field Name Required'),
|
fieldName: string().required(),
|
||||||
caption: string().required('Caption Required'),
|
caption: string().required(),
|
||||||
operator: string().required('Operator Required'),
|
operator: string().required(),
|
||||||
defaultValue: string(),
|
defaultValue: string(),
|
||||||
controlType: string().required('Control Type Required'),
|
controlType: string().required(),
|
||||||
sqlQuery: string().when('controlType', {
|
sqlQuery: string().when('controlType', {
|
||||||
is: (val: string) => val === 'Select',
|
is: (val: string) => val === 'Select',
|
||||||
then: (schema) => schema.required('SQL Query Required'),
|
then: (schema) => schema.required(),
|
||||||
otherwise: (schema) => schema.notRequired(),
|
otherwise: (schema) => schema.notRequired(),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import {
|
||||||
} from '@/services/admin/list-form.service'
|
} from '@/services/admin/list-form.service'
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
name: string().required('Name Required'),
|
name: string().required(),
|
||||||
backgroundColor: string().notRequired(),
|
backgroundColor: string().notRequired(),
|
||||||
height: number().notRequired(),
|
height: number().notRequired(),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,10 @@ const schema = object().shape({
|
||||||
showInLegend: boolean().notRequired(),
|
showInLegend: boolean().notRequired(),
|
||||||
ignoreEmptyPoints: boolean().notRequired(),
|
ignoreEmptyPoints: boolean().notRequired(),
|
||||||
type: string().notRequired(),
|
type: string().notRequired(),
|
||||||
name: string().required('Name Required'),
|
name: string().required(),
|
||||||
argumentField: string().required('Argument Field Required'),
|
argumentField: string().required(),
|
||||||
valueField: string().required('Value Field Required'),
|
valueField: string().required(),
|
||||||
summaryType: string().required('Summary Type Required'),
|
summaryType: string().required(),
|
||||||
axis: string().notRequired(),
|
axis: string().notRequired(),
|
||||||
pane: string().notRequired(),
|
pane: string().notRequired(),
|
||||||
dashStyle: string().notRequired(),
|
dashStyle: string().notRequired(),
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@ import {
|
||||||
import { SubFormDto, SubFormRelationDto } from '@/proxy/form/models'
|
import { SubFormDto, SubFormRelationDto } from '@/proxy/form/models'
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
tabTitle: string().required('Tab Title Required'),
|
tabTitle: string().required(),
|
||||||
tabType: string().required('Tab Type Required'),
|
tabType: string().required(),
|
||||||
code: string().required('Code Required'),
|
code: string().required(),
|
||||||
isRefresh: boolean(),
|
isRefresh: boolean(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,11 @@ import {
|
||||||
import { colSpanOptions } from '../options'
|
import { colSpanOptions } from '../options'
|
||||||
|
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
colGap: number().required('Column Gap Required'),
|
colGap: number().required(),
|
||||||
colSpan: number().required('Column Span Required'),
|
colSpan: number().required(),
|
||||||
sqlQuery: string().required('SQL Query Required'),
|
sqlQuery: string().required(),
|
||||||
title: string().required('Title Required'),
|
title: string().required(),
|
||||||
value: string().required('Value Required'),
|
value: string().required(),
|
||||||
valueClassName: string().notRequired(),
|
valueClassName: string().notRequired(),
|
||||||
color: string().notRequired(),
|
color: string().notRequired(),
|
||||||
icon: string().notRequired(),
|
icon: string().notRequired(),
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ interface ValidationError {
|
||||||
|
|
||||||
// Validation schema
|
// Validation schema
|
||||||
const validationSchema = Yup.object({
|
const validationSchema = Yup.object({
|
||||||
name: Yup.string().required('Component name is required'),
|
name: Yup.string().required(),
|
||||||
description: Yup.string(),
|
description: Yup.string(),
|
||||||
dependencies: Yup.array().of(Yup.string()),
|
dependencies: Yup.array().of(Yup.string()),
|
||||||
code: Yup.string(),
|
code: Yup.string(),
|
||||||
|
|
|
||||||
|
|
@ -66,11 +66,11 @@ export function CategoryManagement({
|
||||||
|
|
||||||
// Validation şeması
|
// Validation şeması
|
||||||
const CategorySchema = Yup.object().shape({
|
const CategorySchema = Yup.object().shape({
|
||||||
name: Yup.string().required('Name is required'),
|
name: Yup.string().required(),
|
||||||
slug: Yup.string().required('Slug is required'),
|
slug: Yup.string().required(),
|
||||||
description: Yup.string().required('Description is required'),
|
description: Yup.string().required(),
|
||||||
icon: Yup.string(),
|
icon: Yup.string(),
|
||||||
displayOrder: Yup.number().required('Display order is required'),
|
displayOrder: Yup.number().required(),
|
||||||
isActive: Yup.boolean(),
|
isActive: Yup.boolean(),
|
||||||
isLocked: Yup.boolean(),
|
isLocked: Yup.boolean(),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ export function PostManagement({
|
||||||
}
|
}
|
||||||
|
|
||||||
const postValidationSchema = Yup.object().shape({
|
const postValidationSchema = Yup.object().shape({
|
||||||
topicId: Yup.string().required('Topic is required'),
|
topicId: Yup.string().required(),
|
||||||
content: Yup.string()
|
content: Yup.string()
|
||||||
.test('not-empty', 'Content is required', (value) => {
|
.test('not-empty', 'Content is required', (value) => {
|
||||||
const plainText = value?.replace(/<[^>]+>/g, '').trim()
|
const plainText = value?.replace(/<[^>]+>/g, '').trim()
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ export const topicInitialValues = {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const topicValidationSchema = Yup.object().shape({
|
export const topicValidationSchema = Yup.object().shape({
|
||||||
title: Yup.string().required('Başlık zorunludur'),
|
title: Yup.string().required(),
|
||||||
content: Yup.string().required('İçerik zorunludur'),
|
content: Yup.string().required(),
|
||||||
})
|
})
|
||||||
|
|
||||||
export function CreateTopicModal({ onClose, onSubmit }: CreateTopicModalProps) {
|
export function CreateTopicModal({ onClose, onSubmit }: CreateTopicModalProps) {
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,10 @@ const ChartDrawer = ({
|
||||||
const schema = object().shape({
|
const schema = object().shape({
|
||||||
series: array().of(
|
series: array().of(
|
||||||
object().shape({
|
object().shape({
|
||||||
name: string().required(translate('::App.Platform.ChartDrawer.NameRequired')),
|
name: string().required(),
|
||||||
argumentField: string().required(
|
argumentField: string().required(),
|
||||||
translate('::App.Platform.ChartDrawer.ArgumentFieldRequired'),
|
valueField: string().required(),
|
||||||
),
|
summaryType: string().required(),
|
||||||
valueField: string().required(translate('::App.Platform.ChartDrawer.ValueFieldRequired')),
|
|
||||||
summaryType: string().required(translate('::App.Platform.ChartDrawer.SummaryTypeRequired')),
|
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
|
@ -169,7 +167,7 @@ const ChartDrawer = ({
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="flex items-center justify-center gap-2">
|
<div className="flex items-center justify-center gap-2">
|
||||||
{translate('::App.Platform.ChartDrawer.AddNewSeries')}
|
{translate('::App.Platform.ChartDrawer.AddNewSeries')}
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,9 @@ export const MenuItemComponent: React.FC<MenuItemComponentProps> = ({
|
||||||
})
|
})
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
code: Yup.string().required('Code is required'),
|
code: Yup.string().required(),
|
||||||
displayName: Yup.string().required('Display Name is required'),
|
displayName: Yup.string().required(),
|
||||||
order: Yup.number().typeError('Order must be a number').required('Order is required'),
|
order: Yup.number().required(),
|
||||||
url: Yup.string().nullable(),
|
url: Yup.string().nullable(),
|
||||||
icon: Yup.string().nullable(),
|
icon: Yup.string().nullable(),
|
||||||
cssClass: Yup.string().nullable(),
|
cssClass: Yup.string().nullable(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue