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

Microsoft Calendar Plugin #16101

Merged

Conversation

Abhay-soni-developer
Copy link
Contributor

🔖 Summary

the request for this feature is here : #16001

the plugin will give a card component where the user can see his daily calendar schedule, and switch between different calendars, if a meeting URL is mentioned, the user can directly click on it to join a meeting and cancelled meetings are stroked.

hovering over any event will pop over a card showing you the list of people invited with a badge over each showing their responses.

microsoft-calendar-plugin-demo.mp4

✌️ Context

Creating a plugin to achieve the following feature:

  1. Select the menu to switch between calendars.
  2. card showing the list of events on a selected date and of the selected calendar
  3. hovering over the event will pop over a card showing the event summary message, and list of attendees.
  4. attendee's chips will have a badge over them symbolizing their responses
    green --> accepted
    red --> declined
    nothing --> not responded yet

@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Feb 1, 2023

Changed Packages

Package Name Package Path Changeset Bump Current Version
example-app packages/app none v0.2.80-next.2
@backstage/plugin-microsoft-calendar plugins/microsoft-calendar minor v0.0.0

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

Uffizzi Preview deployment-13038 was deleted.

Copy link
Member

@benjdlambert benjdlambert left a comment

Choose a reason for hiding this comment

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

Hey 👋 thanks for this!

Looking pretty good code wise, just a few comments to clear up.

Would also be pretty good to write some test for these components that you've got too. I see a lot of test-id being used, but no tests :(

plugins/microsoft-calendar/README.md Outdated Show resolved Hide resolved
plugins/microsoft-calendar/src/hooks/useEventsQuery.ts Outdated Show resolved Hide resolved
plugins/microsoft-calendar/src/components/util.ts Outdated Show resolved Hide resolved
@benjdlambert benjdlambert assigned benjdlambert and unassigned Rugvip Feb 1, 2023
@Abhay-soni-developer
Copy link
Contributor Author

@benjdlambert i have done changes according to feedback, are we good to integrate this.

@benjdlambert
Copy link
Member

Would also be pretty good to write some test for these components that you've got too. I see a lot of test-id being used, but no tests :(

Would it be possible to write some tests for this? Just some simple ones that just render the components and make sure that the expected content is there? It's pretty hard for us to accept other contributions to this plugin when there's no test that ensure that the plugin still works :)

@benjdlambert
Copy link
Member

Another separate question - where did you get the svg icons? Are they open source and licensed properly that we can copy the contents here? This change will also need a changeset too which you can generate using yarn changeset.

@Abhay-soni-developer
Copy link
Contributor Author

Abhay-soni-developer commented Feb 1, 2023

Another separate question - where did you get the svg icons? Are they open source and licensed properly that we can copy the contents here? This change will also need a changeset too which you can generate using yarn changeset.

the icons are from https://www.svgrepo.com which provide open-licensed SVG vectors.
https://www.svgrepo.com/svg/475024/webcam. --> webcam
https://www.svgrepo.com/svg/263516/calendar ---> calendar
these icons are under CC0 license.
@benjdlambert

i will add the changeset right away

@Abhay-soni-developer Abhay-soni-developer requested a review from a team as a code owner February 2, 2023 03:54
@Abhay-soni-developer
Copy link
Contributor Author

Would it be possible to write some tests for this? Just some simple ones that just render the components and make sure that the expected content is there? It's pretty hard for us to accept other contributions to this plugin when there's no test that ensure that the plugin still works :)

i have made changes in dev folder and ensured that there is a working demo available for every user, just one command away. test case's i will try to contribute in the future or will raise it as an issue so if someone is eager can pick it up early.

@benjdlambert
everything is set , plugin is working too. what do you say can we get this integrated ?

Copy link
Collaborator

@awanlin awanlin left a comment

Choose a reason for hiding this comment

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

Really cool contribution, this is something we might add to our homepage in the future, many thanks @Abhay-soni-developer.

Just left some comments about the documentation

'@backstage/plugin-microsoft-calendar': patch
---

created new plugin @backstage/plugin-microsoft-calendar and added it to plugins directory
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be really great to include how to use it here as this changeset will get used as the release notes. For those upgrading theres a good chance this will be the way they learn about this plugin first.

Copy link
Member

