Skip to content

Commit

Permalink
Merge 1.1.0 into mainline, which has 1.0.6 (#625)
Browse files Browse the repository at this point in the history
* Gtt 1535 (#601)

* off by one error in index

* prettier write

* changing this to map because this assumes that the same number of formatted columns and data columns

* added integration test for checking chart render

* prettier write

* GTT-1418: Add version dropdown to view dashboard admin (#602)

* Editor access to view previous dashboards versions

* Set auto width to versions dropdown

* Delete unused styles and fix labels

* Move missing translations to the bottom

Co-authored-by: Triet <triet05@gmail.com>

* GTT-1475: Option to display Sections in tabs (#603)

* Option to display Sections in tabs

* Add scroll and arrows to horizontal tabs

Co-authored-by: Triet <triet05@gmail.com>

* Gtt 1530 (#604)

* added in compute percentage

* computedPercentage goes through the stack

* simplified pie chart data render

* replicated changes over to donut chart

* removed it from part of whole chart

* added unit tests and updated snapshots

* prettier write

* fixed display of number type

* added tests and needs

* prettier write

* fixed unit tests for backend

* pr comments.

* dont need that

Co-authored-by: Miguel Pavon Diaz <71112226+miguelpdiaz8@users.noreply.github.com>

* Option to display bar and column charts as stacked (#605)

Co-authored-by: Triet <triet05@gmail.com>

* Fix Vertical tabs width and mobile issues (#606)

* Significant data labels need to be applied when currency is used (#607)

* Fix scroll and bad data issues (#610)

* changed property used in the url matcher (#612)

* small quality of life changes (#613)

* small quality of life changes

* udpated snap shots

* Add mobile style and layout changes (#614)

* Add mobile style and layout changes

* Update mobile buttons in tab pages

Co-authored-by: Triet <triet05@gmail.com>

* add new translation files (#617)

* upgrade to version 1.1.0

* upgraded to v1.1.0

Co-authored-by: Phil Dettorre <89091415+PhilTower@users.noreply.github.com>
Co-authored-by: Miguel Pavon Diaz <71112226+miguelpdiaz8@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 30, 2021
1 parent b70b010 commit 82e22b2
Show file tree
Hide file tree
Showing 112 changed files with 4,985 additions and 3,178 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PDoA comes with pre-built code to provision an instance in your AWS account. You

| Region | Launch |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Install in us-east-1 | [![Install in us-east-1](docs/images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.0.6/performance-dashboard-on-aws.template) |
| Install in us-east-1 | [![Install in us-east-1](docs/images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.1.0/performance-dashboard-on-aws.template) |

### Clone this repository

Expand Down
26 changes: 26 additions & 0 deletions THIRD-PARTY-LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -1423,3 +1423,29 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

------

** asmyshlyaev177/react-horizontal-scrolling-menu; version ^2.0.9 -- https://github.com/asmyshlyaev177/react-horizontal-scrolling-menu

The MIT License (MIT)

Copyright (c) 2018 Alex - https://github.com/asmyshlyaev177

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "performance-dashboard-backend",
"version": "1.0.6",
"version": "1.1.0",
"description": "Performance Dashboard on AWS Backend",
"awssdkUserAgent": "AwsSolution/SO0157/v",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions backend/src/lib/factories/__tests__/widget-factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ describe("toItem", () => {
sortByDesc: true,
significantDigitLabels: true,
dataLabels: true,
computePercentages: false,
showTotal: true,
columnsMetadata: [
{
Expand Down Expand Up @@ -567,6 +568,7 @@ describe("toItem", () => {
significantDigitLabels: true,
dataLabels: true,
showTotal: true,
computePercentages: false,
columnsMetadata: [
{
hidden: false,
Expand Down
12 changes: 12 additions & 0 deletions backend/src/lib/factories/widget-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ function fromChartItem(widget: Widget): ChartWidget {
chartWidget.content.dataLabels !== undefined
? chartWidget.content.dataLabels
: false,
computePercentages:
chartWidget.content.computePercentages !== undefined
? chartWidget.content.computePercentages
: false,
showTotal:
chartWidget.content.showTotal !== undefined
? chartWidget.content.showTotal
Expand Down Expand Up @@ -278,13 +282,20 @@ function createChartWidget(widget: Widget): ChartWidget {
widget.content.dataLabels !== undefined
? widget.content.dataLabels
: false,
computePercentages:
widget.content.computePercentages !== undefined
? widget.content.computePercentages
: false,
showTotal:
widget.content.showTotal !== undefined
? widget.content.showTotal
: true,
...(widget.content.horizontalScroll && {
horizontalScroll: widget.content.horizontalScroll,
}),
...(widget.content.stackedChart && {
stackedChart: widget.content.stackedChart,
}),
},
};
}
Expand Down Expand Up @@ -398,6 +409,7 @@ function createSectionWidget(widget: Widget): SectionWidget {
widgetIds: widget.content.widgetIds,
summary: widget.content.summary,
showWithTabs: widget.content.showWithTabs,
horizontally: widget.content.horizontally,
},
};
}
Expand Down
3 changes: 3 additions & 0 deletions backend/src/lib/models/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export interface ChartWidget extends Widget {
summaryBelow: boolean;
datasetType?: string;
horizontalScroll?: boolean;
stackedChart?: boolean;
dataLabels: boolean;
computePercentages: boolean;
showTotal: boolean;
fileName: string;
columnsMetadata: ColumnMetadata[];
Expand Down Expand Up @@ -149,5 +151,6 @@ export interface SectionWidget extends Widget {
summary?: string;
widgetIds?: Array<string>;
showWithTabs: string;
horizontally?: boolean;
};
}
2 changes: 1 addition & 1 deletion cdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "performance-dashboard-cdk",
"version": "1.0.6",
"version": "1.1.0",
"description": "Performance Dashboard on AWS CDK",
"bin": {
"cdk": "bin/main.js"
Expand Down
10 changes: 5 additions & 5 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If you're not familiar with deploying resources on AWS using CFT, start by revie

| Region | Launch |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| US East (N. Virginia) | [![Install in us-east-1](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.0.6/performance-dashboard-on-aws.template) |
| US East (N. Virginia) | [![Install in us-east-1](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.1.0/performance-dashboard-on-aws.template) |

You will be directed to the CloudFormation console on your browser. Enter the stack name such as "MyCorp-PerfDash", and enter the email of the user who will initially administer PDoA in the "adminEmail" field, then press the "Next" button. Accept the default values on the next page, and press the Next button. Finally, check on the two "Capabilities" checkboxes at the bottom of the page. Press the "Create Stack" button. It will take about 25 minutes for the compute, storage, and database resources on AWS to be provisioned.

Expand All @@ -41,10 +41,10 @@ If you prefer to deploy PDoA in a region other than US East (N. Virginia), you m

| Region | Launch |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Install this first in US East (N. Virginia)** | [![Install this first](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.0.6/LambdaEdge.template) |
| Install PDoA in South America (São Paulo) | [![Install in non US East (N. Virginia) region](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=sa-east-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.0.6/performance-dashboard-on-aws.template) |
| Install PDoA in Canada (Central) | [![Install in non US East (N. Virginia) region](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=ca-central-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.0.6/performance-dashboard-on-aws.template) |
| Install PDoA in Europe (London) | [![Install in non US East (N. Virginia) region](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.0.6/performance-dashboard-on-aws.template) |
| **Install this first in US East (N. Virginia)** | [![Install this first](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.1.0/LambdaEdge.template) |
| Install PDoA in South America (São Paulo) | [![Install in non US East (N. Virginia) region](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=sa-east-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.1.0/performance-dashboard-on-aws.template) |
| Install PDoA in Canada (Central) | [![Install in non US East (N. Virginia) region](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=ca-central-1#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.1.0/performance-dashboard-on-aws.template) |
| Install PDoA in Europe (London) | [![Install in non US East (N. Virginia) region](images/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/quickcreate?templateURL=https://performance-dashboard-on-aws-solution-releases-us-west-2.s3.us-west-2.amazonaws.com/performance-dashboard-on-aws/v1.1.0/performance-dashboard-on-aws.template) |

## Deploying with AWS Cloud Development Kit (CDK)

Expand Down
4 changes: 4 additions & 0 deletions e2e-tests/cypress/fixtures/sample_piechart.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Drink,Spent Per Year
Coffee,4300
Tea,5000
Water,1020
4 changes: 4 additions & 0 deletions e2e-tests/cypress/fixtures/samplebar.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Year,Target,Achieved
"2,017",80,95
"2,018",80,95
"2,019",85,94
179 changes: 179 additions & 0 deletions e2e-tests/cypress/integration/chart-render.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
import * as Chance from "chance";
import EditDashboardPage from "../pages/EditDashboard";
import CreateDashboardPage from "../pages/CreateDashboard";
import AddMetricsPage from "../pages/AddMetrics";
import AddTextPage from "../pages/AddText";
import AddChartPage from "../pages/AddChart";
import AddTablePage from "../pages/AddTable";
import LoginPage from "../pages/Login";
import EditTextPage from "../pages/EditText";
import EditMetricsPage from "../pages/EditMetrics";
import EditChartPage from "../pages/EditChart";
import EditTablePage from "../pages/EditTable";

const random = new Chance();
let dashboardName: string;
let editDashboardPage: EditDashboardPage;

describe("Admin user", () => {
beforeEach(() => {
const loginPage = new LoginPage();
loginPage.visit();
loginPage.loginAsAdmin();

const createDashboardPage = new CreateDashboardPage();
createDashboardPage.visit();

dashboardName = random.company();
createDashboardPage.fillName(dashboardName);
createDashboardPage.fillDescription(random.sentence());
editDashboardPage = createDashboardPage.submit();

cy.contains(`"${dashboardName}" draft dashboard successfully created.`);
});

it("can add a Bar Chart content item to a dashboard", () => {
const addContentItemPage = editDashboardPage.goToAddContentItem();
addContentItemPage.selectChartContentItem();
const addChartPage = addContentItemPage.clickContinue() as AddChartPage;

// Choose static dataset
addChartPage.selectStaticDataset();

addChartPage.uploadDataset("samplebar.csv");

// Select columns to display/hide
cy.get("label[for='checkbox-header-1']").click();
cy.get("#dataType").select("Number");
cy.get("#numberType").select("Currency");
cy.get("#currencyType").select("Euro €");
cy.get("label[for='checkbox-header-1']").click();

cy.get("label[for='checkbox-header-2']").click();
cy.get("#dataType").select("Number");
cy.get("#numberType").select("Currency");
cy.get("#currencyType").select("Euro €");
cy.get("label[for='checkbox-header-2']").click();

//Continue
cy.get('button:contains(Continue)').last().click();

// Enter chart details
const chartTitle = random.word();
addChartPage.fillTitle(chartTitle);

const chartSummary = random.sentence();
addChartPage.fillSummary(chartSummary);

cy.get("label[for='BarChart']").click();
cy.get("label[for='dataLabels']").click();


cy.get(".recharts-surface").contains("€80.00");
cy.get(".recharts-surface").contains("€85.00");
cy.get(".recharts-surface").contains("€94.00");
cy.get(".recharts-surface").contains("€95.00");
// Submit form
editDashboardPage = addChartPage.submit();

// Delete the dashboard
const dashboardListingPage = editDashboardPage.goToDashboardListing();
dashboardListingPage.deleteDashboard(dashboardName);
});

it("can add a Column Chart content item to a dashboard", () => {
const addContentItemPage = editDashboardPage.goToAddContentItem();
addContentItemPage.selectChartContentItem();
const addChartPage = addContentItemPage.clickContinue() as AddChartPage;

// Choose static dataset
addChartPage.selectStaticDataset();

addChartPage.uploadDataset("samplebar.csv");

// Select columns to display/hide
cy.get("label[for='checkbox-header-1']").click();
cy.get("#dataType").select("Number");
cy.get("#numberType").select("Currency");
cy.get("#currencyType").select("Euro €");
cy.get("label[for='checkbox-header-1']").click();

cy.get("label[for='checkbox-header-2']").click();
cy.get("#dataType").select("Number");
cy.get("#numberType").select("Currency");
cy.get("#currencyType").select("Euro €");
cy.get("label[for='checkbox-header-2']").click();

//Continue
cy.get('button:contains(Continue)').last().click();

// Enter chart details
const chartTitle = random.word();
addChartPage.fillTitle(chartTitle);

const chartSummary = random.sentence();
addChartPage.fillSummary(chartSummary);

cy.get("label[for='ColumnChart']").click();
cy.get("label[for='dataLabels']").click();


cy.get(".recharts-surface").contains("€80.00");
cy.get(".recharts-surface").contains("€85.00");
cy.get(".recharts-surface").contains("€94.00");
cy.get(".recharts-surface").contains("€95.00");
// Submit form
editDashboardPage = addChartPage.submit();

// Delete the dashboard
const dashboardListingPage = editDashboardPage.goToDashboardListing();
dashboardListingPage.deleteDashboard(dashboardName);
});

it("can add a Pie Chart content item to a dashboard", () => {
const addContentItemPage = editDashboardPage.goToAddContentItem();
addContentItemPage.selectChartContentItem();
const addChartPage = addContentItemPage.clickContinue() as AddChartPage;

// Choose static dataset
addChartPage.selectStaticDataset();

addChartPage.uploadDataset("sample_piechart.csv");

// Select columns to display/hide
cy.get("label[for='checkbox-header-1']").click();
cy.get("#dataType").select("Number");
cy.get("#numberType").select("Currency");
cy.get("#currencyType").select("Euro €");
cy.get("label[for='checkbox-header-1']").click();

//Continue
cy.get('button:contains(Continue)').last().click();

// Enter chart details
const chartTitle = random.word();
addChartPage.fillTitle(chartTitle);

const chartSummary = random.sentence();
addChartPage.fillSummary(chartSummary);

cy.get("label[for='PieChart']").click();
cy.get("label[for='dataLabels']").click();
cy.get("label[for='computePercentages']").click();


cy.get(".recharts-pie").contains("€5,000.00 (48.45%)");
cy.get(".recharts-pie").contains("€4,300.00 (41.67%)");
cy.get(".recharts-pie").contains("€1,020.00 (9.88%)");

cy.get(".recharts-default-legend").contains("€5,000.00");
cy.get(".recharts-default-legend").contains("€4,300.00");
cy.get(".recharts-default-legend").contains("€1,020.00");
// Submit form
editDashboardPage = addChartPage.submit();

// Delete the dashboard
const dashboardListingPage = editDashboardPage.goToDashboardListing();
dashboardListingPage.deleteDashboard(dashboardName);
});
});
Loading

0 comments on commit 82e22b2

Please sign in to comment.