Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
+3
-30
@@ -17,8 +17,6 @@ import EventsService from "~/modules/events/services/.server/EventsService";
|
||||
import { getUser } from "~/utils/db/users.db.server";
|
||||
import { getUserInfo, validateCSRFToken } from "~/utils/session.server";
|
||||
import { getActiveTenantSubscriptions } from "~/utils/services/.server/subscriptionService";
|
||||
import { RowsApi } from "~/utils/api/.server/RowsApi";
|
||||
import { findEntityByName, type EntityWithDetails } from "~/utils/db/entities/entities.db.server";
|
||||
import { storeFile } from "~/utils/integrations/storageService";
|
||||
import { auditRejectedUpload } from "~/utils/integrations/storageAudit.server";
|
||||
import { getTenantTypeOptions } from "~/utils/db/tenants/tenantTypes.db.server";
|
||||
@@ -29,12 +27,11 @@ import { AccountDeletedDto } from "~/modules/events/dtos/AccountDeletedDto";
|
||||
import toast from "react-hot-toast";
|
||||
import { appPath } from "~/utils/app/CanonicalUrlUtils";
|
||||
import { useRootData } from "~/utils/data/useRootData";
|
||||
import { loadRequiredWebConfig } from "@toolctrl/config";
|
||||
import { loadRequiredWebConfig } from "@hivegrid/config";
|
||||
import { absoluteAppRootPath } from "~/utils/app/CrossHostUrls";
|
||||
|
||||
type LoaderData = {
|
||||
title: string;
|
||||
tenantSettingsEntity: EntityWithDetails | null;
|
||||
tenant: TenantWithDetails;
|
||||
tenantTypes: Awaited<ReturnType<typeof getTenantTypeOptions>>;
|
||||
};
|
||||
@@ -43,17 +40,12 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
|
||||
const tenantId = await getTenantIdFromUrl(params);
|
||||
await verifyUserHasPermission(request, "app.settings.account.view", tenantId);
|
||||
const { t } = await getTranslations(request);
|
||||
const [tenantSettingsEntity, tenant, tenantTypes] = await Promise.all([
|
||||
findEntityByName({ tenantId, name: "tenantSettings" }),
|
||||
getTenant(tenantId),
|
||||
getTenantTypeOptions(),
|
||||
]);
|
||||
const [tenant, tenantTypes] = await Promise.all([getTenant(tenantId), getTenantTypeOptions()]);
|
||||
if (!tenant) {
|
||||
throw Error(t("shared.notFound"));
|
||||
}
|
||||
const data: LoaderData = {
|
||||
title: `${t("models.tenant.object")} | ${process.env.APP_NAME}`,
|
||||
tenantSettingsEntity,
|
||||
tenant,
|
||||
tenantTypes,
|
||||
};
|
||||
@@ -113,24 +105,6 @@ export const action: ActionFunction = async ({ request, params }) => {
|
||||
}
|
||||
await createLog(request, tenantId, "settings.tenant.updateDetails", JSON.stringify({ name, slug }));
|
||||
|
||||
const tenantSettingsEntity = await findEntityByName({ tenantId, name: "tenantSettings" });
|
||||
if (tenantSettingsEntity) {
|
||||
try {
|
||||
await RowsApi.createCustom({
|
||||
entity: tenantSettingsEntity,
|
||||
tenantId,
|
||||
t,
|
||||
form,
|
||||
row: existing?.tenantSettingsRow?.row as Parameters<typeof RowsApi.createCustom>[0]["row"],
|
||||
rowCreateInput: { tenantSettingsRow: { create: { tenantId } } },
|
||||
request,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return badRequest({ updateDetailsError: t("shared.unexpectedError") });
|
||||
}
|
||||
}
|
||||
|
||||
if (existing?.slug !== slug) {
|
||||
const existingSlug = await getTenantBySlug(slug);
|
||||
if (existingSlug) {
|
||||
@@ -252,7 +226,6 @@ export default function TenantRoute() {
|
||||
<UpdateTenantDetailsForm
|
||||
disabled={!getUserHasPermission(appData, "app.settings.account.update")}
|
||||
tenant={data.tenant}
|
||||
tenantSettingsEntity={data.tenantSettingsEntity}
|
||||
tenantTypes={data.tenantTypes}
|
||||
options={{
|
||||
canChangeType: false,
|
||||
@@ -268,7 +241,7 @@ export default function TenantRoute() {
|
||||
</div>
|
||||
|
||||
{/*Danger */}
|
||||
<SettingSection title={t("settings.danger.title")} description={t("settings.danger.description")}>
|
||||
<SettingSection title={t("settings.danger.title")} description={t("settings.danger.description")} tone="danger">
|
||||
<div className="mt-12 md:col-span-2 md:mt-0">
|
||||
<div>
|
||||
<input hidden type="text" name="action" value="deleteAccount" readOnly />
|
||||
|
||||
Reference in new issue
Block a user