Skip to content

Commit

Permalink
Merge pull request #431 from bcgov/chore/hide-admin-column
Browse files Browse the repository at this point in the history
chore: hide organization admin toggle
  • Loading branch information
IanFonzie authored Nov 9, 2023
2 parents 029d515 + ff562dc commit ef3b011
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 42 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bcgov-digital-marketplace",
"version": "3.1.1",
"version": "5.5.1",
"description": "Digital Marketplace",
"homepage": "https://marketplace.digital.gov.bc.ca",
"bugs": {
Expand Down
84 changes: 43 additions & 41 deletions src/front-end/typescript/lib/pages/organization/edit/tab/team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ import Link, {
leftPlacement
} from "front-end/lib/views/link";
import React from "react";
import { Col, CustomInput, Row, Spinner } from "reactstrap";
// import { Col, CustomInput, Row, Spinner } from "reactstrap";
import { Col, Row } from "reactstrap";
import CAPABILITIES from "shared/lib/data/capabilities";
import {
AffiliationMember,
Expand All @@ -42,8 +43,8 @@ import {
} from "shared/lib/resources/affiliation";
import {
isAdmin,
isVendor,
usersAreEquivalent
isVendor
// usersAreEquivalent
} from "shared/lib/resources/user";
import { adt, ADT, Id } from "shared/lib/types";
import { validateUserEmail } from "shared/lib/validation/affiliation";
Expand Down Expand Up @@ -494,10 +495,10 @@ function membersTableHeadCells(): Table.HeadCells {
children: "Capabilities",
className: "text-center"
},
{
children: "Admin",
className: "text-center"
},
// {
// children: "Admin",
// className: "text-center"
// },
{
children: null
}
Expand All @@ -518,10 +519,11 @@ function membersTableBodyRows(
isRemoveTeamMemberLoading ||
isApproveAffiliationLoading ||
isAdminStatusLoading;
return state.affiliations.map((m, i) => {
// return state.affiliations.map((m, i) => {
return state.affiliations.map((m, _) => {
const isMemberLoading = state.removeTeamMemberLoading === m.id;
const isApproveLoading = state.approveAffiliationLoading === m.id;
const isAdminStatusLoading = state.updateAdminStatusLoading === m.id;
// const isAdminStatusLoading = state.updateAdminStatusLoading === m.id;
return [
{
children: (
Expand All @@ -543,38 +545,38 @@ function membersTableBodyRows(
children: String(m.user.capabilities.length),
className: "text-center align-middle"
},
{
children: isAdminStatusLoading ? (
<Spinner size="sm" color="secondary" />
) : (
<div className={`affiliations-admin-status-${i}`}>
<CustomInput
type="checkbox"
id={`affiliations-admin-checkbox-${i}`}
onChange={(e) => {
if (e) {
e.stopPropagation();
}
isAffiliationAdminStatusChecked(m)
? dispatch(adt("onUpdateAdminStatus", m) as Msg)
: dispatch(
adt(
"showModal",
adt("acceptOrgAdminStatusTerms", m) as ModalId
) as Msg
);
}}
disabled={
isLoading ||
memberIsOwner(m) ||
usersAreEquivalent(state.viewerUser, m.user)
}
checked={isAffiliationAdminStatusChecked(m)}
/>
</div>
),
className: `text-center align-middle`
},
// {
// children: isAdminStatusLoading ? (
// <Spinner size="sm" color="secondary" />
// ) : (
// <div className={`affiliations-admin-status-${i}`}>
// <CustomInput
// type="checkbox"
// id={`affiliations-admin-checkbox-${i}`}
// onChange={(e) => {
// if (e) {
// e.stopPropagation();
// }
// isAffiliationAdminStatusChecked(m)
// ? dispatch(adt("onUpdateAdminStatus", m) as Msg)
// : dispatch(
// adt(
// "showModal",
// adt("acceptOrgAdminStatusTerms", m) as ModalId
// ) as Msg
// );
// }}
// disabled={
// isLoading ||
// memberIsOwner(m) ||
// usersAreEquivalent(state.viewerUser, m.user)
// }
// checked={isAffiliationAdminStatusChecked(m)}
// />
// </div>
// ),
// className: `text-center align-middle`
// },
{
showOnHover: !(isMemberLoading || isApproveLoading),
children: (
Expand Down

0 comments on commit ef3b011

Please sign in to comment.