Skip to content

Commit

Permalink
max-line-length: 120
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders-ms committed Jan 25, 2024
1 parent 7b39e4a commit 0470d35
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 16 deletions.
2 changes: 1 addition & 1 deletion teachertool/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"arrowParens": "avoid",
"semi": true,
"tabWidth": 4,
"printWidth":200
"printWidth":120
}
14 changes: 12 additions & 2 deletions teachertool/src/components/ActiveRubricDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,22 @@ const ActiveRubricDisplay: React.FC<IProps> = ({}) => {
criteriaInstance.catalogCriteriaId && (
<div className="criteria-instance-display" key={criteriaInstance.instanceId}>
{catalogCriteria?.template}
<Button className="criteria-btn-remove" label={lf("X")} onClick={() => removeCriteriaFromRubric(criteriaInstance)} title={lf("Remove")} />
<Button
className="criteria-btn-remove"
label={lf("X")}
onClick={() => removeCriteriaFromRubric(criteriaInstance)}
title={lf("Remove")}
/>
</div>
)
);
})}
<Button className="add-criteria secondary" label={lf("+ Add Criteria")} onClick={showCatalogModal} title={lf("Add Criteria")} />
<Button
className="add-criteria secondary"
label={lf("+ Add Criteria")}
onClick={showCatalogModal}
title={lf("Add Criteria")}
/>
</div>
);
};
Expand Down
7 changes: 6 additions & 1 deletion teachertool/src/components/CatalogModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ const CatalogModal: React.FC<IProps> = ({}) => {
];

