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

Feat/environment view #1053

Merged
merged 64 commits into from Jul 14, 2020
Merged

Feat/environment view #1053

merged 64 commits into from Jul 14, 2020

Conversation

EmilK15
Copy link
Contributor

@EmilK15 EmilK15 commented Jun 22, 2020

Related Issue

Closes #863

Your solution

Added information icon next to the name of the environment.
Added EnvironmentInfoDialog component which will display and allow users to copy the URL of their api endpoints.

How Has This Been Tested?

Made sure that if you switch to different environments that the dialog also gets updated

Screenshots (if relevant):

image

image

@EmilK15 EmilK15 added this to the Release 2020/06/23 milestone Jun 22, 2020
@adrians5j
Copy link
Member

adrians5j commented Jun 22, 2020

I'd go with a green icon instead of a black one on the menu. Can't really see it. Not sure how the other icons are being shown in dark mode. 🤔

Are all icons black?

BTW, not sure if you've seen this comment: #863 (comment)

Let's check those, and the remaining stuff after we do the current release. I like the general idea in the dialog, but I feel some additional styling might be added (for example, different fonts for the subtitle and the actual link).

@EmilK15
Copy link
Contributor Author

EmilK15 commented Jun 22, 2020

Okay yea I can add it to the places we mentioned before:
i.e Add CMS links in environment aliases views.
Also add it in the Access Tokens form.

@adrians5j adrians5j modified the milestones: Release 2020/06/23, Release 2020/06/30 Jun 23, 2020
@adrians5j
Copy link
Member

adrians5j commented Jun 24, 2020

BTW, the dialog is wrong here, because it's not showing all of the possible env aliases that the current env might have.

Please check this comment.

@EmilK15
Copy link
Contributor Author

EmilK15 commented Jun 25, 2020

Updated the the EnvironmentInfoDialog so that it now loads all relevant aliases to the environment you clicked.
Styled the text so it looks much nicer and different.
image

@EmilK15 EmilK15 self-assigned this Jun 26, 2020
@EmilK15
Copy link
Contributor Author

EmilK15 commented Jun 26, 2020

See the below menu with the added icon.
Adrian and I were talking about what the layout should be in a way that doesn't intrude on the environment name being cut off:
image
One way is we can remove the left Icon and reduce the space specifically for the information icon and go from there.
We could also move the information icon elsewhere so that part of the menu isn't too crowded.
Some other opinions might be helpful to come to a good solution.

@EmilK15
Copy link
Contributor Author

EmilK15 commented Jun 29, 2020

After talking with the team, I'll be changing the icon to be added to the FooterMenu.

@EmilK15
Copy link
Contributor Author

EmilK15 commented Jun 29, 2020

Added the API Information to the FooterMenu and can see the updated menu here:
image

@EmilK15
Copy link
Contributor Author

EmilK15 commented Jun 30, 2020

Fixed API Information so it looks like this now:
image
Now EnvironmentInfoDialog looks like the following:
image

@Pavel910
Copy link
Collaborator

Pavel910 commented Jul 3, 2020

@doitadrian the idea was to have one single place with all API URLs. So users don't have to use terminal to find the main GraphQL API URL. I agree that we need to iterate on this visually, just to make real distinction between the 2 sections, but I would definitely keep this information all in one place.

@adrians5j
Copy link
Member

Agreed, I'm also for keeping åll of the info in one place. 👍 👍

@Pavel910 Pavel910 removed this from the Release 2020/06/30 milestone Jul 5, 2020
@EmilK15
Copy link
Contributor Author

EmilK15 commented Jul 6, 2020

Made the following changes as:
Note: Making the text smaller for the other subtitles looked weird as it would be a smaller size than the actual url, so instead I had the new label match the height of the dialog title and kept the rest the same.
Environment Aliases
image
image
When clicking API information:
image

Copy link
Member

@adrians5j adrians5j left a comment

Choose a reason for hiding this comment

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

Please check my comment.

BTW please also divide GraphQL API row from the Headless CMS - Production section title.

@@ -10,6 +10,7 @@
"author": "Pavel Denisjuk",
"license": "MIT",
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
Copy link
Member

Choose a reason for hiding this comment

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

What's this for? o.O

@@ -0,0 +1,136 @@
import gql from "graphql-tag";

const fields = `
Copy link
Member

@adrians5j adrians5j Jul 7, 2020

Choose a reason for hiding this comment

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

These queries are specific to app-headless-cms, and are made in the app-admin package.

This should not be here.

I suggest you leave this dialog here, but make it also pluggable, so that the additional Headless CMS URLs section can be added from that app, via a plugin.

I see you have the EnvironmentInfoDialog component there. I would rename it to APIInformationDialog, and add the Headless CMS section via a new app-plugin-admin-information-dialog plugin.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@EmilK15 this is the same thing you did for the WelcomeScreen. Create a skeleton which uses plugins, but the plugins themselves must come from other apps. App dependencies must not be hardcoded inside the packages, meaning, app-admin must NOT depend on any other app, because it's a skeleton, not an actual implementation. That's the whole point of plugins.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @Pavel910 for additional explanation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great points,
So to recap the plan is for that the component within app-admin will render a plugin that will be defined within app-headless-cms which will contain the environment information content.
In doing this we won't need to make a query that was specific to app-headless-cms from app-admin.
Makes sense to me

Copy link
Member

Choose a reason for hiding this comment

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

Cool, let us know if you'll need any help with this.

@adrians5j adrians5j added this to Review in progress in Headless CMS via automation Jul 7, 2020
@EmilK15
Copy link
Contributor Author

EmilK15 commented Jul 9, 2020

Moved method into plugin: Added different views depending on what you click on:
Api Documentation: (now shows GraphQL API, no other view does this)
image
Environment Aliases view now only shows the links for the selected Alias: (no graphql api)
image
Environments now shows links for every alias specific to that environment (no graphql api)
image

Headless CMS automation moved this from Review in progress to Reviewer approved Jul 14, 2020
@adrians5j adrians5j merged commit 516de84 into master Jul 14, 2020
Headless CMS automation moved this from Reviewer approved to Done Jul 14, 2020
@EmilK15 EmilK15 added the blog Use on PRs to include them in the change log. label Jul 14, 2020
@adrians5j adrians5j deleted the feat/environment-view branch July 19, 2020 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blog Use on PRs to include them in the change log.
Projects
No open projects
Headless CMS
  
Done
Development

Successfully merging this pull request may close these issues.

Headless CMS - Add a view with all API URLs
5 participants