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