Skip to content

Fix: Re-export env0 components with plugin api#85

Merged
yaronya merged 6 commits intomainfrom
fix-wrap-exported-components-with-api
Feb 11, 2025
Merged

Fix: Re-export env0 components with plugin api#85
yaronya merged 6 commits intomainfrom
fix-wrap-exported-components-with-api

Conversation

@yaronya
Copy link
Collaborator

@yaronya yaronya commented Feb 11, 2025

Issue & Steps to Reproduce / Feature Request

The exported React components (Env0TabComponent and Env0EnvironmentDetailsCard) were not wrapped with the env0 plugin context, causing an error when attempting to use them.

Solution

Wrap and export the components with the plugin context.
Note: There was an issue with bundling the dayjs package. Since we only need to calculate duration in seconds, I replaced it with native Node.js functionality instead.

QA

Followed our readme and installed the components on a fresh backstage local server ✅

const startedAt = new Date(deployment.startedAt);
const finishedAt = new Date(deployment.finishedAt);

const durationInSeconds = (finishedAt.getTime() - startedAt.getTime()) / 1000;
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't the same 👀
Are we cool with it? it will be showing worse outputs 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.

As discussed, it mimics the same behavior as dayjs.asSeconds() so we're good to go

Copy link
Contributor

@ItamarMalka ItamarMalka left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@yaronya yaronya merged commit 83dc638 into main Feb 11, 2025
3 checks passed
@yaronya yaronya deleted the fix-wrap-exported-components-with-api branch February 11, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants