• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CBIIT / crdc-datahub-ui / 9163061041

20 May 2024 06:09PM UTC coverage: 30.327%. First build
9163061041

Pull #376

github

web-flow
Merge c6ff5a713 into 3a88433db
Pull Request #376: Fix missing eslint extends

877 of 3630 branches covered (24.16%)

Branch coverage included in aggregate %.

2 of 7 new or added lines in 7 files covered. (28.57%)

1534 of 4320 relevant lines covered (35.51%)

95.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/content/organizations/Controller.tsx
1
import React from "react";
2
import { Navigate, useParams } from "react-router-dom";
3
import { useAuthContext } from "../../components/Contexts/AuthContext";
4
import { OrganizationProvider } from "../../components/Contexts/OrganizationListContext";
5
import ListView from "./ListView";
6
import OrganizationView from "./OrganizationView";
7

8
/**
9
 * Renders the correct view based on the URL and permissions-tier
10
 *
11
 * @param {void} props - React props
12
 * @returns {FC} - React component
13
 */
NEW
14
const OrganizationController = () => {
×
15
  const { orgId } = useParams<{ orgId?: string }>();
×
16
  const { user } = useAuthContext();
×
17
  const isAdministrative = user?.role === "Admin";
×
18

19
  if (!isAdministrative) {
×
20
    return <Navigate to="/" />;
×
21
  }
22

23
  if (orgId) {
×
24
    return <OrganizationView _id={orgId} />;
×
25
  }
26

27
  return (
×
28
    <OrganizationProvider preload>
29
      <ListView />
30
    </OrganizationProvider>
31
  );
32
};
33

34
export default OrganizationController;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc