Skip to content
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

PB-15d: Install bot to slack workspace #21

Merged
merged 12 commits into from
Sep 4, 2023
Merged

Conversation

stianjsu
Copy link

@stianjsu stianjsu commented Aug 24, 2023

Implements functionality for installing the bot to a workspace through the button on landing page.

Also reworks callback-pages to do login and install requests server side. See comment further down

@stianjsu
Copy link
Author

stianjsu commented Aug 24, 2023

Needs a proper way to maintain a uri for accessing backend api with the next server. Right now hardcoded to be http://backend:3000

edit: done

@stianjsu
Copy link
Author

stianjsu commented Aug 24, 2023

redirect flow when requests finishes or fails serverside also needs to be discussed

edit: discussed

@stianjsu stianjsu force-pushed the install-slack-button branch 3 times, most recently from 6ebcc52 to 89f1af0 Compare August 31, 2023 10:52
@stianjsu stianjsu marked this pull request as ready for review August 31, 2023 14:10
@stianjsu
Copy link
Author

stianjsu commented Aug 31, 2023

Previously after redirecting from slack, we made clientside requests to the backend for adding to workspace and logging in.

Now this is done server side in getServerSideProps-functions, which happens before the user gets to visit the intermediate pages for adding to workspace and logging in. (pages/slack/callback.tsx and pages/login/callback.tsx)

Simplified illustration

Previously: (step 4-5 was inconsistent in development mode)
image
(callback-page illustrates functionality in login/index.tsx and login/callback.tsx)

New flow:
image

This saves multiple roundtrips, including some I haven't drawn, making the experience when logging in smoother. Plus it should be more consistent when developing

@stianjsu stianjsu force-pushed the install-slack-button branch from 12d502b to cbaebb7 Compare August 31, 2023 16:14
Copy link
Collaborator

@sergiosja sergiosja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ❤️

.github/workflows/next-frontend.yml Outdated Show resolved Hide resolved
application/next-frontend/pages/login/callback.tsx Outdated Show resolved Hide resolved
application/next-frontend/pages/login/index.tsx Outdated Show resolved Hide resolved
@JacobTheisen
Copy link
Collaborator

Så i grunn nice ut, men noe små greier. Ikke sikkert man trenger å gjøre alt nå i første omgang, så kan eventuelt bare legge det til i backlog for senere.

@stianjsu stianjsu force-pushed the install-slack-button branch from 6c2fe54 to 0e48a0d Compare September 2, 2023 09:24
@annabjorgo
Copy link

annabjorgo commented Sep 3, 2023

lgtm! noen småting bare

har også testen denne på min, og funker 🗻

Copy link
Collaborator

@JacobTheisen JacobTheisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM🚀

@stianjsu stianjsu force-pushed the install-slack-button branch from 3e10927 to 66678c2 Compare September 4, 2023 13:53
@stianjsu stianjsu merged commit 2db167e into main Sep 4, 2023
@stianjsu stianjsu deleted the install-slack-button branch September 4, 2023 13:57
annabjorgo pushed a commit that referenced this pull request Sep 18, 2023
* PB-15d: adds button and redirect link for adding bot to workspace

* PB-15d: reworked login and adding to slack to run serverside

* PB-15d: reworked defention of api-endpoint-uri to seperate client and serverside calls

* PB-15: Fixes workflow and envs for calling backend serverside

* PB-15d: small styling on login and add to workspace flow

* chore: Remove and adds comments

* fix: sets frontenduri to new frontend

* fix: removes misplaced quotation marks

* PB-15d: adds better error feedback to user

* ci: implements lint-staged and typechecking

* ci: sets up prod envs for next-frontend when building

* chore: changes to console.error and removes throw

