Conversation
asanzo
left a comment
There was a problem hiding this comment.
Buenas!!!
Me quedé sin tiempo para esto por hoy, me tengo que poner a hacer otras cosas. Dejo el comment con los comentarios que fui viendo.
¡No olvidar pensar algunos tests! Para empezar, el test que menciono en el back, si es que la lógica de cambio de usuario está acá en el front.
| const APP_URL = 'https://pilasbloques.program.ar/online' | ||
| const DEV_URL = 'localhost:3000' |
There was a problem hiding this comment.
Esto está mal, debería no estar hardcodeado. Si quieren pasen esto a un issue.
Opción A
Jugar con el window.location.href
Opción B
Estar en un env.
Ya lo hacemos para la API (donde no podemos jugar con el location.href) :
Podría ser en el .env (y en el sample.env) un REACT_APP_URL=localhost:3000
Pero OJO, que hay que cambiar tmb en el workflow en el momento del build, como acá:
No hace falta que un secret (de hecho, para la api tampoco!), puede ser directamente el string:
Ahí podría ser REACT_APP_URL: 'https://pilasbloques.program.ar/online'
There was a problem hiding this comment.
De hecho, si me lo pongo a pensar como app que cualquiera puede levantar en cualquier URL, la opción A es la más razonable.
| return (<> | ||
| {challengeExists ? ( | ||
| <> | ||
| <Header/> |
There was a problem hiding this comment.
El Header debería decir "nombreDeUsuario>título del desafío" con un breadcrumb
asanzo
left a comment
There was a problem hiding this comment.
Felicitaciones, gente, LA BU RA ZO @dlopezalvas @tfloxolodeiro 👏 👏 👏
Lo que menciono en mi review anterior del header lo podemos patear. Dejé un par de comments abajo pero está mergeable, felicitaciones. ALTO FEATURE LOCO
| runs-on: ubuntu-latest | ||
| env: | ||
| REACT_APP_API_URL: ${{ secrets.API_URL }} | ||
| REACT_APP_PB_APP_URL: ${{ secrets.APP_URL }} |
There was a problem hiding this comment.
La de arriba y esta pueden ser directamente
REACT_APP_API_URL: "https://pilasbloques.program.ar/api"
REACT_APP_PB_APP_URL: "https://pilasbloques.program.ar/online/#/" (no sé bien cómo deben ser los caracteres finales, pero puede ser así, no son secretas esas url)
src/components/creator/Editor/ActionButtons/ShareChallenge/ShareModalButtons.tsx
Outdated
Show resolved
Hide resolved
| const challenge: SerializedChallenge = LocalStorage.getCreatorChallenge()! | ||
| const sharedChallenge = await PilasBloquesApi.shareChallenge(challenge) | ||
| return sharedChallenge.sharedId |
There was a problem hiding this comment.
Esta lógica está repetida en ambos ShareUrlButton y SaveButton. Debería estar abajo en ChallengeUpsertButton.
Y si me apurás, también quiero el Snackbar del SaveButton en el botón compartir, porque después de todo estás guardando, está bien que le usuarie sepa que estamos guardando en ese momento.
el parámetro challengeUpsert no debería ser necesario.
There was a problem hiding this comment.
Estos componentes quedaron re prolijos, gente, felicitaciones ❤️ . Estoy contento con cómo quedó. Hice un comment abajo sobre un posible refactor y pequeño cambio de lógica.
| {challengeExists ? ( | ||
| <> | ||
| <Header CenterComponent={<CreatorViewHeader challenge={challengeBeingEdited} />} SubHeader={<EditorSubHeader viewButton={<ReturnToEditionButton />} />} /> | ||
| <Header CenterComponent={<CreatorViewHeader title={challengeBeingEdited.title} />} SubHeader={<EditorSubHeader viewButton={<ReturnToEditionButton />} />} /> |
There was a problem hiding this comment.
No entendí por qué pasa esto ahora...
| const challenge = LocalStorage.getImportedChallenge() | ||
|
|
||
| return <> | ||
| <Header CenterComponent={<CreatorViewHeader title={challenge.titulo} />} /> |
There was a problem hiding this comment.
Epa, por qué el titulo viene en español??
| const shareChallenge = async () => { | ||
| renderComponent(<CreatorContextProvider><ShareModal/></CreatorContextProvider>) | ||
| const shareButton = await screen.findByTestId('upsertButton') | ||
| await act(async () => {shareButton.click()}) | ||
| } |
There was a problem hiding this comment.
VAMO TODAVÍA CON LOS TESTS DE FRONT 👏👏👏👏👏👏👏
…reModalButtons.tsx Co-authored-by: asanzo <[email protected]>
Co-authored-by: asanzo <[email protected]>
Resolves Program-AR/pilas-bloques-ember#1290
Backend Program-AR/pilas-bloques-backend#16