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

#VULCAN-274/ Group reports in a page and minimise reports functionality #707

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

m-o-n-i-s-h
Copy link
Contributor

Group Reports and Minimize Reports Functionality

Features

  • Group one or more reports and we can specify a border and border colour to those grouped reports.
  • Minimize button for reports.
  • Added an option in table report config called compact canvas. when the query status is NO_DATA the card height is set to default 210px.
    MicrosoftTeams-image
    MicrosoftTeams-image (2)

Note: This implementation can be only be done through JSON for now. If you are okay with this implementation. Then I can create some component through which user can configure the group reports.

Sample JSON

{
    "title": "My dashboard",
    "version": "2.3",
    .......
    "pages": [
      {
        "title": "Main Page",
        "groups": [
          {
            "groupId": 1, // Group Id
            "border": "5px solid",
            "borderColor": "red"
          }
        ],
        "reports": [
          {
            "id": "322e3326-29f9-42d5-972b-e0b0b78ca581",
            "groupId": 1, // Group Id
            "groupOrder": 1, // Group order is used to achieve horizontal compaction
         .....
          },{
            "id": "483908d-29f9-42d5-972b-e0b0b78ca581",
            "groupId": 1, // Group Id
            "groupOrder": 2, // Group order is used to achieve horizontal compaction and it is incremental
         .....
          },
     ]
}

NOTICE
The program was tested solely for our own use cases, which might differ from yours.

Author Info: Monish [email protected] on behalf of Mercedes-Benz Research and Development India

https://github.com/mercedes-benz/mercedes-benz-foss/blob/master/PROVIDER_INFORMATION.md

Sample JSON
sample-moview-json.txt

Signed off: Monish [email protected]

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Attention: Patch coverage is 42.59259% with 62 lines in your changes are missing coverage. Please review.

Project coverage is 38.77%. Comparing base (19b7538) to head (4252df5).
Report is 45 commits behind head on develop.

❗ Current head 4252df5 differs from pull request most recent head cef1bcd. Consider uploading reports for the commit cef1bcd to get more accurate results

Files Patch % Lines
src/page/Page.tsx 51.42% 17 Missing ⚠️
src/page/PageReducer.ts 0.00% 13 Missing ⚠️
src/page/PageThunks.ts 16.66% 10 Missing ⚠️
src/component/groupreport/GroupReport.tsx 27.27% 8 Missing ⚠️
src/page/PageToolBox.tsx 0.00% 7 Missing ⚠️
src/report/Report.tsx 60.00% 6 Missing ⚠️
src/card/Card.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #707      +/-   ##
===========================================
+ Coverage    37.49%   38.77%   +1.27%     
===========================================
  Files          216      205      -11     
  Lines         9140     8565     -575     
  Branches      2703     2528     -175     
===========================================
- Hits          3427     3321     -106     
+ Misses        5654     5185     -469     
  Partials        59       59              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Nov 23, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
1.0% 1.0% Duplication

@alfredorubin96
Copy link
Collaborator

alfredorubin96 commented Apr 11, 2024

Thank you for your work, could you please:

  • add cypress test for this functionality
  • attach a video of how it works
  •  add documentation of how it works

Copy link

sonarcloud bot commented May 6, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
7.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@m-o-n-i-s-h
Copy link
Contributor Author

@alfredorubin96 , Added a GIF for your reference. This feature helps us to group two or more reports in a page.

// This is a sample dashboard json payload

{
  "title": "My dashboard",
  "version": "2.4",
  "settings": {
    "pagenumber": 0,
    "editable": true,
    "fullscreenEnabled": false,
    "parameters": {},
    "theme": "light"
  },
  "pages": [
    {
      "title": "Main Page",
      "groups": [
        {
          "groupId": 1,
          "border": "5px solid",
          "borderColor": "red"
        }
      ],
      "reports": [
        {
          "id": "50bbc9f4-dbec-4e41-8471-62b5a091b883",
          "title": "Not a group report",
          "query": "MATCH (n)-[e]->(m) RETURN n,e,m LIMIT 20\n\n\n",
          "width": 6,
          "height": 4,
          "x": 0,
          "y": 4,
          "type": "graph",
          "selection": {
            "Person": "name",
            "ACTED_IN": "(label)",
            "Movie": "title",
            "DIRECTED": "(label)",
            "PRODUCED": "(label)"
          },
          "settings": {},
          "schema": [
            [
              "Person",
              "born",
              "name"
            ],
            [
              "ACTED_IN",
              "roles"
            ],
            [
              "Movie",
              "tagline",
              "title",
              "released"
            ],
            [
              "DIRECTED"
            ],
            [
              "PRODUCED"
            ]
          ]
        },
        {
          "id": "6060fb1d-978b-429a-a020-3de2634cc711",
          "title": "Some random report",
          "query": "MATCH (n)-[e]->(m) RETURN n,e,m LIMIT 20\n\n\n",
          "width": 6,
          "height": 4,
          "x": 6,
          "y": 4,
          "type": "graph",
          "selection": {
            "Person": "name",
            "ACTED_IN": "(label)",
            "Movie": "title",
            "DIRECTED": "(label)",
            "PRODUCED": "(label)"
          },
          "settings": {
            "minimizable": true
          },
          "schema": [
            [
              "Person",
              "born",
              "name"
            ],
            [
              "ACTED_IN",
              "roles"
            ],
            [
              "Movie",
              "tagline",
              "title",
              "released"
            ],
            [
              "DIRECTED"
            ],
            [
              "PRODUCED"
            ]
          ]
        },
        {
          "id": "6a68555a-f891-493b-851a-dc15a34d948d",
          "groupId": 2,
          "groupOrder": 1,
          "title": "Group report 2 - A",
          "query": "MATCH (p:Person)-[:ACTED_IN]->(m:Movie)\nRETURN p, m.title",
          "width": 6,
          "height": 4,
          "x": 12,
          "y": 0,
          "type": "graph",
          "selection": {
            "Person": "name"
          },
          "settings": {
            "minimizable": true
          },
          "schema": [
            [
              "Person",
              "born",
              "name"
            ]
          ]
        },
        {
          "id": "8e632236-445b-483e-9540-627d3c8d34b7",
          "groupId": 2,
          "groupOrder": 2,
          "title": "Group report 2 - B",
          "query": "MATCH (p:Person)-[:ACTED_IN]->(m:Movie)\nRETURN p, collect(m.title)\n\n",
          "width": 6,
          "height": 4,
          "x": 18,
          "y": 0,
          "type": "graph",
          "selection": {
            "Person": "name"
          },
          "settings": {
            "minimizable": true
          },
          "schema": [
            [
              "Person",
              "born",
              "name"
            ]
          ]
        },
        {
          "id": "322e3326-29f9-42d5-972b-e0b0b78ca581",
          "groupId": 1,
          "groupOrder": 1,
          "title": "Group report 1 - A",
          "query": "**This is your first dashboard!** \n \nYou can click (⋮) to edit this report, or add a new report to get started. You can run any Cypher query directly from each report and render data in a variety of formats. \n \nTip: try _renaming_ this report by editing the title text. You can also edit the dashboard header at the top of the screen.\n\n\n",
          "width": 6,
          "height": 4,
          "x": 0,
          "y": 0,
          "type": "text",
          "selection": {},
          "settings": {
            "minimizable": true
          }
        },
        {
          "id": "c753770c-e1f7-41a7-b4d2-ddc418fcefb8",
          "groupId": 1,
          "groupOrder": 2,
          "title": "Group report 1 - B",
          "query": "MATCH (n)-[e]->(m) RETURN n,e,m LIMIT 20\n\n\n",
          "width": 6,
          "height": 4,
          "x": 6,
          "y": 0,
          "type": "graph",
          "selection": {
            "Person": "name",
            "ACTED_IN": "(label)",
            "Movie": "title",
            "DIRECTED": "(label)",
            "PRODUCED": "(label)"
          },
          "settings": {
            "minimizable": true
          },
          "schema": [
            [
              "Person",
              "born",
              "name"
            ],
            [
              "ACTED_IN",
              "roles"
            ],
            [
              "Movie",
              "tagline",
              "title",
              "released"
            ],
            [
              "DIRECTED"
            ],
            [
              "PRODUCED"
            ]
          ]
        }
      ],
      "toolbox": []
    }
  ],
  "parameters": {},
  "extensions": {
    "active": true,
    "activeReducers": []
  },
  "uuid": "bc58c8bf-d023-4528-8fc3-335d0d6d2d96"
}

group report 1 example

group report example 2

I have added a GIF for your reference. I have not implemented a settings for this. For now I am configuring it in JSON.

NOTICE
The program was tested solely for our own use cases, which might differ from yours.

Author Info: Monish [email protected] on behalf of Mercedes-Benz Research and Development India

https://github.com/mercedes-benz/mercedes-benz-foss/blob/master/PROVIDER_INFORMATION.md

Sample JSON
sample-moview-json.txt

Signed off: Monish [email protected]

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.

2 participants