mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-16 22:14:29 +00:00
✨ navigate to policy to edit
This commit is contained in:
@@ -733,6 +733,8 @@
|
|||||||
"resourceAuthMethods": "Authentication Methods",
|
"resourceAuthMethods": "Authentication Methods",
|
||||||
"resourcePolicyAuthMethodsEmpty": "No authentication method",
|
"resourcePolicyAuthMethodsEmpty": "No authentication method",
|
||||||
"resourcePolicyOtpEmpty": "No one time password",
|
"resourcePolicyOtpEmpty": "No one time password",
|
||||||
|
"resourcePolicyReadOnly": "This policy is Read only",
|
||||||
|
"resourcePolicyReadOnlyDescription": "This resource policy is shared accross multiple resources, you cannot edit it in this page. Please go to the policy settings to edit",
|
||||||
"resourcePolicyTypeSave": "Save Resource type",
|
"resourcePolicyTypeSave": "Save Resource type",
|
||||||
"resourcePolicySelect": "Select resource policy",
|
"resourcePolicySelect": "Select resource policy",
|
||||||
"resourcePolicyNotFound": "Policy not found",
|
"resourcePolicyNotFound": "Policy not found",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import ActionBanner from "@app/components/ActionBanner";
|
||||||
import { EditPolicyForm } from "@app/components/resource-policy/EditPolicyForm";
|
import { EditPolicyForm } from "@app/components/resource-policy/EditPolicyForm";
|
||||||
import {
|
import {
|
||||||
SettingsContainer,
|
SettingsContainer,
|
||||||
@@ -40,8 +41,9 @@ import { ResourcePolicyProvider } from "@app/providers/ResourcePolicyProvider";
|
|||||||
import { zodResolver } from "@hookform/resolvers/zod";
|
import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { CaretSortIcon } from "@radix-ui/react-icons";
|
import { CaretSortIcon } from "@radix-ui/react-icons";
|
||||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import { CheckIcon } from "lucide-react";
|
import { ArrowRightIcon, CheckIcon, ShieldAlertIcon } from "lucide-react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useEffect, useState, useTransition } from "react";
|
import { useEffect, useState, useTransition } from "react";
|
||||||
import { useForm, useWatch } from "react-hook-form";
|
import { useForm, useWatch } from "react-hook-form";
|
||||||
@@ -282,6 +284,30 @@ export default function ResourceAuthenticationPage() {
|
|||||||
policy={policies.sharedPolicy}
|
policy={policies.sharedPolicy}
|
||||||
key={policies.sharedPolicy.resourcePolicyId}
|
key={policies.sharedPolicy.resourcePolicyId}
|
||||||
>
|
>
|
||||||
|
<ActionBanner
|
||||||
|
variant="warning"
|
||||||
|
title={t("resourcePolicyReadOnly")}
|
||||||
|
titleIcon={
|
||||||
|
<ShieldAlertIcon className="w-5 h-5" />
|
||||||
|
}
|
||||||
|
description={t(
|
||||||
|
"resourcePolicyReadOnlyDescription"
|
||||||
|
)}
|
||||||
|
actions={
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
className="gap-2"
|
||||||
|
asChild
|
||||||
|
>
|
||||||
|
<Link
|
||||||
|
href={`/${org.org.orgId}/settings/policies/resource/${policies.sharedPolicy.niceId}`}
|
||||||
|
>
|
||||||
|
{t("edit")}
|
||||||
|
<ArrowRightIcon className="size-4" />
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
/>
|
||||||
<EditPolicyForm readonly />
|
<EditPolicyForm readonly />
|
||||||
</ResourcePolicyProvider>
|
</ResourcePolicyProvider>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user