-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Url share #147
Url share #147
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
El Header debería decir "nombreDeUsuario
>título del desafío
" con un breadcrumb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -32,6 +32,7 @@ jobs: | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Idem en los otros jobs)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -30,20 +30,20 @@ export const CreatorViewMode = () => { | |||
return (<> | |||
{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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bravo!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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