Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5dec7da

Browse files
committed
chore: remove per-org audit links
For now at least, we will have the one audit page at /audit which letsyou filter by organization.This also removes the need to do per-org audit permission checks.
1 parent475f6e2 commit5dec7da

File tree

6 files changed

+11
-60
lines changed

6 files changed

+11
-60
lines changed

‎site/src/api/queries/organizations.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ export const organizationsPermissions = (
179179
queryKey:["organizations","permissions"],
180180
queryFn:async()=>{
181181
// Only request what we need for the sidebar, which is one edit permission
182-
// per sub-link (audit page,settings page, groups page, and members page)
183-
//that tells us whetherto show that page, since we only show them if you
184-
//can edit(and not, at the moment if you can only view).
182+
// per sub-link (settings page, groups page, and members page) that tells
183+
//uswhetherto show that page, since we only show them if you can edit
184+
// (and not, at the moment if you can only view).
185185
constchecks=(organizationId:string)=>({
186186
editMembers:{
187187
object:{
@@ -204,13 +204,6 @@ export const organizationsPermissions = (
204204
},
205205
action:"update",
206206
},
207-
auditOrganization:{
208-
object:{
209-
resource_type:"audit_log",
210-
organization_id:organizationId,
211-
},
212-
action:"read",
213-
},
214207
});
215208

216209
// The endpoint takes a flat array, so to avoid collisions prepend each

‎site/src/modules/dashboard/Navbar/DeploymentDropdown.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,7 @@ const DeploymentDropdownContent: FC<DeploymentDropdownProps> = ({
124124
{canViewAuditLog&&(
125125
<MenuItem
126126
component={NavLink}
127-
to={
128-
canViewOrganizations
129-
?`/deployment${linkToAuditing}`
130-
:linkToAuditing
131-
}
127+
to={linkToAuditing}
132128
css={styles.menuItem}
133129
onClick={onPopoverClose}
134130
>

‎site/src/pages/AuditPage/AuditPage.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
importtype{FC}from"react";
22
import{Helmet}from"react-helmet-async";
3-
import{useSearchParams,Navigate,useLocation}from"react-router-dom";
3+
import{useSearchParams}from"react-router-dom";
44
import{paginatedAudits}from"api/queries/audits";
55
import{useFilter}from"components/Filter/filter";
66
import{useUserFilterMenu}from"components/Filter/UserFilter";
@@ -19,7 +19,6 @@ import { AuditPageView } from "./AuditPageView";
1919
constAuditPage:FC=()=>{
2020
constfeats=useFeatureVisibility();
2121
const{ experiments}=useDashboard();
22-
constlocation=useLocation();
2322

2423
/**
2524
* There is an implicit link between auditsQuery and filter via the
@@ -71,14 +70,9 @@ const AuditPage: FC = () => {
7170
}),
7271
});
7372

74-
// TODO: Once multi-org is stable, we should place this redirect into the
75-
// router directly, if we still need to maintain it (for users who are
76-
// typing the old URL manually or have it bookmarked).
77-
constcanViewOrganizations=
78-
feats.multiple_organizations&&experiments.includes("multi-organization");
79-
if(canViewOrganizations&&location.pathname!=="/deployment/audit"){
80-
return<Navigateto={`/deployment/audit${location.search}`}replace/>;
81-
}
73+
// With the multi-organization experiment enabled, show extra organization
74+
// info and the organization filter dropdon.
75+
constcanViewOrganizations=experiments.includes("multi-organization");
8276

8377
return(
8478
<>

‎site/src/pages/AuditPage/AuditPageView.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,8 @@ export const AuditPageView: FC<AuditPageViewProps> = ({
5757
constisEmpty=!isLoading&&auditLogs?.length===0;
5858

5959
return(
60-
<Margins
61-
css={{
62-
// When acting as a deployment settings page, there is already padding.
63-
// TODO: When multi-org is stable we should move this to the deployment
64-
// settings dir, use the standard header, and remove these margins.
65-
padding:showOrgDetails ?0 :undefined,
66-
}}
67-
>
68-
<PageHeader
69-
css={{
70-
// When acting as a deployment settings page, there is already padding.
71-
paddingTop:showOrgDetails ?0 :undefined,
72-
}}
73-
>
60+
<Margins>
61+
<PageHeader>
7462
<PageHeaderTitle>
7563
<Stackdirection="row"spacing={1}alignItems="center">
7664
<span>{Language.title}</span>

‎site/src/pages/ManagementSettingsPage/SidebarView.tsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Sidebar as BaseSidebar } from "components/Sidebar/Sidebar";
1010
import{Stack}from"components/Stack/Stack";
1111
import{UserAvatar}from"components/UserAvatar/UserAvatar";
1212
import{typeClassName,useClassName}from"hooks/useClassName";
13-
import{linkToAuditing,linkToUsers,withFilter}from"modules/navigation";
13+
import{linkToUsers}from"modules/navigation";
1414

1515
interfaceSidebarProps{
1616
/** True if a settings page is being viewed. */
@@ -118,11 +118,6 @@ const DeploymentSettingsNavigation: FC<DeploymentSettingsNavigationProps> = (
118118
Users
119119
</SidebarNavSubItem>
120120
)}
121-
{props.permissions.viewAnyAuditLog&&(
122-
<SidebarNavSubItemhref={linkToAuditing.slice(1)}>
123-
Auditing
124-
</SidebarNavSubItem>
125-
)}
126121
</Stack>
127122
)}
128123
</div>
@@ -248,19 +243,6 @@ const OrganizationSettingsNavigation: FC<
248243
Groups
249244
</SidebarNavSubItem>
250245
)}
251-
{/* For now redirect to the site-wide audit page with the organization
252-
pre-filled into the filter. Based on user feedback we might want
253-
to serve a copy of the audit page or even delete this link. */}
254-
{props.permissions.auditOrganization&&(
255-
<SidebarNavSubItem
256-
href={`/deployment${withFilter(
257-
linkToAuditing,
258-
`organization:${props.organization.name}`,
259-
)}`}
260-
>
261-
Auditing
262-
</SidebarNavSubItem>
263-
)}
264246
</Stack>
265247
)}
266248
</>

‎site/src/router.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ export const router = createBrowserRouter(
376376
<Routeindexelement={<OrganizationSettingsPage/>}/>
377377
<Routepath="members"element={<OrganizationMembersPage/>}/>
378378
{groupsRouter()}
379-
<Routepath="auditing"element={<></>}/>
380379
</Route>
381380
</Route>
382381

@@ -410,7 +409,6 @@ export const router = createBrowserRouter(
410409
<Routepath="users"element={<UsersPage/>}/>
411410
<Routepath="users/create"element={<CreateUserPage/>}/>
412411
{groupsRouter()}
413-
<Routepath="audit"element={<AuditPage/>}/>
414412
</Route>
415413

416414
<Routepath="/settings"element={<UserSettingsLayout/>}>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp