Skip to content

feat: add open in coder docs, fix missing templates #4124

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

Merged
merged 9 commits into from
Sep 22, 2022

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Sep 19, 2022

Changes

  • adds docs for the first version of the Open in Coder button
  • fix template missing error
  • add Open in Coder button to dogfood README

Screenshots

This is what the new error looks like on the Template page
erro-template

Part 1 of ? for #3981

Changes to address

  • remove query param on index page
  • change docs
  • add example to the dogfood docs
  • update PR description

@jsjoeio jsjoeio added the docs Area: coder.com/docs label Sep 19, 2022
@jsjoeio jsjoeio requested a review from bpmct September 19, 2022 20:44
@jsjoeio jsjoeio self-assigned this Sep 19, 2022
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Sep 19, 2022

@bpmct would love early feedback on these docs. Also, do we have an "Open in Coder" image asset we can use?

@bpmct
Copy link
Member

bpmct commented Sep 20, 2022

Also, do we have an "Open in Coder" image asset we can use?

Yep, we have https://cdn.coder.com/embed-button.svg

@jsjoeio jsjoeio force-pushed the jsjoeio/template-param branch from f3b3d90 to 0ca4c35 Compare September 20, 2022 16:44

The underlying link for this button consists of the following pieces:
- <deployment-url>: where your Coder deployment lives i.e. https://dev.coder.com
- <query-params>: optional query parameters to customize the experience
Copy link
Member

Choose a reason for hiding this comment

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

Why not add each query parameter here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As in replace <query-params> with each query param here? I think I know what you're saying but feel free to add a suggestion!

@jsjoeio jsjoeio force-pushed the jsjoeio/template-param branch from c9cceba to 6831f8b Compare September 20, 2022 20:24
This adds new documentation for the "Open in Coder" button that admins
can use to get their developers up and running faster.
Previously, we weren't handling a case where we tried to get a template
that returned a 404 from the backend.

Now we handle that case in our state machine and display the error
message from the API on the frontend.
This adds support to navigate directly to a template from the index by
using the `?template=<name>` query  param.
@jsjoeio jsjoeio force-pushed the jsjoeio/template-param branch from 6831f8b to bad7ffb Compare September 20, 2022 20:28
@jsjoeio jsjoeio marked this pull request as ready for review September 20, 2022 20:32
@jsjoeio jsjoeio requested a review from a team as a code owner September 20, 2022 20:32
@jsjoeio jsjoeio requested review from presleyp and bpmct and removed request for a team September 20, 2022 20:32
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Sep 20, 2022

@bpmct This completes the work for support of the template query param. My thinking is to merge this and then I add all the other query params in subsequent PRs.

Copy link
Contributor

@presleyp presleyp left a comment

Choose a reason for hiding this comment

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

The machine looks good! I noticed that if I fake an SSE error, I see "an unknown error has occurred". This can be for a later PR but it would be good to have an informative error message.

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Sep 20, 2022

I noticed that if I fake an SSE error, I see "an unknown error has occurred". This can be for a later PR but it would be good to have an informative error message.

I'm less familiar with how that should work so I'd love to pair on it in a later PR if you're up for it!

@jsjoeio jsjoeio marked this pull request as draft September 21, 2022 16:41
This reverts commit bad7ffb.

We decided to use the `/template/path` route instead.
@jsjoeio jsjoeio changed the title feat: add open in coder feat: add open in coder docs, fix missing templates Sep 21, 2022
@jsjoeio jsjoeio removed the docs Area: coder.com/docs label Sep 21, 2022
@jsjoeio jsjoeio marked this pull request as ready for review September 21, 2022 18:38
@jsjoeio jsjoeio requested a review from kylecarbs September 21, 2022 18:38
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Sep 21, 2022

@bpmct ready for another review!

@jsjoeio jsjoeio mentioned this pull request Sep 21, 2022
Copy link
Member

@bpmct bpmct left a comment

Choose a reason for hiding this comment

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

What's the plan for the additional functionality (e.g. autofill query parameters, detect if workspace exists, etc)? Are you planning on doing that after this in a separate PR?

jsjoeio and others added 2 commits September 21, 2022 14:37
Co-authored-by: Ben Potter <ben@coder.com>
Co-authored-by: Ben Potter <ben@coder.com>
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Sep 21, 2022

What's the plan for the additional functionality (e.g. autofill query parameters, detect if workspace exists, etc)? Are you planning on doing that after this in a separate PR?

Yes, exactly! Next PR after this will be createWorkspace, implemented per the spec.

@jsjoeio jsjoeio requested a review from bpmct September 21, 2022 21:44
@jsjoeio jsjoeio removed the request for review from kylecarbs September 22, 2022 15:39
@jsjoeio jsjoeio merged commit 7646000 into main Sep 22, 2022
@jsjoeio jsjoeio deleted the jsjoeio/template-param branch September 22, 2022 15:48
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