Skip to content

Commit

Permalink
Merge pull request #320 from Program-AR/post-qa
Browse files Browse the repository at this point in the history
Cositas varias de la nueva pantalla
  • Loading branch information
dlopezalvas authored Dec 2, 2024
2 parents 4c8405b + 121f1bd commit cd8c7ab
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 66 deletions.
2 changes: 1 addition & 1 deletion locales/es-ar/creator.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"definition": "la puma",
"interests": "La comida.",
"personality": "Hambrienta (¡siempre es buen momento para comer!).",
"origin": "Cordillera patagónica",
"origin": "Cordillera patagónica.",
"curiousFact": "Su plato favorito es el churrasco y le encanta hacer asados.",
"goals": {
"steak": "Comer los churrascos."
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pilasbloques",
"version": "2.6.1",
"version": "2.6.2",
"productName": "Pilas Bloques",
"genericName": "Programacion con bloques",
"description": "Una herramienta para aprender a programar utilizando bloques",
Expand Down Expand Up @@ -56,7 +56,7 @@
"babel-preset-react-app": "^10.0.1",
"bfj": "^7.0.2",
"blockly": "^10.4.3",
"blockly-proceds": "^1.0.15",
"blockly-proceds": "^1.0.16",
"browserslist": "^4.18.1",
"camelcase": "^6.2.1",
"case-sensitive-paths-webpack-plugin": "^2.4.0",
Expand Down
10 changes: 5 additions & 5 deletions src/components/blockly/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ export const commonBlocks: BlockType[] = [
intlId: 'while',
categoryId: 'repetitions'
},
{
id: 'OpComparacion',
intlId: 'logic_compare',
categoryId: 'operators'
},
{
id: 'OpAritmetica',
intlId: 'math_arithmetic',
Expand All @@ -175,6 +170,11 @@ export const commonBlocks: BlockType[] = [
]

const notUsedBlocks: BlockType[] = [
{
id: 'OpComparacion',
intlId: 'logic_compare',
categoryId: 'operators'
},
{
id: 'SiguienteColumna',
intlId: 'nextColumn',
Expand Down
2 changes: 1 addition & 1 deletion src/components/creator/ActorSelection/ActorSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const ActorSelection = () => {
return (
<Stack alignItems="center" height="inherit" sx={{backgroundColor: theme.palette.background.paper}}>
<Header CenterComponent={
<BetaBadge smaller={true}><HeaderText text={t("selection.title")}/></BetaBadge>}/>
<HeaderText text={t("selection.title")}/>}/>
<ChallengeInProgressDialog />
<Stack className={styles['selection']}
style={isSmallScreen ? {} : {height: "100%"}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import { useThemeContext } from "../../../../../theme/ThemeContext";

export const ToolBoxEditor = () => {

const shouldShow = process.env.NODE_ENV !== 'production'

const [contentHeight,] = useState(window.innerHeight*0.7)
const [contentHeight,] = useState(window.innerHeight * 0.7)

const { t } = useTranslation('creator');
const { isSmallScreen } = useThemeContext()
Expand Down Expand Up @@ -63,17 +61,15 @@ export const ToolBoxEditor = () => {
onCancel={handleOnCancel}
title={`${t('toolbox.title')}${t(`selection.cards.${challenge.scene.type}.name`)}`}
noScrollable={true}
dialogProps={{ maxWidth: "md"}}>
dialogProps={{ maxWidth: "md" }}>
<Stack direction="row">
<PBCard sx={{display:"flex", maxWidth: isSmallScreen ? '50%' : 'inherit', flexDirection:"column", padding:"5px", maxHeight:`${contentHeight}px`}}>
<CategorizedToggle toolboxState={toolboxState} isCategorized={isCategorized} setIsCategorized={setIsCategorized}/>
<BlocksSelector toolboxState={toolboxState} setToolBoxItems={setToolBoxItems} toolBoxItems={toolBoxItems} availableBlocks={availableBlocksFor(challenge!.scene.type)}/>
<PBCard sx={{ display: "flex", maxWidth: isSmallScreen ? '50%' : 'inherit', flexDirection: "column", padding: "5px", maxHeight: `${contentHeight}px` }}>
<CategorizedToggle toolboxState={toolboxState} isCategorized={isCategorized} setIsCategorized={setIsCategorized} />
<BlocksSelector toolboxState={toolboxState} setToolBoxItems={setToolBoxItems} toolBoxItems={toolBoxItems} availableBlocks={availableBlocksFor(challenge!.scene.type)} />
</PBCard>
{shouldShow ? <ToolboxPreview
<ToolboxPreview
blockIds={toolBoxItems}
categorized={isCategorized || toolboxState.categorizationShouldBeForced()}/>
:<></>
}
categorized={isCategorized || toolboxState.categorizationShouldBeForced()} />
</Stack>
</GenericModalDialog>
</>
Expand Down Expand Up @@ -108,7 +104,7 @@ export class ToolboxState {
return this.categories.find(category => category.id === categoryId)!.isSelected()
}

categorizationShouldBeForced() {
categorizationShouldBeForced() {
return this.isCategorySelected(PROCEDURE_CATEGORY) //If this category is selected, the categorization should always be enabled
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const ToolboxPreview = ({ categorized, blockIds }: ToolboxPreviewProps) =
} : {} // used only in toolboxpreview to show blocks under the categories

return <PBBlocklyWorkspace
sx={{ minWidth: isSmallScreen ? "auto" : "50%", padding: "5px", display: "flex", flexDirection: "column", ...sx }}
sx={{ minWidth: isSmallScreen ? "auto" : "58%", padding: "5px", display: "flex", flexDirection: "column", ...sx }}
title
blockIds={blockIds}
categorized={categorized}
Expand Down
15 changes: 6 additions & 9 deletions src/components/creator/Editor/CreatorViewMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export const CreatorViewMode = () => {
{challengeExists ? (
<>
<Header CenterComponent={<CreatorViewHeader title={challengeBeingEdited.title} />} SubHeader={<EditorSubHeader viewButton={<ReturnToEditionButton />} />} />
<ChallengeView height='calc(95% - var(--creator-subheader-height))' path={EMBER_IMPORTED_CHALLENGE_PATH}/>
<ChallengeView height='calc(95% - var(--creator-subheader-height))' path={EMBER_IMPORTED_CHALLENGE_PATH} />

</>
) : <></>}
</>)
Expand All @@ -39,11 +39,8 @@ export const CreatorViewMode = () => {
export const CreatorViewHeader = ({ title }: { title: string }) => {
const { t } = useTranslation('creator')

return <BetaBadge smaller={true}>
<PBreadcrumbs>
<HeaderText text={t("editor.previewModeHeader")} />
<Typography>{title}</Typography>
</PBreadcrumbs>
</BetaBadge>

return <PBreadcrumbs>
<HeaderText text={t("editor.previewModeHeader")} />
<Typography>{title}</Typography>
</PBreadcrumbs>
}
26 changes: 12 additions & 14 deletions src/components/creator/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@ export const CreatorEditor = () => {
}, [challengeExists, navigate])

return (
<>
{ challengeExists ?
(<CreatorContextProvider>
<Stack alignItems="center" height="inherit" sx={{ backgroundColor: theme.palette.background.paper }}>
<Header CenterComponent={<BetaBadge smaller={true}>
<HeaderText text={t("editor.editorHeader")} />
</BetaBadge>}
SubHeader={<EditorSubHeader viewButton={shouldShow ? <EmberPreviewButton /> : undefined} reactViewButton={<PreviewButton /> } />} />
<Stack justifyContent="center" height="100%" width="100%" sx={{ maxWidth: 'var(--creator-max-width)', maxHeight: 'var(--creator-max-height)' }}>
<SceneEdition />
<>
{challengeExists ?
(<CreatorContextProvider>
<Stack alignItems="center" height="inherit" sx={{ backgroundColor: theme.palette.background.paper }}>
<Header CenterComponent={<HeaderText text={t("editor.editorHeader")} />}
SubHeader={<EditorSubHeader viewButton={shouldShow ? <EmberPreviewButton /> : undefined} reactViewButton={<PreviewButton />} />} />
<Stack justifyContent="center" height="100%" width="100%" sx={{ maxWidth: 'var(--creator-max-width)', maxHeight: 'var(--creator-max-height)' }}>
<SceneEdition />
</Stack>
</Stack>
</Stack>
</CreatorContextProvider>
) : <></>}
</CreatorContextProvider>
) : <></>}
</>

)
Expand All @@ -59,5 +57,5 @@ export const EditorSubHeader = (props: EditorSubHeaderProps) =>
<DiscardChallengeButton />
{props.viewButton}
{props.reactViewButton}
<ShareButton/>
<ShareButton />
</CreatorSubHeader>
13 changes: 5 additions & 8 deletions src/components/creator/Editor/EmberCreatorViewMode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const EmberCreatorViewMode = () => {
<>
<Header CenterComponent={<EmberCreatorViewHeader title={challengeBeingEdited.title} />} SubHeader={<EditorSubHeader viewButton={<ReturnToEditionButton />} />} />
<EmberView height='calc(100% - var(--creator-subheader-height))' path={EMBER_IMPORTED_CHALLENGE_PATH} />

</>
) : <></>}
</>)
Expand All @@ -42,11 +42,8 @@ export const EmberCreatorViewMode = () => {
export const EmberCreatorViewHeader = ({ title }: { title: string }) => {
const { t } = useTranslation('creator')

return <BetaBadge smaller={true}>
<PBreadcrumbs>
<HeaderText text={t("editor.previewModeHeader")} />
<Typography>{title}</Typography>
</PBreadcrumbs>
</BetaBadge>

return <PBreadcrumbs>
<HeaderText text={t("editor.previewModeHeader")} />
<Typography>{title}</Typography>
</PBreadcrumbs>
}
2 changes: 0 additions & 2 deletions src/components/creator/Selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ export const CreatorSelection = () => {
<Header />
<ChallengeInProgressDialog />
<Container className={styles['selection']} maxWidth={false}>
<BetaBadge sx={{marginTop: 2}}>
<Typography className={styles['selection-text']} variant="h4">{t("selection.title")}</Typography>
</BetaBadge>
<Typography className={styles['selection-text']} variant="h5">{t("selection.subtitle")}</Typography>

<CharacterCards />
Expand Down
2 changes: 0 additions & 2 deletions src/components/home/CreateChallengeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ export const CreatorCard = (props: CreatorCardProps) => {
<div className={creatorCardsStyles['creator-card-icon']} >
<props.icon style={{fontSize: '2.5em'}} />
</div>
<BetaBadge invisible={!props.visibleBadge}>
<div className={creatorCardsStyles['creator-card-text']}>
<Typography color='black' align="center" fontWeight="400" >{props.text}</Typography>
</div>
</BetaBadge>
</Card>
)
}

0 comments on commit cd8c7ab

Please sign in to comment.