Choose a reason for hiding this comment

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

@Abhay-soni-developer this comment still stands I believe

@@ -0,0 +1,19 @@
# microsoft-calendar
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could probably improve this a lot so that people won't run into issues using this. It would be great to have step by step instructions as to how to install - the yarn add command for the package, where does this get added, etc.

Also, looking over the code it assumes Azure AD auth has been setup, it would be good to include information about that here even if it just a link to the main documentation on this topic. Without this information the calendar won't work and people will log issues about it or simply not use the plugin, which would be a shame as it's pretty awesome!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here's an example you can use to help for the installation instructions: https://github.com/backstage/backstage/tree/master/plugins/azure-devops

And here's the docs for the Azure auth: https://backstage.io/docs/auth/microsoft/provider

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok will update readme accordingly and push

Copy link
Contributor Author

Choose a reason for hiding this comment

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

requested changes done @awanlin @benjdlambert are we good to integrate this?

@benjdlambert benjdlambert changed the title Develop/microsoft calendar Microsoft Calendar Plugin Feb 2, 2023
@Abhay-soni-developer Abhay-soni-developer requested a review from a team as a code owner February 6, 2023 06:59
@backstage-goalie
Copy link
Contributor

Thanks for the contribution!
All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

Copy link
Member

@benjdlambert benjdlambert left a comment

Choose a reason for hiding this comment

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

Hey @Abhay-soni-developer! 👋

Some more comments here, but i think we're getting close!

'@backstage/plugin-microsoft-calendar': patch
---

created new plugin @backstage/plugin-microsoft-calendar and added it to plugins directory
Copy link
Member

Choose a reason for hiding this comment

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

@Abhay-soni-developer this comment still stands I believe

---

created new plugin @backstage/plugin-microsoft-calendar and added it to plugins directory
updated example-app homepage to show microsoft-calendar widget.
Copy link
Member

Choose a reason for hiding this comment

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

Can remove this part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed the changeset, if it should be anything else, please let me know and elaborate on what do we need to write here in case of a new plugin.

.github/CODEOWNERS Outdated Show resolved Hide resolved
.changeset/rotten-birds-build.md Outdated Show resolved Hide resolved
plugins/microsoft-calendar/src/components/CalendarCard.tsx Outdated Show resolved Hide resolved
plugins/microsoft-calendar/src/routes.ts Outdated Show resolved Hide resolved
plugins/microsoft-calendar/src/plugin.ts Outdated Show resolved Hide resolved
plugins/microsoft-calendar/src/plugin.ts Outdated Show resolved Hide resolved
return response.json() as Promise<T>;
}

public async getCalendars(params?: any): Promise<MicrosoftCalendar[]> {
Copy link
Member

Choose a reason for hiding this comment

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

Can we type params better here?

Copy link
Contributor Author

@Abhay-soni-developer Abhay-soni-developer Feb 6, 2023

Choose a reason for hiding this comment

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

params will do, they are query path param, or please suggest something better.

Copy link
Member

Choose a reason for hiding this comment

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

I mean the any type. Can we type those?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, removing this as we do not need any query paramters in this request

@Abhay-soni-developer
Copy link
Contributor Author

@benjdlambert i have done the changes that u asked for, please have a look.

Copy link
Member

@benjdlambert benjdlambert left a comment

Choose a reason for hiding this comment

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

Just a few small nits, and you will need to rebase the branch in order to fix the merge conflict in the CODEOWNERS file.

This comment too: #16101 (comment)

Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: Abhay-soni-developer <abhaysoni.developer@gmail.com>
Signed-off-by: blam <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
@Abhay-soni-developer
Copy link
Contributor Author

hey @benjdlambert , i can see that you have made the required changes, is there anything from my side left to do , or we are ready to merge this one.

@benjdlambert benjdlambert merged commit 780ce04 into backstage:master Feb 9, 2023
@benjdlambert
Copy link
Member

Thanks for the effort and the hard work! 🙏

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.11.0 release, scheduled for Tue, 14 Feb 2023.

@Abhay-soni-developer
Copy link
Contributor Author

@benjdlambert @awanlin for your support and appreciations.

@benjdlambert benjdlambert mentioned this pull request Feb 14, 2023
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.

None yet

5 participants