Skip to content

Commit

Permalink
Remove roles from the script, calendar, script and task services
Browse files Browse the repository at this point in the history
  • Loading branch information
solittlework committed Dec 7, 2023
1 parent dd83d2d commit 2c9a74b
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 109 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { FunctionComponent, useState } from 'react';
import { CalendarItem } from '@store/calendar/models';
import { GoABadge } from '@abgov/react-components-new';
import { useDispatch } from 'react-redux';
import DataTable from '@components/DataTable';
import { TableDiv, OverFlowWrapTableCell } from '../styled-components';
Expand Down Expand Up @@ -34,25 +33,6 @@ const CalendarItemComponent: FunctionComponent<CalendarItemProps> = ({
<td headers="calendar-description" data-testid="calendar-description">
<OverFlowWrapTableCell>{calendar.description}</OverFlowWrapTableCell>
</td>
<td headers="calendar-read-roles" data-testid="calendar-read-roles">
{calendar.readRoles.map((role): JSX.Element => {
return (
<div key={`read-roles-${role}`}>
<GoABadge key={`read-roles-${role}`} type="information" content={role} />
</div>
);
})}
</td>
<td headers="calendar-update-roles" data-testid="calendar-update-roles">
{calendar.updateRoles.map((role): JSX.Element => {
return (
<div key={`read-roles-${role}`}>
<GoABadge key={`read-roles-${role}`} type="information" content={role} />
</div>
);
})}
</td>

<td headers="calendar-actions" data-testid="calendar-actions">
{onDelete && (
<div style={{ display: 'flex' }}>
Expand Down Expand Up @@ -115,12 +95,6 @@ export const CalendarTableComponent: FunctionComponent<calendarTableProps> = ({
<th id="calendar-description" data-testid="calendar-table-header-description">
Description
</th>
<th id="calendar-read-roles" data-testid="calendar-table-header-read-roles">
Read roles
</th>
<th id="calendar-update-roles" data-testid="calendar-table-header-update-roles">
Update roles
</th>
<th id="calendar-actions" data-testid="calendar-table-header-actions">
Actions
</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import DataTable from '@components/DataTable';
import { Role } from '@store/tenant/models';
import { GoAContextMenu, GoAContextMenuIcon } from '@components/ContextMenu';
import styled from 'styled-components';
import { GoABadge, GoAButtonGroup, GoAModal, GoAButton } from '@abgov/react-components-new';
import { GoAButtonGroup, GoAModal, GoAButton } from '@abgov/react-components-new';
import { FileTypeItem } from '@store/file/models';
import { useHistory, useRouteMatch } from 'react-router-dom';
import { DeleteModal } from '@components/DeleteModal';
Expand Down Expand Up @@ -40,22 +40,6 @@ const FileTypeTableRow = ({
return (
<tr key={id}>
<td>{name}</td>
<td className="readRolesCol">
{anonymousRead === false &&
readRoles.map((role): JSX.Element => {
return (
<div key={`read-roles-${role}`}>
<GoABadge key={`read-roles-${role}`} type="information" content={role} />
</div>
);
})}
{anonymousRead === true && 'public'}
</td>
<td className="updateRolesCol">
{updateRoles.map((role): JSX.Element => {
return <GoABadge key={`update-roles-${id}-${role}`} type="information" content={role} />;
})}
</td>
<td style={{ textTransform: 'capitalize' }}>{securityClassification ? securityClassification : ''}</td>
<td>{rules?.retention?.active ? rules?.retention?.deleteInDays : 'N/A'}</td>
<td className="actionCol">
Expand Down Expand Up @@ -97,22 +81,6 @@ const CoreFileTypeTableRow = ({
return (
<tr key={id}>
<td>{name}</td>
<td className="readRolesCol">
{anonymousRead === false &&
readRoles.map((role): JSX.Element => {
return (
<div key={`read-roles-${role}`}>
<GoABadge key={`read-roles-${role}`} type="information" content={role} />
</div>
);
})}
{anonymousRead === true && 'public'}
</td>
<td className="updateRolesCol">
{updateRoles?.map((role): JSX.Element => {
return <GoABadge key={`update-roles-${id}-${role}`} type="information" content={role} />;
})}
</td>
<td style={{ textTransform: 'capitalize' }}>{securityClassification ? securityClassification : ''}</td>
<td>{rules?.retention?.active ? rules?.retention?.deleteInDays : 'N/A'}</td>
</tr>
Expand All @@ -138,8 +106,6 @@ export const FileTypeTable = ({ roles, fileTypes, coreFileTypes }: FileTypeTable
<th id="name" data-testid="file-types-table-header-name">
Name
</th>
<th id="read-roles">Read roles</th>
<th id="write-roles">Modify roles</th>
<th id="security-classification">
Security
<br /> classification
Expand Down Expand Up @@ -184,8 +150,6 @@ export const FileTypeTable = ({ roles, fileTypes, coreFileTypes }: FileTypeTable
<th id="name-core" data-testid="file-types-table-header-name">
Name
</th>
<th id="read-roles-core">Read roles</th>
<th id="write-roles-core">Modify roles</th>
<th id="security-classification-core">
Security <br /> classification
</th>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { FunctionComponent, useState } from 'react';
import { ScriptItem } from '@store/script/models';
import { GoABadge } from '@abgov/react-components-new';
import { useDispatch } from 'react-redux';
import DataTable from '@components/DataTable';
import { TableDiv } from './styled-components';
Expand All @@ -26,16 +25,6 @@ const ScriptItemComponent: FunctionComponent<ScriptItemProps> = ({ script, onDel
<td headers="script-description" data-testid="script-description">
{script.description}
</td>
<td headers="script-runner-roles" data-testid="script-runner-roles">
{script.runnerRoles &&
script.runnerRoles.map((role): JSX.Element => {
return (
<div key={`runner-roles-${role}`}>
<GoABadge key={`runner-roles-${role}`} type="information" content={role} />
</div>
);
})}
</td>
<td headers="script-actions" data-testid="script-actions">
{onDelete && (
<div style={{ display: 'flex' }}>
Expand Down Expand Up @@ -92,9 +81,6 @@ export const ScriptTableComponent: FunctionComponent<scriptTableProps> = ({ scri
<th id="script-description" data-testid="script-table-header-description">
Description
</th>
<th id="script-runner-roles" data-testid="script-table-header-read-roles">
Runner roles
</th>
<th id="script-actions" data-testid="script-table-header-actions">
Actions
</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ export const QueueListTable: FunctionComponent<QueueTableProps> = ({ taskQueues,
<tr>
<th data-testid="task-queue-table-header-namespace">Namespace</th>
<th data-testid="task-queue-table-header-name">Name</th>
<th id="task-queue-assigner" data-testid="task-queue-table-header-assigners">
Assigner roles
</th>
<th id="task-queue-worker" data-testid="task-queue-table-header-workers">
Worker roles
</th>
<th id="task-queue-action" data-testid="task-queue-table-header-action">
Actions
</th>
Expand All @@ -37,4 +31,4 @@ export const QueueListTable: FunctionComponent<QueueTableProps> = ({ taskQueues,
</DataTable>
</>
);
};
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React from 'react';
import { GoABadge } from '@abgov/react-components-new';
import { OverflowWrap } from './styled-components';
import { GoAContextMenuIcon } from '@components/ContextMenu';

import { useRouteMatch } from 'react-router';
Expand All @@ -21,29 +19,6 @@ export const QueueTableItem = ({ id, queue, onDelete }: QueueTableItemProps): JS
<tr>
<td data-testid="queue-list-namespace">{queue.namespace}</td>
<td data-testid="queue-list-name">{queue.name}</td>

<td data-testid="queue-list-assigner-roles">
<OverflowWrap>
{queue?.assignerRoles?.map((role): JSX.Element => {
return (
<div key={`applicant-roles-${role}`}>
<GoABadge key={`applicant-roles-${role}`} type="information" content={role} />
</div>
);
})}
</OverflowWrap>
</td>
<td data-testid="queue-list-worker-roles">
<OverflowWrap>
{queue.workerRoles?.map((role): JSX.Element => {
return (
<div key={`applicant-roles-${role}`}>
<GoABadge key={`applicant-roles-${role}`} type="information" content={role} />
</div>
);
})}
</OverflowWrap>
</td>
<td data-testid="queue-list-action">
<GoAContextMenuIcon
testId="task-definition-edit"
Expand Down

0 comments on commit 2c9a74b

Please sign in to comment.