|
| 1 | +import { EyeIcon } from "@heroicons/react/24/outline"; |
| 2 | +import { |
| 3 | + AdminPanelSettings, |
| 4 | + GppBad, |
| 5 | + HourglassBottom, |
| 6 | + LockReset, |
| 7 | + OpenInNew, |
| 8 | + PlayArrow, |
| 9 | +} from "@mui/icons-material"; |
| 10 | +import { Alert, Typography } from "@mui/material"; |
| 11 | + |
| 12 | +export const CippGdapActions = () => [ |
| 13 | + { |
| 14 | + label: "View Relationship", |
| 15 | + link: "/tenant/gdap-management/relationships/relationship?id=[id]", |
| 16 | + color: "primary", |
| 17 | + icon: <EyeIcon />, |
| 18 | + }, |
| 19 | + { |
| 20 | + label: "Start Onboarding", |
| 21 | + link: "/tenant/gdap-management/onboarding/start?id=[id]", |
| 22 | + color: "primary", |
| 23 | + icon: <PlayArrow />, |
| 24 | + showInActionsMenu: true, |
| 25 | + }, |
| 26 | + { |
| 27 | + label: "Open Relationship in Partner Center", |
| 28 | + link: "https://partner.microsoft.com/en-us/dashboard/commerce2/customers/[customer.tenantId]/adminrelationships/[id]", |
| 29 | + color: "info", |
| 30 | + icon: <OpenInNew />, |
| 31 | + showInActionsMenu: true, |
| 32 | + }, |
| 33 | + { |
| 34 | + label: "Enable automatic extension", |
| 35 | + type: "GET", |
| 36 | + url: "/api/ExecAutoExtendGDAP", |
| 37 | + data: { ID: "id" }, |
| 38 | + confirmText: "Are you sure you want to enable auto-extend for this relationship?", |
| 39 | + color: "info", |
| 40 | + icon: <HourglassBottom />, |
| 41 | + }, |
| 42 | + { |
| 43 | + label: "Remove Global Administrator from Relationship", |
| 44 | + type: "GET", |
| 45 | + url: "/api/ExecGDAPRemoveGArole", |
| 46 | + data: { GDAPID: "id" }, |
| 47 | + confirmText: "Are you sure you want to remove Global Administrator from this relationship?", |
| 48 | + color: "danger", |
| 49 | + icon: <AdminPanelSettings />, |
| 50 | + }, |
| 51 | + { |
| 52 | + label: "Reset Group Mappings", |
| 53 | + type: "POST", |
| 54 | + url: "/api/ExecGDAPAccessAssignment", |
| 55 | + icon: <LockReset />, |
| 56 | + data: { Id: "id", Action: "ResetMappings" }, |
| 57 | + fields: [ |
| 58 | + { |
| 59 | + name: "RoleTemplateId", |
| 60 | + label: "Role Template", |
| 61 | + placeholder: "Select a role template to apply to this relationship.", |
| 62 | + type: "select", |
| 63 | + api: { |
| 64 | + url: "/api/ExecGDAPRoleTemplate", |
| 65 | + queryKey: "GDAPRoleTemplate", |
| 66 | + dataKey: "Results", |
| 67 | + valueField: "TemplateId", |
| 68 | + labelField: "TemplateId", |
| 69 | + showRefresh: true, |
| 70 | + }, |
| 71 | + }, |
| 72 | + ], |
| 73 | + confirmText: ( |
| 74 | + <> |
| 75 | + <Typography variant="body1"> |
| 76 | + Are you sure you want to reset the group mappings for this relationship? |
| 77 | + </Typography> |
| 78 | + <Alert severity="warning"> |
| 79 | + This action will remove all existing group mappings and apply the selected role template |
| 80 | + to the relationship. Use this to fix incorrect group mappings or permission overlap issues |
| 81 | + (e.g removing AdminAgents or HelpdeskAgents). |
| 82 | + </Alert> |
| 83 | + </> |
| 84 | + ), |
| 85 | + }, |
| 86 | + { |
| 87 | + label: "Terminate Relationship", |
| 88 | + type: "GET", |
| 89 | + url: "/api/ExecDeleteGDAPRelationship", |
| 90 | + data: { GDAPID: "id" }, |
| 91 | + confirmText: "Are you sure you want to terminate this relationship?", |
| 92 | + color: "error", |
| 93 | + icon: <GppBad />, |
| 94 | + }, |
| 95 | +]; |
| 96 | + |
| 97 | +export default CippGdapActions; |
0 commit comments