mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
update schedule creation ui and run lint
This commit is contained in:
@@ -516,7 +516,7 @@ export function ScheduleModal({ open, onOpenChange, workspaceId, schedule }: Sch
|
||||
|
||||
{/* Schedule Preview */}
|
||||
{computedCron && schedulePreview && (
|
||||
<div className='rounded-[8px] border border-[var(--border-1)] bg-[var(--surface-2)] px-[12px] py-[10px]'>
|
||||
<div>
|
||||
{'error' in schedulePreview ? (
|
||||
<p className='text-[13px] text-[var(--text-error)]'>{schedulePreview.error}</p>
|
||||
) : (
|
||||
|
||||
@@ -598,7 +598,10 @@ export function Table() {
|
||||
setRenamingColumn(null)
|
||||
return
|
||||
}
|
||||
updateColumnMutation.mutate({ columnName: renamingColumn, updates: { name: renameValue.trim() } })
|
||||
updateColumnMutation.mutate({
|
||||
columnName: renamingColumn,
|
||||
updates: { name: renameValue.trim() },
|
||||
})
|
||||
setRenamingColumn(null)
|
||||
}, [renamingColumn, renameValue])
|
||||
|
||||
@@ -606,17 +609,23 @@ export function Table() {
|
||||
updateColumnMutation.mutate({ columnName, updates: { type: newType } })
|
||||
}, [])
|
||||
|
||||
const handleInsertColumnLeft = useCallback((columnName: string) => {
|
||||
const index = columnsRef.current.findIndex((c) => c.name === columnName)
|
||||
if (index === -1) return
|
||||
addColumnMutation.mutate({ name: generateColumnName(), type: 'string', position: index })
|
||||
}, [generateColumnName])
|
||||
const handleInsertColumnLeft = useCallback(
|
||||
(columnName: string) => {
|
||||
const index = columnsRef.current.findIndex((c) => c.name === columnName)
|
||||
if (index === -1) return
|
||||
addColumnMutation.mutate({ name: generateColumnName(), type: 'string', position: index })
|
||||
},
|
||||
[generateColumnName]
|
||||
)
|
||||
|
||||
const handleInsertColumnRight = useCallback((columnName: string) => {
|
||||
const index = columnsRef.current.findIndex((c) => c.name === columnName)
|
||||
if (index === -1) return
|
||||
addColumnMutation.mutate({ name: generateColumnName(), type: 'string', position: index + 1 })
|
||||
}, [generateColumnName])
|
||||
const handleInsertColumnRight = useCallback(
|
||||
(columnName: string) => {
|
||||
const index = columnsRef.current.findIndex((c) => c.name === columnName)
|
||||
if (index === -1) return
|
||||
addColumnMutation.mutate({ name: generateColumnName(), type: 'string', position: index + 1 })
|
||||
},
|
||||
[generateColumnName]
|
||||
)
|
||||
|
||||
const handleToggleUnique = useCallback((columnName: string) => {
|
||||
const column = columnsRef.current.find((c) => c.name === columnName)
|
||||
@@ -683,7 +692,6 @@ export function Table() {
|
||||
[columnOptions, activeSortState, handleSortChange, handleSortClear]
|
||||
)
|
||||
|
||||
|
||||
if (!isLoadingTable && !tableData) {
|
||||
return (
|
||||
<div className='flex h-full items-center justify-center'>
|
||||
@@ -970,8 +978,8 @@ export function Table() {
|
||||
<ModalBody>
|
||||
<p className='text-[13px] text-[var(--text-secondary)]'>
|
||||
Are you sure you want to delete{' '}
|
||||
<span className='font-medium text-[var(--text-primary)]'>{deletingColumn}</span>?
|
||||
This will remove all data in this column.{' '}
|
||||
<span className='font-medium text-[var(--text-primary)]'>{deletingColumn}</span>? This
|
||||
will remove all data in this column.{' '}
|
||||
<span className='text-[var(--text-error)]'>This action cannot be undone.</span>
|
||||
</p>
|
||||
</ModalBody>
|
||||
|
||||
Reference in New Issue
Block a user