Fetch restaurants in new frontend (#23)

* created hook for fetching restaurants

* moved every check to a big ternary

Bugfix lmdb installation (#25)

* PB-15d: adds button and redirect link for adding bot to workspace

* PB-15d: reworked login and adding to slack to run serverside

* PB-15d: reworked defention of api-endpoint-uri to seperate client and serverside calls

* PB-15: Fixes workflow and envs for calling backend serverside

* PB-15d: small styling on login and add to workspace flow

* chore: Remove and adds comments

* fix: sets frontenduri to new frontend

* fix: removes misplaced quotation marks

* PB-15d: adds better error feedback to user

* ci: implements lint-staged and typechecking

* ci: sets up prod envs for next-frontend when building

* Bugfix; lmdb return value

* Bugfix; None value check

---------

Co-authored-by: stianjsu <stianjsu@gmail.com>

Mutation reqs (#26)

* Demo for post reqs

* PB-30B: Layout for mutation + toggle active status

* PB-30B: Linter happy?

* PB-30B: prøver på nytt

* PB-30b: some refactoring + support for post and delete

* PB-30b: more refactoring

* PB-30b: refatoring

* PB-30b: typo

create hook for events called useEvents

wip: proposed solution to post events with helper functions

wip: useEvents and posting events

add useEVent in CreateEventCard components

create hook for events called useEvents

wip: useEvents and posting events

add useEVent in CreateEventCard components

small typos

implement events with restaurants

posting and displaying  events now working
annabjorgo pushed a commit that referenced this pull request Sep 18, 2023
* PB-15d: adds button and redirect link for adding bot to workspace

* PB-15d: reworked login and adding to slack to run serverside

* PB-15d: reworked defention of api-endpoint-uri to seperate client and serverside calls

* PB-15: Fixes workflow and envs for calling backend serverside

* PB-15d: small styling on login and add to workspace flow

* chore: Remove and adds comments

* fix: sets frontenduri to new frontend

* fix: removes misplaced quotation marks

* PB-15d: adds better error feedback to user

* ci: implements lint-staged and typechecking

* ci: sets up prod envs for next-frontend when building

* chore: changes to console.error and removes throw
annabjorgo pushed a commit that referenced this pull request Sep 19, 2023
* PB-15d: adds button and redirect link for adding bot to workspace

* PB-15d: reworked login and adding to slack to run serverside

* PB-15d: reworked defention of api-endpoint-uri to seperate client and serverside calls

* PB-15: Fixes workflow and envs for calling backend serverside

* PB-15d: small styling on login and add to workspace flow

* chore: Remove and adds comments

* fix: sets frontenduri to new frontend

* fix: removes misplaced quotation marks

* PB-15d: adds better error feedback to user

* ci: implements lint-staged and typechecking

* ci: sets up prod envs for next-frontend when building

* chore: changes to console.error and removes throw

Fetch restaurants in new frontend (#23)

* created hook for fetching restaurants

* moved every check to a big ternary

Bugfix lmdb installation (#25)

* PB-15d: adds button and redirect link for adding bot to workspace

* PB-15d: reworked login and adding to slack to run serverside

* PB-15d: reworked defention of api-endpoint-uri to seperate client and serverside calls

* PB-15: Fixes workflow and envs for calling backend serverside

* PB-15d: small styling on login and add to workspace flow

* chore: Remove and adds comments

* fix: sets frontenduri to new frontend

* fix: removes misplaced quotation marks

* PB-15d: adds better error feedback to user

* ci: implements lint-staged and typechecking

* ci: sets up prod envs for next-frontend when building

* Bugfix; lmdb return value

* Bugfix; None value check

---------

Co-authored-by: stianjsu <stianjsu@gmail.com>

Mutation reqs (#26)

* Demo for post reqs

* PB-30B: Layout for mutation + toggle active status

* PB-30B: Linter happy?

* PB-30B: prøver på nytt

* PB-30b: some refactoring + support for post and delete

* PB-30b: more refactoring

* PB-30b: refatoring

* PB-30b: typo

create hook for events called useEvents

wip: proposed solution to post events with helper functions

wip: useEvents and posting events

add useEVent in CreateEventCard components

create hook for events called useEvents

wip: useEvents and posting events

add useEVent in CreateEventCard components

small typos

implement events with restaurants

posting and displaying  events now working
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants