Skip to content

Commit

Permalink
Comment out unused variables for build
Browse files Browse the repository at this point in the history
  • Loading branch information
andyyu824 committed Jul 3, 2024
1 parent 126007f commit 7ea0dbb
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 81 deletions.
23 changes: 1 addition & 22 deletions src/tapis-app/Dashboard/_components/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React from "react";
import { Link } from "react-router-dom";
import {
SectionHeader,
LoadingSpinner,
Icon,
SectionMessage,
} from "tapis-ui/_common";
import { SectionHeader, LoadingSpinner, Icon } from "tapis-ui/_common";
import ActivityFeed from "../ActivityFeed";
import { Card, CardBody, CardTitle, CardFooter, CardText } from "reactstrap";
import { useTapisConfig } from "tapis-hooks";
Expand Down Expand Up @@ -38,14 +33,6 @@ const DashboardCard: React.FC<DashboardCardProps> = ({
}) => {
return (
<Card className={styles.card}>
{/*<CardHeader>*/}
{/* <div className={styles["card-header"]}>*/}
{/* <div>*/}
{/* <Icon name={icon} className="dashboard__card-icon" />*/}
{/* </div>*/}
{/* <div>{name}</div>*/}
{/* </div>*/}
{/*</CardHeader>*/}
<CardBody
style={{
backgroundColor: backgroundColor,
Expand Down Expand Up @@ -92,14 +79,6 @@ const Dashboard: React.FC = () => {
Dashboard for {claims["tapis/tenant_id"]}
</SectionHeader>
<div className={styles.cards}>
{/*<DashboardCard*/}
{/* icon="data-files"*/}
{/* name="Systems"*/}
{/* text="View TAPIS systems"*/}
{/* link="/systems"*/}
{/* counter={`${systems?.data?.result?.length} systems`}*/}
{/* loading={systems?.isLoading}*/}
{/*/>*/}
<DashboardCard
icon="jobs"
name="Jobs"
Expand Down
10 changes: 3 additions & 7 deletions src/tapis-app/Login/_components/Login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React from "react";
import { Button } from "reactstrap";
import { useLogin } from "tapis-hooks/authenticator";
import { useTapisConfig } from "tapis-hooks/context";
import {FormikInput, LoadingSpinner, Message} from "tapis-ui/_common";
import { SubmitWrapper } from "tapis-ui/_wrappers";
import { FormikInput, LoadingSpinner, Message } from "tapis-ui/_common";
import { Formik, Form } from "formik";
import * as Yup from "yup";
import styles from "./Login.module.scss";
Expand Down Expand Up @@ -58,16 +57,13 @@ const Login: React.FC = () => {
darkBG
/>
<div className={styles["submit-section"]}>
<Button
type="submit"
disabled={isLoading || accessToken != null}
>
<Button type="submit" disabled={isLoading || accessToken != null}>
Log In
</Button>
<div className={styles["status"]}>
{isLoading && (
<LoadingSpinner
className={styles['loading-spinner']}
className={styles["loading-spinner"]}
placement="inline"
/>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FieldInputProps, Field, useField } from "formik";
import { useField } from "formik";
import { FormikInputProps } from ".";
import { Input, FormText, FormGroup, Label } from "reactstrap";
import styles from "./FormikCheck.module.scss";
Expand Down
15 changes: 1 addition & 14 deletions src/tapis-ui/components/jobs/JobLauncher/steps/AppArgs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useMemo } from "react";
import React, { useMemo } from "react";
import { Apps, Jobs } from "@tapis/tapis-typescript";
import { useJobLauncher } from "../components";
import fieldArrayStyles from "../FieldArray.module.scss";
Expand All @@ -20,19 +20,6 @@ type ArgFieldProps = {

export const ArgField: React.FC<ArgFieldProps> = ({ name, inputMode }) => {
const [descriptionField] = useField(`${name}.description`);
const [notesField] = useField(`${name}`);

useEffect(() => {
console.log(notesField);
// if (typeof notesField.value === "object") {
// console.log(`Notes for ${name}:`);
// for (const [key, value] of Object.entries(notesField.value)) {
// console.log(` ${key}: ${value}`);
// }
// } else {
// console.log(`Notes for ${name}:`, notesField.value);
// }
}, [name, notesField.value]);

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/tapis-ui/components/jobs/JobLauncher/steps/Archive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ArchiveOptions: React.FC = () => {
const { systems } = useJobLauncher();
const { values } = useFormikContext();
// console.log("values: ", values);
const [isOpen, setIsOpen] = useState(false);
const [isOpen] = useState(false);

const archiveSystemId = useMemo(
() =>
Expand Down
60 changes: 24 additions & 36 deletions src/tapis-ui/components/jobs/JobLauncher/steps/FileInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@ import React, { useEffect, useMemo } from "react";
import { Apps, Jobs } from "@tapis/tapis-typescript";
import { Button } from "reactstrap";
import { useJobLauncher, StepSummaryField } from "../components";
import styles from "./FileInputs.module.scss";
import fieldArrayStyles from "../FieldArray.module.scss";
import {
getIncompleteJobInputs,
getAppInputsIncludedByDefault,
} from "tapis-api/utils/jobFileInputs";
import { FieldArray, useFormikContext, FieldArrayRenderProps } from "formik";
import {
FormikCheck,
FormikInput,
FormikTapisFile,
} from "tapis-ui/_common/FieldWrapperFormik";
import { FormikTapisFile } from "tapis-ui/_common/FieldWrapperFormik";
import { JobStep } from "..";
import { v4 as uuidv4 } from "uuid";
import * as Yup from "yup";
Expand All @@ -24,10 +19,10 @@ type FileInputFieldProps = {
remove: (index: number) => Jobs.JobFileInput | undefined;
};

const upperCaseFirstLetter = (str: string) => {
const lower = str.toLowerCase();
return `${lower.slice(0, 1).toUpperCase()}${lower.slice(1)}`;
};
// const upperCaseFirstLetter = (str: string) => {
// const lower = str.toLowerCase();
// return `${lower.slice(0, 1).toUpperCase()}${lower.slice(1)}`;
// };

const JobInputField: React.FC<FileInputFieldProps> = ({
item,
Expand All @@ -44,9 +39,9 @@ const JobInputField: React.FC<FileInputFieldProps> = ({
[app.id, app.version]
);
const isRequired = inputMode === Apps.FileInputModeEnum.Required;
const note = `${
inputMode ? upperCaseFirstLetter(inputMode) : "User Defined"
}`;
// const note = `${
// inputMode ? upperCaseFirstLetter(inputMode) : "User Defined"
// }`;

return (
<div className={fieldArrayStyles["array-item"]}>
Expand All @@ -57,12 +52,6 @@ const JobInputField: React.FC<FileInputFieldProps> = ({
description="Input TAPIS file as a pathname, TAPIS URI or web URL"
/>
<div className={fieldArrayStyles["end-container"]}>
{/*<FormikCheck*/}
{/* name={`fileInputs.${index}.autoMountLocal`}*/}
{/* label="Auto-mount Local"*/}
{/* required={false}*/}
{/* description="If this is true, the source URL will be mounted from the execution system's local file system"*/}
{/*/>*/}
{!isRequired && (
<Button onClick={() => remove(index)} size="sm" color="danger">
Remove
Expand All @@ -73,26 +62,26 @@ const JobInputField: React.FC<FileInputFieldProps> = ({
);
};

const getFileInputsOfMode = (
app: Apps.TapisApp,
inputMode: Apps.FileInputModeEnum
) =>
app.jobAttributes?.fileInputs?.filter(
(appInput) => appInput.inputMode === inputMode
) ?? [];
// const getFileInputsOfMode = (
// app: Apps.TapisApp,
// inputMode: Apps.FileInputModeEnum
// ) =>
// app.jobAttributes?.fileInputs?.filter(
// (appInput) => appInput.inputMode === inputMode
// ) ?? [];

const JobInputs: React.FC<{ arrayHelpers: FieldArrayRenderProps }> = ({
arrayHelpers,
}) => {
const { values } = useFormikContext();
const { app } = useJobLauncher();
const requiredInputs = useMemo(
() => getFileInputsOfMode(app, Apps.FileInputModeEnum.Required),
/* eslint-disable-next-line */
[app.id, app.version]
);
let requiredText =
requiredInputs.length > 0 ? `Required (${requiredInputs.length})` : "";
// const { app } = useJobLauncher();
// const requiredInputs = useMemo(
// () => getFileInputsOfMode(app, Apps.FileInputModeEnum.Required),
// /* eslint-disable-next-line */
// [app.id, app.version]
// );
// let requiredText =
// requiredInputs.length > 0 ? `Required (${requiredInputs.length})` : "";
const jobInputs = (values as Partial<Jobs.ReqSubmitJob>)?.fileInputs ?? [];

// Add an initial item if the list is empty on component mount
Expand All @@ -103,7 +92,7 @@ const JobInputs: React.FC<{ arrayHelpers: FieldArrayRenderProps }> = ({
targetPath: "./reads",
});
}
}, [arrayHelpers]);
}, [arrayHelpers, jobInputs.length]);

return (
<>
Expand Down Expand Up @@ -144,7 +133,6 @@ const JobInputs: React.FC<{ arrayHelpers: FieldArrayRenderProps }> = ({
export const FileInputs: React.FC = () => {
return (
<div>
{/*<h2>File Inputs</h2>*/}
<FieldArray
name="fileInputs"
render={(arrayHelpers) => {
Expand Down

0 comments on commit 7ea0dbb

Please sign in to comment.