return teacherTool.modal === "catalog-display" ? (
<Modal className="catalog-modal" title={lf("Select the criteria you'd like to include")} onClose={closeModal} actions={modalActions}>
<Modal
className="catalog-modal"
title={lf("Select the criteria you'd like to include")}
onClose={closeModal}
actions={modalActions}
>
{teacherTool.catalog?.map(criteria => {
return (
criteria?.template && (
Expand Down
16 changes: 14 additions & 2 deletions teachertool/src/components/DebugInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@ const DebugInput: React.FC<IProps> = ({}) => {
<div className="debug-container">
<div className="single-share-link-input-container">
{lf("Share Link:")}
<Input id="shareLinkInput" className="link-input" placeholder={lf("Share link to validate")} initialValue={shareLink} onChange={setShareLink} />
<Input
id="shareLinkInput"
className="link-input"
placeholder={lf("Share link to validate")}
initialValue={shareLink}
onChange={setShareLink}
/>
</div>
<div className="rubric-json-input-container">
{lf("Rubric:")}
<Textarea id="rubricJsonInput" className="json-input" rows={20} onChange={setRubric} />
</div>
<Button id="evaluateSingleProjectButton" className="ui button primary" onClick={evaluate} title={"Evaluate"} label={lf("Evaluate")} />
<Button
id="evaluateSingleProjectButton"
className="ui button primary"
onClick={evaluate}
title={"Evaluate"}
label={lf("Evaluate")}
/>
</div>
);
};
Expand Down
4 changes: 3 additions & 1 deletion teachertool/src/components/EvalResultDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const EvalResultDisplay: React.FC<IProps> = ({}) => {
return (
<div className="result-block-id" key={id}>
<p className="block-id-label">{id}:</p>
<p className={result ? "positive-text" : "negative-text"}>{result ? "passed" : "failed"}</p>
<p className={result ? "positive-text" : "negative-text"}>
{result ? "passed" : "failed"}
</p>
</div>
);
})}
Expand Down
26 changes: 22 additions & 4 deletions teachertool/src/components/HeaderBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export const HeaderBar: React.FC<HeaderBarProps> = () => {
return (
<div className="ui item logo organization">
{appTheme.organizationWideLogo || appTheme.organizationLogo ? (
<img className={`ui logo`} src={appTheme.organizationWideLogo || appTheme.organizationLogo} alt={lf("{0} Logo", appTheme.organization)} />
<img
className={`ui logo`}
src={appTheme.organizationWideLogo || appTheme.organizationLogo}
alt={lf("{0} Logo", appTheme.organization)}
/>
) : (
<span className="name">{appTheme.organization}</span>
)}
Expand All @@ -24,7 +28,12 @@ export const HeaderBar: React.FC<HeaderBarProps> = () => {

const getTargetLogo = () => {
return (
<div aria-label={lf("{0} Logo", appTheme.boardName)} role="menuitem" className={`ui item logo brand mobile hide`} onClick={brandIconClick}>
<div
aria-label={lf("{0} Logo", appTheme.boardName)}
role="menuitem"
className={`ui item logo brand mobile hide`}
onClick={brandIconClick}
>
{appTheme.useTextLogo ? (
[
<span className="name" key="org-name">
Expand All @@ -35,7 +44,11 @@ export const HeaderBar: React.FC<HeaderBarProps> = () => {
</span>,
]
) : appTheme.logo || appTheme.portraitLogo ? (
<img className={`ui ${appTheme.logoWide ? "small" : ""} logo`} src={appTheme.logo || appTheme.portraitLogo} alt={lf("{0} Logo", appTheme.boardName)} />
<img
className={`ui ${appTheme.logoWide ? "small" : ""} logo`}
src={appTheme.logo || appTheme.portraitLogo}
alt={lf("{0} Logo", appTheme.boardName)}
/>
) : (
<span className="name">{appTheme.boardName}</span>
)}
Expand Down Expand Up @@ -69,7 +82,12 @@ export const HeaderBar: React.FC<HeaderBarProps> = () => {
<div className="spacer" />

<div className="header-right">
<Button className="menu-button" leftIcon="fas fa-home large" title={lf("Return to the editor homepage")} onClick={onHomeClicked} />
<Button
className="menu-button"
leftIcon="fas fa-home large"
title={lf("Return to the editor homepage")}
onClick={onHomeClicked}
/>
</div>
</MenuBar>
</header>
Expand Down
13 changes: 11 additions & 2 deletions teachertool/src/components/MakecodeFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export const MakeCodeFrame: React.FC<MakeCodeFrameProps> = () => {
const { state: teacherTool } = useContext(AppStateContext);

function createIFrameUrl(shareId: string): string {
const editorUrl: string = pxt.BrowserUtils.isLocalHost() ? "http://localhost:3232/index.html" : getEditorUrl((window as any).pxtTargetBundle.appTheme.embedUrl);
const editorUrl: string = pxt.BrowserUtils.isLocalHost()
? "http://localhost:3232/index.html"
: getEditorUrl((window as any).pxtTargetBundle.appTheme.embedUrl);

let url = editorUrl;
if (editorUrl.charAt(editorUrl.length - 1) === "/" && !pxt.BrowserUtils.isLocalHost()) {
Expand All @@ -26,7 +28,14 @@ export const MakeCodeFrame: React.FC<MakeCodeFrameProps> = () => {
/* eslint-disable @microsoft/sdl/react-iframe-missing-sandbox */
return (
<div className="makecode-frame-outer" style={{ display: "block" }}>
{teacherTool.projectMetadata && <iframe className="makecode-frame" src={createIFrameUrl(teacherTool.projectMetadata.id)} title={"title"} ref={handleIFrameRef} />}
{teacherTool.projectMetadata && (
<iframe
className="makecode-frame"
src={createIFrameUrl(teacherTool.projectMetadata.id)}
title={"title"}
ref={handleIFrameRef}
/>
)}
</div>
);
/* eslint-enable @microsoft/sdl/react-iframe-missing-sandbox */
Expand Down
25 changes: 23 additions & 2 deletions teachertool/src/state/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,17 @@ type HideModal = ActionBase & {
* Union of all actions
*/

export type Action = PostNotification | RemoveNotification | SetProjectMetadata | SetEvalResult | SetTargetConfig | SetCatalog | SetSelectedCriteria | RemoveCriteriaInstance | ShowModal | HideModal;
export type Action =
| PostNotification
| RemoveNotification
| SetProjectMetadata
| SetEvalResult
| SetTargetConfig
| SetCatalog
| SetSelectedCriteria
| RemoveCriteriaInstance
| ShowModal
| HideModal;

/**
* Action creators
Expand Down Expand Up @@ -116,4 +126,15 @@ const hideModal = (): HideModal => ({
type: "HIDE_MODAL",
});

export { postNotification, removeNotification, setProjectMetadata, setEvalResult, setTargetConfig, setCatalog, setSelectedCriteria, removeCriteriaInstance, showModal, hideModal };
export {
postNotification,
removeNotification,
setProjectMetadata,
setEvalResult,
setTargetConfig,
setCatalog,
setSelectedCriteria,
removeCriteriaInstance,
showModal,
hideModal,
};
4 changes: 3 additions & 1 deletion teachertool/src/transforms/addCriteriaToRubric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export function addCriteriaToRubric(catalogCriteriaIds: string[]) {
for (const catalogCriteriaId of catalogCriteriaIds) {
const catalogCriteria = getCatalogCriteriaWithId(catalogCriteriaId);
if (!catalogCriteria) {
logError(ErrorCode.addingMissingCriteria, "Attempting to add criteria with unrecognized id", { id: catalogCriteriaId });
logError(ErrorCode.addingMissingCriteria, "Attempting to add criteria with unrecognized id", {
id: catalogCriteriaId,
});
continue;
}

Expand Down

0 comments on commit 0470d35

Please sign in to comment.