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: Add the template page #1754

Merged
merged 11 commits into from
May 26, 2022
Merged

feat: Add the template page #1754

merged 11 commits into from
May 26, 2022

Conversation

BrunoQuaresma
Copy link
Collaborator

Closes #1734

  • I didn't add tabs. I think we keep it flat for now.
  • I didn't add the Applications column since they are not implemented
  • I didn't add version history for now

Screen Shot 2022-05-25 at 15 50 09

@BrunoQuaresma BrunoQuaresma requested a review from a team as a code owner May 25, 2022 18:51
@BrunoQuaresma BrunoQuaresma self-assigned this May 25, 2022
@@ -143,4 +144,12 @@ const useStyles = makeStyles((theme) => ({
marginRight: theme.spacing(1.5),
},
},

operatingSystem: {
fontSize: 14,
Copy link
Member

Choose a reason for hiding this comment

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

should we try to use a typography property here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Probably yes

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since there are more styles involved I will keep it right now.

const { template } = useParams()

if (!template) {
throw new Error("No template found in the URL")
Copy link
Member

Choose a reason for hiding this comment

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

Should we just redirect?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a "never" state because react-router-dom is handling that for us but I'm doing this here to make TS happy and return the correct type.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Comment could help clarify that

Copy link
Member

@Kira-Pilot Kira-Pilot left a comment

Choose a reason for hiding this comment

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

This looks so spiffy! Really nice job.


export const useOrganizationID = (): string => {
const xServices = useContext(XServiceContext)
const [authState] = useActor(xServices.authXService)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should do useInterpret and useSelector here so it doesn't cause rerenders for any data except the org id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since this is getting authentication data which is a global state I would use the XServiceContext. About the selector for organization Id, I think it is a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh you're right, we don't need useInterpret here. But I think we should not have useActor. In fact I don't know if we need a hook for this, you could do it like this

const myOrgId = useSelector(xServices.authXService, selectOrgId)

site/package.json Outdated Show resolved Hide resolved
@BrunoQuaresma BrunoQuaresma enabled auto-merge (squash) May 26, 2022 16:14
@BrunoQuaresma BrunoQuaresma merged commit 104d07f into main May 26, 2022
@BrunoQuaresma BrunoQuaresma deleted the bq/add-template-page branch May 26, 2022 16:19
kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
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.

Add template page
4 participants