DbMigration
This commit is contained in:
parent
054a23bc9d
commit
8280a681d1
5 changed files with 41 additions and 15 deletions
|
|
@ -3078,6 +3078,12 @@
|
||||||
"en": "An error occurred during database migration.",
|
"en": "An error occurred during database migration.",
|
||||||
"tr": "Veritabanı geçişi sırasında bir hata oluştu."
|
"tr": "Veritabanı geçişi sırasında bir hata oluştu."
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"resourceName": "Platform",
|
||||||
|
"key": "App.DbMigrate.ConfirmMessage",
|
||||||
|
"en": "Are you sure you want to start database migration? Please make sure you have a backup before proceeding.",
|
||||||
|
"tr": "Veritabanı geçişini başlatmak istediğinizden emin misiniz? Lütfen devam etmeden önce bir yedekleme yaptığınızdan emin olun."
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"resourceName": "Platform",
|
"resourceName": "Platform",
|
||||||
"key": "App.ClearRedisCache.Message",
|
"key": "App.ClearRedisCache.Message",
|
||||||
|
|
|
||||||
|
|
@ -131,14 +131,6 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
DialogParameters = JsonSerializer.Serialize(new { name = "@Name", id = "@Id" }),
|
DialogParameters = JsonSerializer.Serialize(new { name = "@Name", id = "@Id" }),
|
||||||
IsVisible = true,
|
IsVisible = true,
|
||||||
},
|
},
|
||||||
new() {
|
|
||||||
ButtonPosition= UiCommandButtonPositionTypeEnum.Toolbar,
|
|
||||||
Hint = "ListForms.ListForm.DbMigrate",
|
|
||||||
Text = "ListForms.ListForm.DbMigrate",
|
|
||||||
AuthName = listFormName,
|
|
||||||
OnClick = "UiEvalService.ApiDbMigrate();",
|
|
||||||
IsVisible = true,
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
InsertServiceAddress = "list-form-dynamic-api/tenant-insert",
|
InsertServiceAddress = "list-form-dynamic-api/tenant-insert",
|
||||||
UpdateServiceAddress = "list-form-dynamic-api/tenant-update",
|
UpdateServiceAddress = "list-form-dynamic-api/tenant-update",
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,6 @@ platformApiService.interceptors.response.use(
|
||||||
hasTenantHeader &&
|
hasTenantHeader &&
|
||||||
responseText.includes('tenant')
|
responseText.includes('tenant')
|
||||||
|
|
||||||
console.log('Found', isTenantNotFound)
|
|
||||||
console.log('Error', error.response?.data?.error?.code)
|
|
||||||
|
|
||||||
if (isTenantNotFound && !error.config._tenantRetried) {
|
if (isTenantNotFound && !error.config._tenantRetried) {
|
||||||
store.getActions().locale.setTenantName(undefined)
|
store.getActions().locale.setTenantName(undefined)
|
||||||
error.config._tenantRetried = true
|
error.config._tenantRetried = true
|
||||||
|
|
|
||||||
|
|
@ -434,7 +434,6 @@ export const updateComponentProp = (
|
||||||
);
|
);
|
||||||
|
|
||||||
if (idAttr) {
|
if (idAttr) {
|
||||||
console.log("🎯 Found component with ID:", componentId);
|
|
||||||
// Find existing prop or add new one
|
// Find existing prop or add new one
|
||||||
const existingPropIndex =
|
const existingPropIndex =
|
||||||
element.openingElement.attributes.findIndex(
|
element.openingElement.attributes.findIndex(
|
||||||
|
|
@ -616,8 +615,6 @@ const cleanupDuplicateImports = (code: string): string => {
|
||||||
const reactImports = code.match(reactImportRegex);
|
const reactImports = code.match(reactImportRegex);
|
||||||
|
|
||||||
if (reactImports && reactImports.length > 1) {
|
if (reactImports && reactImports.length > 1) {
|
||||||
console.log("🔧 Found duplicate React imports:", reactImports.length);
|
|
||||||
|
|
||||||
// Collect all hooks from all imports
|
// Collect all hooks from all imports
|
||||||
const allHooks = new Set<string>();
|
const allHooks = new Set<string>();
|
||||||
reactImports.forEach((importLine) => {
|
reactImports.forEach((importLine) => {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
import { useState, useCallback, useEffect, useRef } from 'react'
|
import { useState, useCallback, useEffect, useRef } from 'react'
|
||||||
import { Button, Dialog, Notification, toast } from '@/components/ui'
|
import { Button, Dialog, Notification, toast } from '@/components/ui'
|
||||||
import Container from '@/components/shared/Container'
|
import Container from '@/components/shared/Container'
|
||||||
|
import ConfirmDialog from '@/components/shared/ConfirmDialog'
|
||||||
import { getDataSources } from '@/services/data-source.service'
|
import { getDataSources } from '@/services/data-source.service'
|
||||||
import type { DataSourceDto } from '@/proxy/data-source'
|
import type { DataSourceDto } from '@/proxy/data-source'
|
||||||
import type { SqlQueryExecutionResultDto } from '@/proxy/sql-query-manager/models'
|
import type { SqlQueryExecutionResultDto } from '@/proxy/sql-query-manager/models'
|
||||||
import { sqlObjectManagerService } from '@/services/sql-query-manager.service'
|
import { sqlObjectManagerService } from '@/services/sql-query-manager.service'
|
||||||
import { FaDatabase, FaPlay, FaFileAlt } from 'react-icons/fa'
|
import { FaDatabase, FaPlay, FaFileAlt, FaCopy } from 'react-icons/fa'
|
||||||
import { FaCheckCircle } from 'react-icons/fa'
|
import { FaCheckCircle } from 'react-icons/fa'
|
||||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||||
import SqlObjectExplorer, { type SqlExplorerSelectedObject } from './SqlObjectExplorer'
|
import SqlObjectExplorer, { type SqlExplorerSelectedObject } from './SqlObjectExplorer'
|
||||||
|
|
@ -16,6 +17,8 @@ import { Splitter } from '@/components/codeLayout/Splitter'
|
||||||
import { Helmet } from 'react-helmet'
|
import { Helmet } from 'react-helmet'
|
||||||
import { useStoreState } from '@/store/store'
|
import { useStoreState } from '@/store/store'
|
||||||
import { APP_NAME } from '@/constants/app.constant'
|
import { APP_NAME } from '@/constants/app.constant'
|
||||||
|
import { UiEvalService } from '@/services/UiEvalService'
|
||||||
|
import { FcAcceptDatabase } from 'react-icons/fc'
|
||||||
|
|
||||||
interface SqlManagerState {
|
interface SqlManagerState {
|
||||||
dataSources: DataSourceDto[]
|
dataSources: DataSourceDto[]
|
||||||
|
|
@ -66,6 +69,7 @@ const SqlQueryManager = () => {
|
||||||
const [selectedExplorerObjects, setSelectedExplorerObjects] = useState<
|
const [selectedExplorerObjects, setSelectedExplorerObjects] = useState<
|
||||||
SqlExplorerSelectedObject[]
|
SqlExplorerSelectedObject[]
|
||||||
>([])
|
>([])
|
||||||
|
const [showDbMigrateConfirmDialog, setShowDbMigrateConfirmDialog] = useState(false)
|
||||||
const [showCopyDialog, setShowCopyDialog] = useState(false)
|
const [showCopyDialog, setShowCopyDialog] = useState(false)
|
||||||
const [copyTargetDataSources, setCopyTargetDataSources] = useState<string[]>([])
|
const [copyTargetDataSources, setCopyTargetDataSources] = useState<string[]>([])
|
||||||
const [overwriteIfExists, setOverwriteIfExists] = useState(false)
|
const [overwriteIfExists, setOverwriteIfExists] = useState(false)
|
||||||
|
|
@ -876,12 +880,23 @@ GO`,
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
variant="default"
|
||||||
|
icon={<FcAcceptDatabase />}
|
||||||
|
onClick={() => setShowDbMigrateConfirmDialog(true)}
|
||||||
|
className="shadow-sm"
|
||||||
|
title={translate('::App.DbMigrate.StartMessage') || 'Run DB Migration'}
|
||||||
|
>
|
||||||
|
{translate('::ListForms.ListForm.DbMigrate') || 'DB Migrate'}
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-wrap items-center gap-2 sm:gap-3">
|
<div className="flex flex-wrap items-center gap-2 sm:gap-3">
|
||||||
<Button
|
<Button
|
||||||
size="sm"
|
size="sm"
|
||||||
variant="default"
|
variant="default"
|
||||||
|
icon={<FaCopy />}
|
||||||
onClick={handleOpenCopyDialog}
|
onClick={handleOpenCopyDialog}
|
||||||
disabled={!state.selectedDataSource}
|
disabled={!state.selectedDataSource}
|
||||||
className="shadow-sm"
|
className="shadow-sm"
|
||||||
|
|
@ -1018,6 +1033,25 @@ GO`,
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* DB Migrate Confirmation Dialog */}
|
||||||
|
<ConfirmDialog
|
||||||
|
isOpen={showDbMigrateConfirmDialog}
|
||||||
|
type="info"
|
||||||
|
title={translate('::ListForms.ListForm.DbMigrate') || 'DB Migrate'}
|
||||||
|
cancelText={translate('::Cancel')}
|
||||||
|
confirmText={translate('::App.Platform.Execute') || 'Çalıştır'}
|
||||||
|
onCancel={() => setShowDbMigrateConfirmDialog(false)}
|
||||||
|
onClose={() => setShowDbMigrateConfirmDialog(false)}
|
||||||
|
onConfirm={() => {
|
||||||
|
setShowDbMigrateConfirmDialog(false)
|
||||||
|
UiEvalService.ApiDbMigrate()
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p className="text-gray-600 dark:text-gray-400">
|
||||||
|
{translate('::App.DbMigrate.ConfirmMessage') || 'Veritabanı migration işlemini başlatmak istediğinize emin misiniz?'}
|
||||||
|
</p>
|
||||||
|
</ConfirmDialog>
|
||||||
|
|
||||||
{/* Template Confirmation Dialog */}
|
{/* Template Confirmation Dialog */}
|
||||||
<Dialog
|
<Dialog
|
||||||
isOpen={showTemplateConfirmDialog}
|
isOpen={showTemplateConfirmDialog}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue