mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-06 00:09:22 +00:00
fix: added org identifiers (#9735)
### **PR Type**
Enhancement
___
### **Description**
- Add org_identifier in group edit queries
- Include org_identifier on group cancel redirect
- Add org_identifier in role edit & cancel
- Attach org_identifier to report creation navigation
___
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>AppGroups.vue</strong><dd><code>Include org_identifier
in editGroup navigation</code>
</dd></summary>
<hr>
web/src/components/iam/groups/AppGroups.vue
- Included org_identifier in editGroup navigation
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9735/files#diff-402fb2a5338e60fdc3da489f4d50b5cf52f06b4e884a6fe7b82441c9fa5ea22c">+3/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>EditGroup.vue</strong><dd><code>Include org_identifier
in group cancel redirect</code>
</dd></summary>
<hr>
web/src/components/iam/groups/EditGroup.vue
- Added org_identifier in cancelEditGroup redirect
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9735/files#diff-6be040722d1492644adbf65250d44d28be37614d34600a73f74c816138727a40">+8/-1</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>AppRoles.vue</strong><dd><code>Add org_identifier to
editRole navigation</code>
</dd></summary>
<hr>
web/src/components/iam/roles/AppRoles.vue
- Included org_identifier in editRole navigation
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9735/files#diff-191634ef09436199f91f442968110a01f54ae46b5ceee67476f52613ad796db4">+3/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>EditRole.vue</strong><dd><code>Include org_identifier
in permissions cancel redirect</code>
</dd></summary>
<hr>
web/src/components/iam/roles/EditRole.vue
- Added org_identifier in cancelPermissionsUpdate redirect
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9735/files#diff-263b6bc7d29fdf8358c8437cd637f1350aa3733cc2706eae8ff00028686cc0f5">+7/-1</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>ReportList.vue</strong><dd><code>Add org_identifier to
report creation navigation</code>
</dd></summary>
<hr>
web/src/components/reports/ReportList.vue
- Appended org_identifier to createNewReport navigation
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9735/files#diff-f7d700f7e67fbaba3c58ab5d2c614925db743101828214445ce9dae35dc29067">+1/-1</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___
This commit is contained in:
@@ -256,14 +256,17 @@ describe("AppGroups Component", () => {
|
||||
it("navigates to edit page when edit icon is clicked", async () => {
|
||||
const routerPushSpy = vi.spyOn(router, "push").mockResolvedValue(undefined as any);
|
||||
const testGroup = { group_name: "test-group" };
|
||||
|
||||
|
||||
await wrapper.vm.editGroup(testGroup);
|
||||
|
||||
|
||||
expect(routerPushSpy).toHaveBeenCalledWith({
|
||||
name: "editGroup",
|
||||
params: {
|
||||
group_name: "test-group",
|
||||
},
|
||||
query: {
|
||||
org_identifier: store.state.selectedOrganization.identifier,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -215,6 +215,9 @@ const editGroup = (group: any) => {
|
||||
params: {
|
||||
group_name: group.group_name,
|
||||
},
|
||||
query: {
|
||||
org_identifier: store.state.selectedOrganization.identifier,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -431,10 +431,15 @@ describe("EditGroup Component", () => {
|
||||
describe("Navigation", () => {
|
||||
it("navigates back to groups page when cancel is clicked", async () => {
|
||||
const routerPushSpy = vi.spyOn(router, "push").mockResolvedValue(undefined as any);
|
||||
|
||||
|
||||
await wrapper.vm.cancelEditGroup();
|
||||
|
||||
expect(routerPushSpy).toHaveBeenCalledWith({ name: "groups" });
|
||||
|
||||
expect(routerPushSpy).toHaveBeenCalledWith({
|
||||
name: "groups",
|
||||
query: {
|
||||
org_identifier: store.state.selectedOrganization.identifier
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("triggers navigation when cancel button is clicked", async () => {
|
||||
|
||||
@@ -241,7 +241,14 @@ const saveGroupChanges = () => {
|
||||
};
|
||||
|
||||
const cancelEditGroup = () => {
|
||||
router.push({ name: "groups" });
|
||||
router.push(
|
||||
{ name: "groups",
|
||||
query:
|
||||
{
|
||||
org_identifier: store.state.selectedOrganization.identifier
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -214,6 +214,9 @@ const editRole = (role: any) => {
|
||||
params: {
|
||||
role_name: role.role_name,
|
||||
},
|
||||
query:{
|
||||
org_identifier: store.state.selectedOrganization.identifier
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -314,7 +314,12 @@ describe('EditRole - save and cancel', () => {
|
||||
const wrapper = await mountEditRole();
|
||||
const spy = vi.spyOn(router, 'push');
|
||||
await wrapper.vm.cancelPermissionsUpdate();
|
||||
expect(spy).toHaveBeenCalledWith({ name: 'roles' });
|
||||
expect(spy).toHaveBeenCalledWith({
|
||||
name: 'roles',
|
||||
query: {
|
||||
org_identifier: store.state.selectedOrganization.identifier
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('saveRole notifies info when no changes', async () => {
|
||||
|
||||
@@ -830,7 +830,13 @@ const decodePermission = (permission: string) => {
|
||||
};
|
||||
|
||||
const cancelPermissionsUpdate = () => {
|
||||
router.push({ name: "roles" });
|
||||
router.push(
|
||||
{ name: "roles",
|
||||
query: {
|
||||
org_identifier: store.state.selectedOrganization.identifier,
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const handlePermissionChange = (row: any, permission: string) => {
|
||||
|
||||
@@ -670,7 +670,10 @@ describe("ReportList Component", () => {
|
||||
await addButton.trigger('click');
|
||||
|
||||
expect(mockRouter.push).toHaveBeenCalledWith({
|
||||
name: "createReport"
|
||||
name: "createReport",
|
||||
query: {
|
||||
org_identifier: store.state.selectedOrganization.identifier
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -500,7 +500,7 @@ const createNewReport = () => {
|
||||
button: "Add Report",
|
||||
page: "Reports"
|
||||
});
|
||||
router.push({ name: "createReport" });
|
||||
router.push({ name: "createReport", query: { org_identifier: store.state.selectedOrganization.identifier } });
|
||||
};
|
||||
|
||||
const filterReports = () => {
|
||||
|
||||
Reference in New Issue
Block a user