diff --git a/frontend/eda/access/common/EdaRolesWizardSteps/EdaSelectResourcesStep.tsx b/frontend/eda/access/common/EdaRolesWizardSteps/EdaSelectResourcesStep.tsx index b04fbe8c72..5ef8720297 100644 --- a/frontend/eda/access/common/EdaRolesWizardSteps/EdaSelectResourcesStep.tsx +++ b/frontend/eda/access/common/EdaRolesWizardSteps/EdaSelectResourcesStep.tsx @@ -15,6 +15,7 @@ import { EdaCredentialType } from '../../../interfaces/EdaCredentialType'; import { useEdaMultiSelectListView } from '../../../common/useEdaMultiSelectListView'; import { edaAPI } from '../../../common/eda-utils'; import styled from 'styled-components'; +import { EdaEventStream } from '../../../interfaces/EdaEventStream'; export type EdaResourceType = | EdaActivationInstance @@ -24,7 +25,8 @@ export type EdaResourceType = | EdaRulebookActivation | EdaRuleAudit | EdaProject - | EdaCredentialType; + | EdaCredentialType + | EdaEventStream; const resourceToEndpointMapping: { [key: string]: string } = { 'eda.edacredential': edaAPI`/eda-credentials/`, @@ -35,6 +37,7 @@ const resourceToEndpointMapping: { [key: string]: string } = { 'eda.credentialtype': edaAPI`/credential-types/`, 'eda.decisionenvironment': edaAPI`/decision-environments/`, 'eda.auditrule': edaAPI`/audit-rules/`, + 'eda.eventstream': edaAPI`/event-streams/`, }; const StyledTitle = styled(Title)` @@ -57,6 +60,7 @@ export function EdaSelectResourcesStep() { 'eda.credentialtype': t('Select credential types'), 'eda.decisionenvironment': t('Select decision environments'), 'eda.auditrule': t('Select audit rules'), + 'eda.eventstream': t('Select event stream'), }; }, [t]); const tableColumns = useMemo[]>( diff --git a/frontend/eda/access/roles/hooks/useEdaRoleMetadata.tsx b/frontend/eda/access/roles/hooks/useEdaRoleMetadata.tsx index c650ea66d7..5487d64808 100644 --- a/frontend/eda/access/roles/hooks/useEdaRoleMetadata.tsx +++ b/frontend/eda/access/roles/hooks/useEdaRoleMetadata.tsx @@ -130,6 +130,10 @@ export function useEdaRoleMetadata(): EdaRoleMetadata { 'shared.change_team': t('Change team'), 'shared.delete_team': t('Delete team'), 'shared.view_team': t('View team'), + 'eda.add_eventstream': t('Add event stream'), + 'eda.change_eventstream': t('Change event stream'), + 'eda.delete_eventstream': t('Delete event stream'), + 'eda.view_eventstream': t('View event stream'), }, }, 'eda.project': { diff --git a/frontend/eda/event-streams/EventStreamPage/EventStreamPage.tsx b/frontend/eda/event-streams/EventStreamPage/EventStreamPage.tsx index bbaa491060..bd3e4ab9f4 100644 --- a/frontend/eda/event-streams/EventStreamPage/EventStreamPage.tsx +++ b/frontend/eda/event-streams/EventStreamPage/EventStreamPage.tsx @@ -132,6 +132,8 @@ export function EventStreamPage() { tabs={[ { label: t('Details'), page: EdaRoute.EventStreamDetails }, { label: t('Activations'), page: EdaRoute.EventStreamActivations }, + { label: t('Team Access'), page: EdaRoute.EventStreamTeamAccess }, + { label: t('User Access'), page: EdaRoute.EventStreamUserAccess }, ]} params={{ id: eventStream?.id }} /> diff --git a/frontend/eda/event-streams/EventStreamPage/EventStreamTeamAccess.tsx b/frontend/eda/event-streams/EventStreamPage/EventStreamTeamAccess.tsx new file mode 100644 index 0000000000..53bda1620e --- /dev/null +++ b/frontend/eda/event-streams/EventStreamPage/EventStreamTeamAccess.tsx @@ -0,0 +1,15 @@ +import { useParams } from 'react-router-dom'; +import { EdaRoute } from '../../main/EdaRoutes'; +import { TeamAccess } from '../../../common/access/components/TeamAccess'; + +export function EventStreamTeamAccess() { + const params = useParams<{ id: string }>(); + return ( + + ); +} diff --git a/frontend/eda/event-streams/EventStreamPage/EventStreamUserAccess.tsx b/frontend/eda/event-streams/EventStreamPage/EventStreamUserAccess.tsx new file mode 100644 index 0000000000..85ffc5422d --- /dev/null +++ b/frontend/eda/event-streams/EventStreamPage/EventStreamUserAccess.tsx @@ -0,0 +1,15 @@ +import { useParams } from 'react-router-dom'; +import { EdaRoute } from '../../main/EdaRoutes'; +import { UserAccess } from '../../../common/access/components/UserAccess'; + +export function EventStreamUserAccess() { + const params = useParams<{ id: string }>(); + return ( + + ); +} diff --git a/frontend/eda/event-streams/components/EdaEventStreamAddTeams.cy.tsx b/frontend/eda/event-streams/components/EdaEventStreamAddTeams.cy.tsx new file mode 100644 index 0000000000..0f9b44b4ed --- /dev/null +++ b/frontend/eda/event-streams/components/EdaEventStreamAddTeams.cy.tsx @@ -0,0 +1,91 @@ +import { edaAPI } from '../../common/eda-utils'; +import { EdaEventStreamAddTeams } from './EdaEventStreamAddTeams'; + +describe('EdaEventStreamAddTeams', () => { + const component = ; + const path = '/event-streams/:id/team-access/add-teams'; + const initialEntries = [`/event-streams/1/team-access/add-teams`]; + const params = { + path, + initialEntries, + }; + + beforeEach(() => { + cy.intercept('GET', edaAPI`/event-streams/*`, { fixture: 'edaEventStream.json' }); + cy.intercept('GET', edaAPI`/teams/?order_by=name*`, { fixture: 'edaTeams.json' }); + cy.intercept('GET', edaAPI`/role_definitions/?content_type__model=event-stream*`, { + fixture: 'edaEventStreamRoles.json', + }); + cy.mount(component, params); + }); + it('should render with correct steps', () => { + cy.get('[data-cy="wizard-nav"] li').eq(0).should('contain.text', 'Select team(s)'); + cy.get('[data-cy="wizard-nav"] li').eq(1).should('contain.text', 'Select roles to apply'); + cy.get('[data-cy="wizard-nav"] li').eq(2).should('contain.text', 'Review'); + cy.get('[data-cy="wizard-nav-item-teams"] button').should('have.class', 'pf-m-current'); + cy.get('table tbody').find('tr').should('have.length', 4); + }); + it('can filter teams by name', () => { + cy.intercept(edaAPI`/teams/?name=Gal*`, { fixtures: 'edaTeams.json' }).as('nameFilterRequest'); + cy.filterTableByText('Gal'); + cy.wait('@nameFilterRequest'); + cy.clearAllFilters(); + }); + it('should validate that at least one team is selected for moving to next step', () => { + cy.get('table tbody').find('tr').should('have.length', 4); + cy.clickButton(/^Next$/); + cy.get('.pf-v5-c-alert__title').should('contain.text', 'Select at least one team.'); + cy.selectTableRowByCheckbox('name', 'Demo', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.get('[data-cy="wizard-nav-item-teams"] button').should('not.have.class', 'pf-m-current'); + cy.get('[data-cy="wizard-nav-item-roles"] button').should('have.class', 'pf-m-current'); + }); + it('should validate that at least one role is selected for moving to Review step', () => { + cy.selectTableRowByCheckbox('name', 'Demo', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.get('[data-cy="wizard-nav-item-roles"] button').should('have.class', 'pf-m-current'); + cy.clickButton(/^Next$/); + cy.get('.pf-v5-c-alert__title').should('contain.text', 'Select at least one role.'); + cy.selectTableRowByCheckbox('name', 'EventStream Admin', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.get('[data-cy="wizard-nav-item-roles"] button').should('not.have.class', 'pf-m-current'); + cy.get('[data-cy="wizard-nav-item-review"] button').should('have.class', 'pf-m-current'); + }); + it('should display selected team and role in the Review step', () => { + cy.selectTableRowByCheckbox('name', 'Demo', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.selectTableRowByCheckbox('name', 'EventStream Admin', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.get('[data-cy="wizard-nav-item-review"] button').should('have.class', 'pf-m-current'); + cy.get('[data-cy="expandable-section-teams"]').should('contain.text', 'Teams'); + cy.get('[data-cy="expandable-section-teams"]').should('contain.text', '1'); + cy.get('[data-cy="expandable-section-teams"]').should('contain.text', 'Demo'); + cy.get('[data-cy="expandable-section-edaRoles"]').should('contain.text', 'Roles'); + cy.get('[data-cy="expandable-section-edaRoles"]').should('contain.text', '1'); + cy.get('[data-cy="expandable-section-edaRoles"]').should('contain.text', 'EventStream Admin'); + cy.get('[data-cy="expandable-section-edaRoles"]').should( + 'contain.text', + 'Has all permissions to a single event-stream and its child resources - rulebook' + ); + }); + it('should trigger bulk action dialog on submit', () => { + cy.intercept('POST', edaAPI`/role_team_assignments/`, { + statusCode: 201, + body: { team: 3, role_definition: 14, content_type: 'eda.event-stream', object_id: 1 }, + }).as('createRoleAssignment'); + cy.selectTableRowByCheckbox('name', 'Demo', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.selectTableRowByCheckbox('name', 'EventStream Admin', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.clickButton(/^Finish$/); + cy.wait('@createRoleAssignment'); + // Bulk action modal is displayed with success + cy.get('.pf-v5-c-modal-box').within(() => { + cy.get('table tbody').find('tr').should('have.length', 1); + cy.get('table tbody').should('contain.text', 'Demo'); + cy.get('table tbody').should('contain.text', 'EventStream Admin'); + cy.get('div.pf-v5-c-progress__description').should('contain.text', 'Success'); + cy.get('div.pf-v5-c-progress__status').should('contain.text', '100%'); + }); + }); +}); diff --git a/frontend/eda/event-streams/components/EdaEventStreamAddTeams.tsx b/frontend/eda/event-streams/components/EdaEventStreamAddTeams.tsx new file mode 100644 index 0000000000..62e198281c --- /dev/null +++ b/frontend/eda/event-streams/components/EdaEventStreamAddTeams.tsx @@ -0,0 +1,158 @@ +import { useTranslation } from 'react-i18next'; +import { useParams } from 'react-router-dom'; +import { + LoadingPage, + PageHeader, + PageLayout, + PageWizard, + PageWizardStep, + useGetPageUrl, + usePageNavigate, +} from '../../../../framework'; +import { RoleAssignmentsReviewStep } from '../../../common/access/RolesWizard/steps/RoleAssignmentsReviewStep'; +import { postRequest } from '../../../common/crud/Data'; +import { useGet } from '../../../common/crud/useGet'; +import { EdaSelectRolesStep } from '../../access/common/EdaRolesWizardSteps/EdaSelectRolesStep'; +import { EdaSelectTeamsStep } from '../../access/common/EdaRolesWizardSteps/EdaSelectTeamsStep'; +import { edaAPI } from '../../common/eda-utils'; +import { edaErrorAdapter } from '../../common/edaErrorAdapter'; +import { useEdaBulkActionDialog } from '../../common/useEdaBulkActionDialog'; +import { EdaEventStream } from '../../interfaces/EdaEventStream'; +import { EdaRbacRole } from '../../interfaces/EdaRbacRole'; +import { EdaTeam } from '../../interfaces/EdaTeam'; +import { EdaRoute } from '../../main/EdaRoutes'; + +interface WizardFormValues { + teams: EdaTeam[]; + edaRoles: EdaRbacRole[]; +} + +interface TeamRolePair { + team: EdaTeam; + role: EdaRbacRole; +} + +export function EdaEventStreamAddTeams() { + const { t } = useTranslation(); + const getPageUrl = useGetPageUrl(); + const params = useParams<{ id: string }>(); + const pageNavigate = usePageNavigate(); + const { data: eventstream, isLoading } = useGet( + edaAPI`/event-streams/${params.id ?? ''}/` + ); + const teamRoleProgressDialog = useEdaBulkActionDialog(); + + if (isLoading || !eventstream) return ; + + const steps: PageWizardStep[] = [ + { + id: 'teams', + label: t('Select team(s)'), + inputs: ( + + ), + validate: (formData, _) => { + const { teams } = formData as { teams: EdaTeam[] }; + if (!teams?.length) { + throw new Error(t('Select at least one team.')); + } + }, + }, + { + id: 'roles', + label: t('Select roles to apply'), + inputs: ( + + ), + validate: (formData, _) => { + const { edaRoles } = formData as { edaRoles: EdaRbacRole[] }; + if (!edaRoles?.length) { + throw new Error(t('Select at least one role.')); + } + }, + }, + { + id: 'review', + label: t('Review'), + inputs: , + }, + ]; + + const onSubmit = async (data: WizardFormValues) => { + const { teams, edaRoles } = data; + const items: TeamRolePair[] = []; + for (const team of teams) { + for (const role of edaRoles) { + items.push({ team, role }); + } + } + return new Promise((resolve) => { + teamRoleProgressDialog({ + title: t('Add roles'), + keyFn: ({ team, role }) => `${team.id}_${role.id}`, + items, + actionColumns: [ + { header: t('Team'), cell: ({ team }) => team.name }, + { header: t('Role'), cell: ({ role }) => role.name }, + ], + actionFn: ({ team, role }) => + postRequest(edaAPI`/role_team_assignments/`, { + team: team.id, + role_definition: role.id, + content_type: 'eda.eventstream', + object_id: eventstream.id, + }), + onComplete: () => { + resolve(); + }, + onClose: () => { + pageNavigate(EdaRoute.EventStreamTeamAccess, { + params: { id: eventstream.id.toString() }, + }); + }, + }); + }); + }; + + return ( + + + + errorAdapter={edaErrorAdapter} + steps={steps} + onSubmit={onSubmit} + disableGrid + onCancel={() => { + pageNavigate(EdaRoute.EventStreamTeamAccess, { params: { id: eventstream?.id } }); + }} + /> + + ); +} diff --git a/frontend/eda/event-streams/components/EdaEventStreamAddUsers.cy.tsx b/frontend/eda/event-streams/components/EdaEventStreamAddUsers.cy.tsx new file mode 100644 index 0000000000..e989471330 --- /dev/null +++ b/frontend/eda/event-streams/components/EdaEventStreamAddUsers.cy.tsx @@ -0,0 +1,93 @@ +import { edaAPI } from '../../common/eda-utils'; +import { EdaEventStreamAddUsers } from './EdaEventStreamAddUsers'; + +describe('EdaEventStreamAddUsers', () => { + const component = ; + const path = '/event-streams/:id/user-access/add-users'; + const initialEntries = [`/event-streams/1/user-access/add-users`]; + const params = { + path, + initialEntries, + }; + + beforeEach(() => { + cy.intercept('GET', edaAPI`/event-streams/*`, { fixture: 'edaEventStream.json' }); + cy.intercept('GET', edaAPI`/users/*`, { fixture: 'edaNormalUsers.json' }); + cy.intercept('GET', edaAPI`/role_definitions/?content_type__model=event-stream*`, { + fixture: 'edaEventStreamRoles.json', + }); + cy.mount(component, params); + }); + it('should render with correct steps', () => { + cy.get('[data-cy="wizard-nav"] li').eq(0).should('contain.text', 'Select user(s)'); + cy.get('[data-cy="wizard-nav"] li').eq(1).should('contain.text', 'Select roles to apply'); + cy.get('[data-cy="wizard-nav"] li').eq(2).should('contain.text', 'Review'); + cy.get('[data-cy="wizard-nav-item-users"] button').should('have.class', 'pf-m-current'); + cy.get('table tbody').find('tr').should('have.length', 2); + }); + it('can filter users by username', () => { + cy.intercept(edaAPI`/users/?is_superuser=false&name=demo*`, { + fixture: 'edaNormalUsers.json', + }).as('nameFilterRequest'); + cy.filterTableByText('demo'); + cy.wait('@nameFilterRequest'); + cy.clearAllFilters(); + }); + it('should validate that at least one user is selected for moving to next step', () => { + cy.get('table tbody').find('tr').should('have.length', 2); + cy.clickButton(/^Next$/); + cy.get('.pf-v5-c-alert__title').should('contain.text', 'Select at least one user.'); + cy.selectTableRowByCheckbox('username', 'demo-user', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.get('[data-cy="wizard-nav-item-users"] button').should('not.have.class', 'pf-m-current'); + cy.get('[data-cy="wizard-nav-item-roles"] button').should('have.class', 'pf-m-current'); + }); + it('should validate that at least one role is selected for moving to Review step', () => { + cy.selectTableRowByCheckbox('username', 'demo-user', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.get('[data-cy="wizard-nav-item-roles"] button').should('have.class', 'pf-m-current'); + cy.clickButton(/^Next$/); + cy.get('.pf-v5-c-alert__title').should('contain.text', 'Select at least one role.'); + cy.selectTableRowByCheckbox('name', 'EventStream Admin', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.get('[data-cy="wizard-nav-item-roles"] button').should('not.have.class', 'pf-m-current'); + cy.get('[data-cy="wizard-nav-item-review"] button').should('have.class', 'pf-m-current'); + }); + it('should display selected user and role in the Review step', () => { + cy.selectTableRowByCheckbox('username', 'demo-user', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.selectTableRowByCheckbox('name', 'EventStream Admin', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.get('[data-cy="wizard-nav-item-review"] button').should('have.class', 'pf-m-current'); + cy.get('[data-cy="expandable-section-users"]').should('contain.text', 'Users'); + cy.get('[data-cy="expandable-section-users"]').should('contain.text', '1'); + cy.get('[data-cy="expandable-section-users"]').should('contain.text', 'demo-user'); + cy.get('[data-cy="expandable-section-edaRoles"]').should('contain.text', 'Roles'); + cy.get('[data-cy="expandable-section-edaRoles"]').should('contain.text', '1'); + cy.get('[data-cy="expandable-section-edaRoles"]').should('contain.text', 'EventStream Admin'); + cy.get('[data-cy="expandable-section-edaRoles"]').should( + 'contain.text', + 'Has all permissions to a single event-stream and its child resources - rulebook' + ); + }); + it('should trigger bulk action dialog on submit', () => { + cy.intercept('POST', edaAPI`/role_user_assignments/`, { + statusCode: 201, + body: { user: 5, role_definition: 14, content_type: 'eda.event-stream', object_id: 1 }, + }).as('createRoleAssignment'); + cy.selectTableRowByCheckbox('username', 'demo-user', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.selectTableRowByCheckbox('name', 'EventStream Admin', { disableFilter: true }); + cy.clickButton(/^Next$/); + cy.clickButton(/^Finish$/); + cy.wait('@createRoleAssignment'); + // Bulk action modal is displayed with success + cy.get('.pf-v5-c-modal-box').within(() => { + cy.get('table tbody').find('tr').should('have.length', 1); + cy.get('table tbody').should('contain.text', 'demo-user'); + cy.get('table tbody').should('contain.text', 'EventStream Admin'); + cy.get('div.pf-v5-c-progress__description').should('contain.text', 'Success'); + cy.get('div.pf-v5-c-progress__status').should('contain.text', '100%'); + }); + }); +}); diff --git a/frontend/eda/event-streams/components/EdaEventStreamAddUsers.tsx b/frontend/eda/event-streams/components/EdaEventStreamAddUsers.tsx new file mode 100644 index 0000000000..25fe2acd55 --- /dev/null +++ b/frontend/eda/event-streams/components/EdaEventStreamAddUsers.tsx @@ -0,0 +1,159 @@ +import { useTranslation } from 'react-i18next'; +import { useParams } from 'react-router-dom'; +import { + LoadingPage, + PageHeader, + PageLayout, + PageWizard, + PageWizardStep, + useGetPageUrl, + usePageNavigate, +} from '../../../../framework'; +import { RoleAssignmentsReviewStep } from '../../../common/access/RolesWizard/steps/RoleAssignmentsReviewStep'; +import { postRequest } from '../../../common/crud/Data'; +import { useGet } from '../../../common/crud/useGet'; +import { EdaSelectRolesStep } from '../../access/common/EdaRolesWizardSteps/EdaSelectRolesStep'; +import { EdaSelectUsersStep } from '../../access/common/EdaRolesWizardSteps/EdaSelectUsersStep'; +import { edaAPI } from '../../common/eda-utils'; +import { edaErrorAdapter } from '../../common/edaErrorAdapter'; +import { useEdaBulkActionDialog } from '../../common/useEdaBulkActionDialog'; +import { EdaEventStream } from '../../interfaces/EdaEventStream'; +import { EdaRbacRole } from '../../interfaces/EdaRbacRole'; +import { EdaUser } from '../../interfaces/EdaUser'; +import { EdaRoute } from '../../main/EdaRoutes'; + +interface WizardFormValues { + users: EdaUser[]; + edaRoles: EdaRbacRole[]; +} + +interface UserRolePair { + user: EdaUser; + role: EdaRbacRole; +} + +export function EdaEventStreamAddUsers() { + const { t } = useTranslation(); + const getPageUrl = useGetPageUrl(); + const params = useParams<{ id: string }>(); + + const { data: eventstream, isLoading } = useGet( + edaAPI`/event-streams/${params.id ?? ''}/` + ); + const userProgressDialog = useEdaBulkActionDialog(); + const pageNavigate = usePageNavigate(); + + if (isLoading || !eventstream) return ; + + const steps: PageWizardStep[] = [ + { + id: 'users', + label: t('Select user(s)'), + inputs: ( + + ), + validate: (formData, _) => { + const { users } = formData as { users: EdaUser[] }; + if (!users?.length) { + throw new Error(t('Select at least one user.')); + } + }, + }, + { + id: 'roles', + label: t('Select roles to apply'), + inputs: ( + + ), + validate: (formData, _) => { + const { edaRoles } = formData as { edaRoles: EdaRbacRole[] }; + if (!edaRoles?.length) { + throw new Error(t('Select at least one role.')); + } + }, + }, + { + id: 'review', + label: t('Review'), + inputs: , + }, + ]; + + const onSubmit = (data: WizardFormValues) => { + const { users, edaRoles } = data; + const items: UserRolePair[] = []; + for (const user of users) { + for (const role of edaRoles) { + items.push({ user, role }); + } + } + return new Promise((resolve) => { + userProgressDialog({ + title: t('Add roles'), + keyFn: ({ user, role }) => `${user.id}_${role.id}`, + items, + actionColumns: [ + { header: t('User'), cell: ({ user }) => user.username }, + { header: t('Role'), cell: ({ role }) => role.name }, + ], + actionFn: ({ user, role }) => + postRequest(edaAPI`/role_user_assignments/`, { + user: user.id, + role_definition: role.id, + content_type: 'eda.eventstream', + object_id: eventstream.id, + }), + onComplete: () => { + resolve(); + }, + onClose: () => { + pageNavigate(EdaRoute.EventStreamUserAccess, { + params: { id: eventstream.id.toString() }, + }); + }, + }); + }); + }; + + return ( + + + + errorAdapter={edaErrorAdapter} + steps={steps} + onSubmit={onSubmit} + disableGrid + onCancel={() => { + pageNavigate(EdaRoute.EventStreamUserAccess, { params: { id: eventstream?.id } }); + }} + /> + + ); +} diff --git a/frontend/eda/main/EdaRoutes.tsx b/frontend/eda/main/EdaRoutes.tsx index c41be31751..62b4cfff0a 100644 --- a/frontend/eda/main/EdaRoutes.tsx +++ b/frontend/eda/main/EdaRoutes.tsx @@ -92,6 +92,10 @@ export enum EdaRoute { EventStreamPage = 'eda-event-stream-page', EventStreamDetails = 'eda-event-stream-details', EventStreamActivations = 'eda-event-stream-activations', + EventStreamTeamAccess = 'eda-event-stream-team-access', + EventStreamUserAccess = 'eda-event-stream-user-access', + EventStreamAddTeams = 'eda-event-stream-add-teams', + EventStreamAddUsers = 'eda-event-stream-add-users', Settings = 'eda-settings', SettingsPreferences = 'eda-settings-preferences', diff --git a/frontend/eda/main/useEdaNavigation.tsx b/frontend/eda/main/useEdaNavigation.tsx index b046a3e5ff..a4cd6ca44d 100644 --- a/frontend/eda/main/useEdaNavigation.tsx +++ b/frontend/eda/main/useEdaNavigation.tsx @@ -82,6 +82,10 @@ import { EventStreams } from '../event-streams/EventStreams'; import { EdaRoute } from './EdaRoutes'; import { useEdaOrganizationRoutes } from './routes/useEdaOrganizationsRoutes'; import { EventStreamActivations } from '../event-streams/EventStreamPage/EventStreamActivations'; +import { EdaEventStreamAddTeams } from '../event-streams/components/EdaEventStreamAddTeams'; +import { EdaEventStreamAddUsers } from '../event-streams/components/EdaEventStreamAddUsers'; +import { EventStreamUserAccess } from '../event-streams/EventStreamPage/EventStreamUserAccess'; +import { EventStreamTeamAccess } from '../event-streams/EventStreamPage/EventStreamTeamAccess'; export function useEdaNavigation() { const { t } = useTranslation(); @@ -347,12 +351,32 @@ export function useEdaNavigation() { path: 'activations', element: , }, + { + id: EdaRoute.EventStreamTeamAccess, + path: 'team-access', + element: , + }, + { + id: EdaRoute.EventStreamUserAccess, + path: 'user-access', + element: , + }, { path: '', element: , }, ], }, + { + id: EdaRoute.EventStreamAddUsers, + path: ':id/user-access/add', + element: , + }, + { + id: EdaRoute.EventStreamAddTeams, + path: ':id/team-access/add', + element: , + }, { path: '', element: ,