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 project dashboard (#2303) #2320

Merged
merged 2 commits into from
Feb 1, 2023

Conversation

andre-code
Copy link
Contributor

@andre-code andre-code commented Jan 19, 2023

Project dashboard PR.

Cases covered in this PR:

  • The user has no projects of its own, it must display an informative alert.

Screenshot 2023-01-25 at 10 52 48

  • The user has projects to activate KG, must display the Warning Alert to activate the projects.
    Screenshot 2023-01-25 at 11 05 12

  • The user has no visited any project yet, it should show the button to explore other projects.

Screenshot 2023-01-25 at 10 54 13

  • The user has visited some projects recently, it should show a maximum of 5 projects.

  • The user has own projects, it should not show information alert and show the View all my projects button.

Note: Here we do not cover the session view, in case the project has a running session the Connect button will be displayed instead of the play button, the session view will be implemented in #2306.

Closes #2303

/deploy renku=000-ui-dashboard #persist #cypress

@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 19, 2023 17:05 — with GitHub Actions Inactive
@RenkuBot
Copy link
Contributor

You can access the deployment of this PR at https://renku-ci-ui-2320.dev.renku.ch

Base automatically changed from 2302-entity-list-view to 2286-dashboard January 24, 2023 12:55
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 25, 2023 09:50 — with GitHub Actions Inactive
@andre-code andre-code changed the title WIP: add project dashboard (#2303) feat: add project dashboard (#2303) Jan 25, 2023
@andre-code andre-code marked this pull request as ready for review January 25, 2023 10:20
@andre-code andre-code requested a review from a team as a code owner January 25, 2023 10:20
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 25, 2023 12:24 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 25, 2023 13:07 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 25, 2023 14:28 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 25, 2023 21:23 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 26, 2023 08:22 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 26, 2023 15:14 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 27, 2023 06:20 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 27, 2023 08:01 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 27, 2023 09:20 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 27, 2023 09:51 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 27, 2023 11:19 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 27, 2023 11:21 — with GitHub Actions Inactive
Copy link
Contributor

@ciyer ciyer 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 very good! 🚀

I noticed that some of the changes made for React 18 got lost in the rebase: those should be brought back. Otherwise, I have some questions about code in a small number of places and a few wording change suggestions. But, these are all minor things, and I think this I close to being ready to merge.

@@ -24,52 +24,60 @@
*/

import React from "react";
import { createRoot } from "react-dom/client";
import ReactDOM from "react-dom";
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like some of the changes that came from upgrading to react 18 were lost. The use of createRoot should be brought back.

await act(async () => {
root.render(
ReactDOM.render(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use createRoot / root.render here.

await act(async () => {
root.render(
ReactDOM.render(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should use createRoot / root.render here.

cy.url().should("be.equal", Cypress.config("baseUrl"));
cy.get("[data-cy='username-home']").contains(`${username} @ Renku`);
cy.get("[data-cy='dashboard-title']").contains(`Renku Dashboard - ${user.firstname} ${user.lastname}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cy.get("[data-cy='dashboard-title']").contains(`Renku Dashboard - ${user.firstname} ${user.lastname}`);
cy.get_cy("dashboard-title").contains(`Renku Dashboard - ${user.firstname} ${user.lastname}`);

* useGetRecentlyVisitedProjects.ts
* hook to fetch recent visited projects
*/
function useGetRecentlyVisitedProjects(cantProjects: number) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function useGetRecentlyVisitedProjects(cantProjects: number) {
function useGetRecentlyVisitedProjects(projectsCount: number) {

tests/cypress/e2e/local/dashboard.spec.ts Show resolved Hide resolved
cy.get_cy("inactive-kg-project-alert").should("exist");
});

it("user does not has own project but has visited projects", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it("user does not has own project but has visited projects", () => {
it("user does not have own project but has visited projects", () => {

});
});

it("user does has own projects and recently visited projects", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it("user does has own projects and recently visited projects", () => {
it("user has own projects and recently visited projects", () => {

return total === 0 ?
<InfoAlert timeout={0}>
<div data-cy="project-alert" className="mb-0" style={{ textAlign: "justify" }}>
<h3><strong>You don’t have any project yet.</strong></h3>
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 it would be a bit better like this:

Suggested change
<h3><strong>You don’t have any project yet.</strong></h3>
<h3><strong>You do not have any projects yet.</strong></h3>

else {
projectsToShow = projects?.length > 0 ?
<ProjectListRows projects={projects} gridDisplay={false} />
: <p className="rk-dashboard-section-header">You have no current project yet</p>;
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 current is not necessary here

Suggested change
: <p className="rk-dashboard-section-header">You have no current project yet</p>;
: <p className="rk-dashboard-section-header">You do not have any recently-visited projects</p>;

@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 30, 2023 08:58 — with GitHub Actions Inactive
@andre-code
Copy link
Contributor Author

This looks very good! 🚀

I noticed that some of the changes made for React 18 got lost in the rebase: those should be brought back. Otherwise, I have some questions about code in a small number of places and a few wording change suggestions. But, these are all minor things, and I think this I close to being ready to merge.

Thanks for the review @ciyer, yes I have brought back the changes in the tests and also apply all your suggestions in the last commit, all the text changes makes sense to me.

@andre-code andre-code temporarily deployed to renku-ci-ui-2320 January 30, 2023 09:25 — with GitHub Actions Inactive
@lorenzo-cavazzi lorenzo-cavazzi temporarily deployed to renku-ci-ui-2320 January 31, 2023 14:46 — with GitHub Actions Inactive
@lorenzo-cavazzi lorenzo-cavazzi temporarily deployed to renku-ci-ui-2320 January 31, 2023 15:09 — with GitHub Actions Inactive
@lorenzo-cavazzi lorenzo-cavazzi temporarily deployed to renku-ci-ui-2320 January 31, 2023 23:10 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 February 1, 2023 07:19 — with GitHub Actions Inactive
@andre-code andre-code temporarily deployed to renku-ci-ui-2320 February 1, 2023 08:28 — with GitHub Actions Inactive
@andre-code andre-code deployed to renku-ci-ui-2320 February 1, 2023 08:42 — with GitHub Actions Active
Copy link
Contributor

@ciyer ciyer left a comment

Choose a reason for hiding this comment

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

🎉 Ready to merge!

@andre-code andre-code merged commit d9725c2 into 2286-dashboard Feb 1, 2023
@andre-code andre-code deleted the 2303-project-dashboard branch February 1, 2023 10:05
@RenkuBot
Copy link
Contributor

RenkuBot commented Feb 1, 2023

Tearing down the temporary RenkuLab deplyoment for this PR.

andre-code added a commit that referenced this pull request Feb 7, 2023
andre-code added a commit that referenced this pull request Feb 9, 2023
andre-code added a commit that referenced this pull request Feb 10, 2023
andre-code added a commit that referenced this pull request Feb 13, 2023
andre-code added a commit that referenced this pull request Feb 13, 2023
* feat: add entity list view (#2302)(#2307)
* feat: add project dashboard (#2303) (#2320)
* feat: add dataset dashboard (#2304)(#2330)
* feat: add session list view in dashboard (#2305)(#2333)
* feat: add get logs, stop session and link to Dashboard (#2305) (#2350)
* feat: modify the internal visibility icon, redirect to the dashboard when opening sessions page to authenticated users

Fix #2286

Co-authored-by: Chandrasekhar Ramakrishnan <cramakri@ethz.ch>
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