Skip to content

Updated the summary page. #445

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

Merged
merged 15 commits into from
Jun 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/deep-card/README copy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Card Component

[![Vulnerabilities](https://snyk.io/test/github/ThinkDeepTech/thinkdeep/master/badge.svg?targetFile=packages/deep-card/package.json)](https://snyk.io/test/github/ThinkDeepTech/thinkdeep/master?targetFile=packages/deep-card/package.json)
70 changes: 70 additions & 0 deletions packages/deep-card/deep-card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/* eslint-disable no-unused-vars */

import {html, LitElement, css} from 'lit';

/**
* Card component.
*/
export class DeepCard extends LitElement {
/**
* Styles for lit component.
*/
static get styles() {
return [
css`
:host {
transition: box-shadow 0.3s;
min-width: 60vw;
max-width: 90vw;
min-height: 22vh;
width: var(--width, 90vw);
height: var(--height, 22vh);
border-radius: 5px;
background-color: var(--background-color, white);
}

:host(:hover) {
box-shadow: 0 0 8px var(--shadow-color, gray);
}

.header ::slotted(*) {
margin-left: 15px;
margin-top: 15px;
}

.footer ::slotted(*) {
margin-left: 15px;
margin-bottom: 15px;
margin-top: 15px;
}

a {
display: flex;
flex-direction: column;
}
`,
];
}

/**
* Lit render function.
* @return {TemplateResult}
*/
render() {
return html`
<a>
<div class="header">
<slot name="header"></slot>
</div>
<div class="body">
<slot name="body"></slot>
</div>
<div class="footer">
<slot name="footer"></slot>
</div>
</a>
`;
}
}

customElements.define('deep-card', DeepCard);
17 changes: 17 additions & 0 deletions packages/deep-card/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en-CA">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Thinkdeep</title>

<script src="./index.js"></script>
</head>
<body>

<deep-card></deep-card>


<script type="module" src="../../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions packages/deep-card/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './deep-card.js';
45 changes: 45 additions & 0 deletions packages/deep-card/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@thinkdeep/deep-card",
"version": "0.0.8",
"description": "Card component.",
"keywords": [
"Lit",
"JavaScript",
"WebComponents"
],
"author": "Hayden McParlane <hayden.mcparlane@gmail.com>",
"homepage": "https://github.com/ThinkDeepTech/thinkdeep#readme",
"license": "GPL-3.0-or-later",
"repository": {
"type": "git",
"url": "git+https://github.com/ThinkDeepTech/thinkdeep.git"
},
"type": "module",
"scripts": {
"start": "web-dev-server --config ./web-dev-server.config.js --esbuild-target auto",
"start:watch": "web-dev-server --config ./web-dev-server.config.js --watch --esbuild-target auto",
"tests:e2e": "web-test-runner --config ./web-test-runner.config.js",
"tests:e2e:watch": "web-test-runner --config ./web-test-runner.config.js --watch",
"build": "rimraf build && rollup -c rollup.config.mjs"
},
"devDependencies": {
"@esm-bundle/chai": "^4.3.4",
"@open-wc/testing": "^3.1.4",
"@open-wc/testing-helpers": "^2.1.2",
"@thinkdeep/tools": "^0.0.8",
"@web/dev-server-esbuild": "^0.2.12",
"@web/dev-server-rollup": "^0.3.5",
"@web/test-runner": "^0.13.15",
"@web/test-runner-playwright": "^0.8.6",
"@web/test-runner-puppeteer": "^0.10.0",
"chai": "^4.3.4",
"mocha": "^9.0.2",
"rimraf": "^3.0.2",
"rollup": "^2.72.1"
},
"dependencies": {
"@webcomponents/webcomponentsjs": "^2.5.0",
"lit": "^2.0.2"
},
"private": true
}
14 changes: 14 additions & 0 deletions packages/deep-card/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import merge from 'deepmerge';

// NOTE: The relative path below is required otherwise the build errors out.
import baseConfig from "@thinkdeep/tools/rollup.config.mjs";

export default merge(baseConfig, {
// if you use createSpaConfig, you can use your index.html as entrypoint,
// any <script type="module"> inside will be bundled by rollup
input: './index.html',

// alternatively, you can use your JS as entrypoint for rollup and
// optionally set a HTML template manually
// input: './app.js',
});
6 changes: 6 additions & 0 deletions packages/deep-card/test/deep-card.unit.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// import {html, litFixtureSync, expect} from '@open-wc/testing';
// import '@thinkdeep/deep-card/deep-card.js';

// describe('card', () => {

// });
3 changes: 3 additions & 0 deletions packages/deep-card/web-dev-server.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@thinkdeep/tools/web-dev-server.config.js';

export default config;
3 changes: 3 additions & 0 deletions packages/deep-card/web-test-runner.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import config from '@thinkdeep/tools/web-test-runner.config.js';

export default config;
2 changes: 1 addition & 1 deletion packages/deep-economic-analyzer/deep-analyzer-page-home.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class DeepAnalyzerPageHome extends i18nMixin(LitElement) {
height: auto;
padding: 5px;
border-radius: 7px;
opacity: 0.65;
opacity: 0.55;
text-align: center;
margin-bottom: 8vh;
}
Expand Down
20 changes: 16 additions & 4 deletions packages/deep-economic-analyzer/deep-analyzer-page-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import '@material/mwc-list/mwc-list';
import '@material/mwc-list/mwc-list-item';
import '@material/mwc-select';
import '@material/mwc-textfield';
import '@thinkdeep/deep-card';
import './deep-site-configuration.js';
import CollectEconomicData from './graphql/CollectEconomicData.mutation.graphql';
import GetSentiment from './graphql/GetSentiment.query.graphql';
Expand Down Expand Up @@ -128,23 +129,28 @@ export default class DeepAnalyzerPageSummary extends LitElement {
static get styles() {
return css`
:host {
height: auto;
width: 100vw;
display: block;
height: 100%;
width: 100%;
}

.grid-container {
display: grid;
grid-template-columns: 1fr;
min-height: 80vh;
background-color: var(--secondary-color);
justify-items: center;
align-items: center;
height: 100%;
width: 100%;
}

.input,
google-chart,
mwc-list {
mwc-list,
deep-card {
width: 90vw;
max-width: 90vw;
margin: 8px;
}

mwc-button {
Expand All @@ -156,6 +162,12 @@ export default class DeepAnalyzerPageSummary extends LitElement {
overflow: hidden;
}

.summary {
display: flex;
flex-direction: row;
justify-content: space-around;
}

[hidden] {
display: none;
}
Expand Down
5 changes: 3 additions & 2 deletions packages/deep-economic-analyzer/deep-economic-analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ export class DeepEconomicAnalyzer extends i18nMixin(LitElement) {
css`
:host {
display: block;
height: 100vh;
width: 100vw;
width: 100%;
height: 100%;
}

.grid-container {
Expand All @@ -150,6 +150,7 @@ export class DeepEconomicAnalyzer extends i18nMixin(LitElement) {
grid-template-areas:
'header'
'content';
height: 100%;
}

mwc-top-app-bar-fixed {
Expand Down
4 changes: 2 additions & 2 deletions packages/deep-economic-analyzer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
}

html, body {
max-height: 100vh;
max-width: 100vw;
height: 100%;
width: 100vw;
display: block;
background-color: var(--primary-color);
}
</style>

Expand Down
2 changes: 1 addition & 1 deletion packages/deep-economic-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@material/mwc-select": "^0.25.3",
"@material/mwc-textfield": "^0.25.3",
"@material/mwc-top-app-bar-fixed": "^0.25.3",
"@spectrum-web-components/card": "^0.10.11",
"@thinkdeep/deep-card": "0.0.8",
"@thinkdeep/deep-footer": "^0.0.8",
"@vaadin/router": "^1.7.4",
"@webcomponents/webcomponentsjs": "^2.5.0",
Expand Down
1 change: 1 addition & 0 deletions packages/tools/web-dev-server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
'process.env.PREDECOS_MICROSERVICE_SUBSCRIPTION_URL': JSON.stringify(
process.env.PREDECOS_MICROSERVICE_SUBSCRIPTION_URL
),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
graphql(),
],
Expand Down
1 change: 1 addition & 0 deletions packages/tools/web-test-runner.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default {
PREDECOS_TEST_AUTH_CLIENT_SECRET:
process.env.PREDECOS_TEST_AUTH_CLIENT_SECRET,
PREDECOS_TEST_AUTH_LOGIN_URL: `https://${process.env.PREDECOS_TEST_AUTH_DOMAIN}/oauth/token`,
NODE_ENV: process.env.NODE_ENV,
}),
],
};
Loading