Skip to content

Commit

Permalink
Merge pull request #54 from ImperialCollegeLondon/feature/console-log…
Browse files Browse the repository at this point in the history
…-improvements

Commented out unnecessary console.info, console.log
  • Loading branch information
Tim Allen authored Aug 14, 2024
2 parents c595bfa + ba53df7 commit 8dffec6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
14 changes: 14 additions & 0 deletions CK-CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- markdownlint-disable MD041 -->
## 0.5.0 (Unreleased)

**BREAKING CHANGES & MIGRATIONS**:

FEATURES:

ENHANCEMENTS:
* Removed console.log() client code (https://cloudkubed.atlassian.net/browse/IATP-84)

BUG FIXES:

COMPONENTS:

5 changes: 4 additions & 1 deletion ui/app/src/components/shared/ResourceContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { AppRolesContext } from '../../contexts/AppRolesContext';
import { useAppDispatch } from '../../hooks/customReduxHooks';
import { addUpdateOperation } from '../shared/notifications/operationsSlice';
import { ConfirmUpgradeResource } from './ConfirmUpgradeResource';
import config from '../../config.json';

interface ResourceContextMenuProps {
resource: Resource,
Expand Down Expand Up @@ -137,7 +138,9 @@ export const ResourceContextMenu: React.FunctionComponent<ResourceContextMenuPro
// currentUserRoles = currentUserRoles.concat(workspaceCtx.roles);
// }
const currentUserRoles = wsAuth ? workspaceCtx.roles : appRoles.roles;
// console.log(action + " role " + type + " : " + r + " : " + currentUserRoles)

config.debug && console.log(action + " role " + type + " : " + r + " : " + currentUserRoles); // Added this line, removed the commented line.

return r.some(role => currentUserRoles.includes(role));
}

Expand Down
5 changes: 4 additions & 1 deletion ui/app/src/components/shared/airlock/AirlockViewRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { destructiveButtonStyles } from "../../../styles";
import { ExceptionLayout } from "../ExceptionLayout";
import { AirlockRequestFilesSection } from "./AirlockRequestFilesSection";
import { AirlockReviewRequest } from "./AirlockReviewRequest";
import config from '../../../config.json';

interface AirlockViewRequestProps {
requests: AirlockRequest[];
Expand Down Expand Up @@ -48,7 +49,9 @@ export const AirlockViewRequest: React.FunctionComponent<AirlockViewRequestProps
} else {
setRequest(req);
}
// console.log(req);

config.debug && console.log(req); // Added this line, removed the commented line.

}, [apiCall, requestId, props.requests, workspaceCtx.workspace.id, workspaceCtx.workspaceApplicationIdURI]);

const dismissPanel = useCallback(() => navigate('../'), [navigate]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ResourceType } from "../../../models/resourceType";
import { APIError } from "../../../models/exceptions";
import { ExceptionLayout } from "../ExceptionLayout";
import { ResourceTemplate, sanitiseTemplateForRJSF } from "../../../models/resourceTemplate";
import config from '../../../config.json';

interface ResourceFormProps {
templateName: string,
Expand Down Expand Up @@ -87,7 +88,11 @@ export const ResourceForm: React.FunctionComponent<ResourceFormProps> = (props:

const createUpdateResource = async (formData: any) => {
const data = removeReadOnlyProps(formData, template);
// console.log("parsed payload to send", data);

if (config.debug === true) {
config.debug && console.log("parsed payload to send", data); // Added this line, removed the commented line.
}


setSendingData(true);
let response;
Expand Down
6 changes: 5 additions & 1 deletion ui/app/src/components/workspaces/WorkspaceProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { LoadingState } from '../../models/loadingState';
import { ExceptionLayout } from '../shared/ExceptionLayout';
import { AppRolesContext } from '../../contexts/AppRolesContext';
import { RoleName, WorkspaceRoleName } from '../../models/roleNames';
import config from '../../config.json';

export const WorkspaceProvider: React.FunctionComponent = () => {
const apiCall = useAuthApiCall();
Expand Down Expand Up @@ -62,7 +63,10 @@ export const WorkspaceProvider: React.FunctionComponent = () => {
workspaceCtx.current.setWorkspace(ws);
workspaceCtx.current.setRoles(wsRoles);
setWSRoles(wsRoles);
console.info(wsRoles)


config.debug && console.info(wsRoles); // Added this line, removed the commented line.


// get workspace services to pass to nav + ws services page
const workspaceServices = await apiCall(`${ApiEndpoint.Workspaces}/${ws.id}/${ApiEndpoint.WorkspaceServices}`,
Expand Down

0 comments on commit 8dffec6

Please sign in to comment.