mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-02 20:25:47 +00:00
feat: lint errors fix
This commit is contained in:
@@ -44,17 +44,17 @@ export const runMigrations = async ({ applicationDb, auditLogDb, logger }: TArgs
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (auditLogDb) {
|
if (auditLogDb) {
|
||||||
// const hasMigrationTableInAuditLog = await auditLogDb.schema.hasTable(migrationTable);
|
const hasMigrationTableInAuditLog = await auditLogDb.schema.hasTable(migrationTable);
|
||||||
// if (hasMigrationTableInAuditLog) {
|
if (hasMigrationTableInAuditLog) {
|
||||||
// const firstFile = (await auditLogDb(migrationTable).where({}).first()) as { name: string };
|
const firstFile = (await auditLogDb(migrationTable).where({}).first()) as { name: string };
|
||||||
// if (firstFile?.name?.includes(".ts")) {
|
if (firstFile?.name?.includes(".ts")) {
|
||||||
// await auditLogDb(migrationTable).update({
|
await auditLogDb(migrationTable).update({
|
||||||
// name: auditLogDb.raw("REPLACE(name, '.ts', '.mjs')")
|
name: auditLogDb.raw("REPLACE(name, '.ts', '.mjs')")
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const shouldRunMigration = Boolean(
|
const shouldRunMigration = Boolean(
|
||||||
@@ -65,23 +65,23 @@ export const runMigrations = async ({ applicationDb, auditLogDb, logger }: TArgs
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (auditLogDb) {
|
if (auditLogDb) {
|
||||||
// await auditLogDb.transaction(async (tx) => {
|
await auditLogDb.transaction(async (tx) => {
|
||||||
// await tx.raw("SELECT pg_advisory_xact_lock(?)", [PgSqlLock.BootUpMigration]);
|
await tx.raw("SELECT pg_advisory_xact_lock(?)", [PgSqlLock.BootUpMigration]);
|
||||||
// logger.info("Running audit log migrations.");
|
logger.info("Running audit log migrations.");
|
||||||
//
|
|
||||||
// const didPreviousInstanceRunMigration = !(await auditLogDb.migrate
|
const didPreviousInstanceRunMigration = !(await auditLogDb.migrate
|
||||||
// .status(migrationConfig)
|
.status(migrationConfig)
|
||||||
// .catch(migrationStatusCheckErrorHandler));
|
.catch(migrationStatusCheckErrorHandler));
|
||||||
// if (didPreviousInstanceRunMigration) {
|
if (didPreviousInstanceRunMigration) {
|
||||||
// logger.info("No audit log migrations pending: Applied by previous instance. Skipping migration process.");
|
logger.info("No audit log migrations pending: Applied by previous instance. Skipping migration process.");
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// await auditLogDb.migrate.latest(migrationConfig);
|
await auditLogDb.migrate.latest(migrationConfig);
|
||||||
// logger.info("Finished audit log migrations.");
|
logger.info("Finished audit log migrations.");
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
|
|
||||||
await applicationDb.transaction(async (tx) => {
|
await applicationDb.transaction(async (tx) => {
|
||||||
await tx.raw("SELECT pg_advisory_xact_lock(?)", [PgSqlLock.BootUpMigration]);
|
await tx.raw("SELECT pg_advisory_xact_lock(?)", [PgSqlLock.BootUpMigration]);
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ export const auditLogDALFactory = (db: TDbClient) => {
|
|||||||
},
|
},
|
||||||
tx
|
tx
|
||||||
) => {
|
) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Find statements
|
// Find statements
|
||||||
const sqlQuery = (tx || db.replicaNode())(TableName.AuditLog)
|
const sqlQuery = (tx || db.replicaNode())(TableName.AuditLog)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable no-nested-ternary */
|
/* eslint-disable no-nested-ternary */
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { Controller, useForm, UseFormGetValues } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { faCaretDown, faCheckCircle, faFilterCircleXmark } from "@fortawesome/free-solid-svg-icons";
|
import { faCaretDown, faCheckCircle, faFilterCircleXmark } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
|
|||||||
@@ -1,41 +1,37 @@
|
|||||||
import { createFileRoute } from '@tanstack/react-router'
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
|
||||||
import { BreadcrumbTypes } from '@app/components/v2'
|
import { BreadcrumbTypes } from "@app/components/v2";
|
||||||
import { workspaceKeys } from '@app/hooks/api'
|
import { workspaceKeys } from "@app/hooks/api";
|
||||||
import {
|
import { fetchUserProjectPermissions, roleQueryKeys } from "@app/hooks/api/roles/queries";
|
||||||
fetchUserProjectPermissions,
|
import { fetchWorkspaceById } from "@app/hooks/api/workspace/queries";
|
||||||
roleQueryKeys,
|
import { ProjectLayout } from "@app/layouts/ProjectLayout";
|
||||||
} from '@app/hooks/api/roles/queries'
|
import { ProjectSelect } from "@app/layouts/ProjectLayout/components/ProjectSelect";
|
||||||
import { fetchWorkspaceById } from '@app/hooks/api/workspace/queries'
|
|
||||||
import { ProjectLayout } from '@app/layouts/ProjectLayout'
|
|
||||||
import { ProjectSelect } from '@app/layouts/ProjectLayout/components/ProjectSelect'
|
|
||||||
|
|
||||||
export const Route = createFileRoute(
|
export const Route = createFileRoute(
|
||||||
'/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout',
|
"/_authenticate/_inject-org-details/_org-layout/projects/$projectId/_project-layout"
|
||||||
)({
|
)({
|
||||||
component: ProjectLayout,
|
component: ProjectLayout,
|
||||||
beforeLoad: async ({ params, context }) => {
|
beforeLoad: async ({ params, context }) => {
|
||||||
const project = await context.queryClient.ensureQueryData({
|
const project = await context.queryClient.ensureQueryData({
|
||||||
queryKey: workspaceKeys.getWorkspaceById(params.projectId),
|
queryKey: workspaceKeys.getWorkspaceById(params.projectId),
|
||||||
queryFn: () => fetchWorkspaceById(params.projectId),
|
queryFn: () => fetchWorkspaceById(params.projectId)
|
||||||
})
|
});
|
||||||
|
|
||||||
await context.queryClient.ensureQueryData({
|
await context.queryClient.ensureQueryData({
|
||||||
queryKey: roleQueryKeys.getUserProjectPermissions({
|
queryKey: roleQueryKeys.getUserProjectPermissions({
|
||||||
workspaceId: params.projectId,
|
workspaceId: params.projectId
|
||||||
}),
|
}),
|
||||||
queryFn: () =>
|
queryFn: () => fetchUserProjectPermissions({ workspaceId: params.projectId })
|
||||||
fetchUserProjectPermissions({ workspaceId: params.projectId }),
|
});
|
||||||
})
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
project,
|
project,
|
||||||
breadcrumbs: [
|
breadcrumbs: [
|
||||||
{
|
{
|
||||||
type: BreadcrumbTypes.Component,
|
type: BreadcrumbTypes.Component,
|
||||||
component: ProjectSelect,
|
component: ProjectSelect
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
}
|
};
|
||||||
},
|
}
|
||||||
})
|
});
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { createFileRoute, redirect } from '@tanstack/react-router'
|
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||||
|
|
||||||
// this is done as part of migration for multi product inside project
|
// this is done as part of migration for multi product inside project
|
||||||
export const Route = createFileRoute(
|
export const Route = createFileRoute(
|
||||||
'/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/approval',
|
"/_authenticate/_inject-org-details/_org-layout/secret-manager/$projectId/approval"
|
||||||
)({
|
)({
|
||||||
beforeLoad: ({ params, search }) => {
|
beforeLoad: ({ params, search }) => {
|
||||||
throw redirect({
|
throw redirect({
|
||||||
to: '/projects/$projectId/secret-manager/approval',
|
to: "/projects/$projectId/secret-manager/approval",
|
||||||
params,
|
params,
|
||||||
search,
|
search
|
||||||
})
|
});
|
||||||
},
|
}
|
||||||
})
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user