Skip to content

Commit

Permalink
Allow public viewing for conflicts paeg
Browse files Browse the repository at this point in the history
  • Loading branch information
howard-e committed Sep 17, 2024
1 parent fbae626 commit 5c70d43
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 32 deletions.
1 change: 0 additions & 1 deletion client/components/TestPlanReportStatusDialog/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const TestPlanReportStatusDialog = ({
<ReportStatusSummary
testPlanVersion={testPlanVersion}
testPlanReport={testPlanReport}
me={me}
/>
{isSignedIn && isAdmin && !testPlanReport ? (
<AddTestToQueueWithConfirmation
Expand Down
43 changes: 24 additions & 19 deletions client/components/TestQueue/Conflicts/TestConflictsActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,36 @@ const ActionButton = styled(Button)`
margin: 0;
`;

const TestConflictsActions = ({ issueLink, isAdmin, testPlanRuns }) => {
const TestConflictsActions = ({
issueLink,
isAdmin,
testPlanRuns,
testIndex
}) => {
const openResultsLabel = isAdmin ? 'Open run as...' : 'View Results for...';

return (
<ActionContainer>
<Button variant="secondary" target="_blank" href={issueLink}>
<FontAwesomeIcon icon={faExclamationCircle} />
Raise an Issue for Conflict
</Button>
{isAdmin && (
<Dropdown>
<Dropdown.Toggle variant="secondary" as={ActionButton}>
<FontAwesomeIcon icon={faFileImport} />
Open run as...
</Dropdown.Toggle>
<Dropdown.Menu>
{testPlanRuns.map(testPlanRun => (
<Dropdown.Item
key={testPlanRun.id}
href={`/run/${testPlanRun.id}?user=${testPlanRun.tester.id}`}
>
{testPlanRun.tester.username}
</Dropdown.Item>
))}
</Dropdown.Menu>
</Dropdown>
)}
<Dropdown>
<Dropdown.Toggle variant="secondary" as={ActionButton}>
<FontAwesomeIcon icon={faFileImport} />
{openResultsLabel}
</Dropdown.Toggle>
<Dropdown.Menu>
{testPlanRuns.map(testPlanRun => (
<Dropdown.Item
key={testPlanRun.id}
href={`/run/${testPlanRun.id}?user=${testPlanRun.tester.id}#${testIndex}`}
>
{testPlanRun.tester.username}
</Dropdown.Item>
))}
</Dropdown.Menu>
</Dropdown>
</ActionContainer>
);
};
Expand Down
1 change: 0 additions & 1 deletion client/components/TestQueue/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ const TestQueue = () => {
<ReportStatusSummary
testPlanVersion={testPlanVersion}
testPlanReport={testPlanReport}
me={data.me}
fromTestQueue
/>
{hasBotRun ? (
Expand Down
6 changes: 0 additions & 6 deletions client/components/common/ReportStatusSummary/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
TestPlanRunPropType,
UserPropType
} from '../proptypes';
import { evaluateAuth } from '../../../utils/evaluateAuth';

const IncompleteStatusReport = styled.span`
min-width: 5rem;
Expand All @@ -18,11 +17,8 @@ const IncompleteStatusReport = styled.span`
const ReportStatusSummary = ({
testPlanVersion,
testPlanReport,
me,
fromTestQueue = false
}) => {
const { isSignedIn, isAdmin, isTester, isVendor } = evaluateAuth(me);

const renderCompleteReportStatus = testPlanReport => {
const formattedDate = dates.convertDateToString(
testPlanReport.markedFinalAt,
Expand All @@ -37,8 +33,6 @@ const ReportStatusSummary = ({

const getConflictsAnchor = conflictsCount => {
if (conflictsCount === 0) return null;
if (!isSignedIn) return null;
if (!isTester && !isVendor && !isAdmin) return null;
return (
<a
style={{ color: '#ce1b4c' }}
Expand Down
6 changes: 1 addition & 5 deletions client/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ export default () => (
<Route
exact
path="/test-queue/:testPlanReportId/conflicts"
element={
<ConfirmAuth requiredPermission="TESTER">
<TestQueueConflicts />
</ConfirmAuth>
}
element={<TestQueueConflicts />}
/>
<Route
exact
Expand Down

0 comments on commit 5c70d43

Please sign in to comment.