[packages/portal][l]: Moved portal folder to root dir

This commit is contained in:
Rising Odegua 2021-03-08 11:33:21 +01:00
parent 6aec97a728
commit c905b59f3e
41 changed files with 502 additions and 4002 deletions

View File

@ -1,8 +1,22 @@
<h1 align="center"> Present a (Frictionless) dataset for viewing and exploration.
🌀 Portal.JS<br/> ## Install
A gateway to your data
</h1> Git clone then:
🌀 `Portal` is the data presentation framework. `Portal` can be used to showcase a single dataset or build full-scale data catalogs/portals. `Portal` is built in Javascript and React on top of the popular Next.js framework. ```
yarn install
```
## Usage
In this directory:
```bash
export PORTAL_DATASET_PATH=/path/to/my/dataset
yarn dev
```
And you will get a nice dataset page at `http://localhost:3000`
![](https://i.imgur.com/KSEtNF1.png)

View File

@ -1,46 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`📸 of Input component with empty 1`] = `
<form
className="flex items-center"
onSubmit={[Function]}
>
<input
aria-label="Search"
className="bg-white focus:outline-none focus:shadow-outline border border-gray-300 w-1/2 rounded-lg py-2 px-4 block appearance-none leading-normal"
name="q"
onChange={[Function]}
placeholder="Search"
type="text"
/>
<button
className="inline-block text-sm px-4 py-3 mx-3 leading-none border rounded text-white bg-black border-black lg:mt-0"
onClick={[Function]}
>
Search
</button>
</form>
`;
exports[`📸 of Input component with query 1`] = `
<form
className="flex items-center"
onSubmit={[Function]}
>
<input
aria-label="Search"
className="bg-white focus:outline-none focus:shadow-outline border border-gray-300 w-1/2 rounded-lg py-2 px-4 block appearance-none leading-normal"
name="q"
onChange={[Function]}
placeholder="Search"
type="text"
value="gdp"
/>
<button
className="inline-block text-sm px-4 py-3 mx-3 leading-none border rounded text-white bg-black border-black lg:mt-0"
onClick={[Function]}
>
Search
</button>
</form>
`;

View File

@ -1,35 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`📸 of Input component with empty 1`] = `
<ul>
<div
className="mb-6"
>
<h3
className="text-xl font-semibold"
>
<a
className="text-primary"
href="/@test-org/test"
onClick={[Function]}
onMouseEnter={[Function]}
>
Title
</a>
</h3>
<a
className="text-gray-500 block mt-1"
href="/@test-org"
onClick={[Function]}
onMouseEnter={[Function]}
>
test org
</a>
<div
className="leading-relaxed mt-2"
>
A description.
</div>
</div>
</ul>
`;

View File

@ -1,44 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`📸 of Input component with empty 1`] = `
<div
className="inline-block my-6 float-right"
>
<label
htmlFor="field-order-by"
>
Order by:
</label>
<select
className="bg-white"
id="field-order-by"
name="sort"
>
<option
value="score:desc"
>
Relevance
</option>
<option
value="title_string:asc"
>
Name Ascending
</option>
<option
value="title_string:desc"
>
Name Descending
</option>
<option
value="metadata_modified:desc"
>
Last Modified
</option>
<option
value="views_recent:desc"
>
Popular
</option>
</select>
</div>
`;

View File

@ -1,10 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`📸 of Total component 1`] = `
<h1
className="text-3xl font-semibold text-primary my-6 inline-block"
>
2
results found
</h1>
`;

View File

@ -1,209 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`📸 of Home page 1`] = `
<div
className="container mx-auto"
>
<nav
className="flex items-center justify-between flex-wrap bg-white p-4 border-b border-gray-200"
>
<div
className="flex items-center flex-shrink-0 text-gray-700 mr-6"
>
<img
alt="portal logo"
src="/images/logo.svg"
width="40"
/>
</div>
<div
className="block lg:hidden mx-4"
>
<button
className="flex items-center px-3 py-2 border rounded text-gray-700 border-orange-400 hover:text-black hover:border-black"
onClick={[Function]}
>
<svg
className="fill-current h-3 w-3"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<title>
Menu
</title>
<path
d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"
/>
</svg>
</button>
</div>
<div
className="hidden lg:block"
>
<a
className="block mt-4 lg:inline-block lg:mt-0 text-gray-700 hover:text-black mr-6"
href="/search"
onClick={[Function]}
onMouseEnter={[Function]}
>
Search
</a>
<a
className="block mt-4 lg:inline-block lg:mt-0 text-gray-700 hover:text-black mr-6"
href="http://tech.datopian.com/frontend/"
onClick={[Function]}
onMouseEnter={[Function]}
target="_blank"
>
Docs
</a>
<a
className="inline-block text-sm px-4 py-2 leading-none border rounded text-white bg-black border-black hover:border-gray-700 hover:text-gray-700 hover:bg-white mt-4 lg:mt-0"
href="https://github.com/datopian/portal"
onClick={[Function]}
onMouseEnter={[Function]}
>
GitHub
</a>
</div>
</nav>
<section
className="flex justify-center items-center flex-col mt-8 mx-4 lg:flex-row"
>
<div>
<h1
className="text-4xl mb-3 font-thin"
>
Find, Share and Publish
<br />
Quality Data with
<span
className="text-orange-500"
>
Datahub
</span>
</h1>
<p
className="text-md font-light mb-3 w-4/5"
>
At Datahub, we have over thousands of datasets for free and a Premium Data Service for additional or customised data with guaranteed updates.
</p>
<form
className="flex items-center"
onSubmit={[Function]}
>
<input
aria-label="Search"
className="bg-white focus:outline-none focus:shadow-outline border border-gray-300 w-1/2 rounded-lg py-2 px-4 block appearance-none leading-normal"
name="q"
onChange={[Function]}
placeholder="Search"
type="text"
/>
<button
className="inline-block text-sm px-4 py-3 mx-3 leading-none border rounded text-white bg-black border-black lg:mt-0"
onClick={[Function]}
>
Search
</button>
</form>
</div>
<div
className="mt-4"
>
<img
className="w-4/5"
src="/images/banner.svg"
/>
</div>
</section>
<section
className="my-10 mx-4 lg:my-20"
>
<h1
className="text-2xl font-thin mb-4"
>
Recent Datasets
</h1>
<div
className="flex flex-col lg:flex-row"
>
<div
className="border px-4 mb-4 mr-3 border-gray-100 w-5/6 shadow-sm"
>
<h1
className="text-2xl font-thin"
>
Our World in Data - COVID 19
</h1>
<p
className="text-gray-500"
>
Dataset
</p>
<p>
data collected and managed by Our World in Data - COVID 19 pulled from GitHub on 06/10/2020 https://ourworldindata.org/coronavirus
</p>
<a
className="pt-3 flex justify-end text-orange-500"
href="/"
onClick={[Function]}
onMouseEnter={[Function]}
>
View Dataset
</a>
</div>
<div
className="border px-4 mb-4 mr-3 border-gray-100 w-5/6 shadow-sm"
>
<h1
className="text-2xl font-thin"
>
Our World in Data - COVID 19
</h1>
<p
className="text-gray-500"
>
Dataset
</p>
<p>
data collected and managed by Our World in Data - COVID 19 pulled from GitHub on 06/10/2020 https://ourworldindata.org/coronavirus
</p>
<a
className="pt-3 flex justify-end text-orange-500"
href="/"
onClick={[Function]}
onMouseEnter={[Function]}
>
View Dataset
</a>
</div>
<div
className="border px-4 mb-4 border-gray-100 w-5/6 shadow-sm"
>
<h1
className="text-2xl font-thin"
>
Our World in Data - COVID 19
</h1>
<p
className="text-gray-500 mb-2"
>
Dataset
</p>
<p>
data collected and managed by Our World in Data - COVID 19 pulled from GitHub on 06/10/2020 https://ourworldindata.org/coronavirus
</p>
<a
className="pt-3 flex justify-end text-orange-500"
href="/"
onClick={[Function]}
onMouseEnter={[Function]}
>
View Dataset
</a>
</div>
</div>
</section>
</div>
`;

View File

@ -1,7 +1,6 @@
module.exports = { module.exports = {
testPathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/"], testPathIgnorePatterns: ["<rootDir>/.next/", "<rootDir>/node_modules/", "<rootDir>/examples/catalog/*"],
setupFilesAfterEnv: ["<rootDir>/tests/setupTests.js"], setupFilesAfterEnv: ["<rootDir>/tests/setupTests.js"],
setupFiles: ["<rootDir>/tests/setupTests.js"],
transform: { transform: {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest", "^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
"\\.(css|less|scss|sass)$": "identity-obj-proxy" "\\.(css|less|scss|sass)$": "identity-obj-proxy"

View File

@ -1,7 +0,0 @@
{
"packages": [
"packages/*"
],
"npmClient": "yarn",
"version": "0.0.0"
}

View File

@ -1,10 +1,57 @@
{ {
"name": "root", "name": "portal",
"private": true, "description": "The data presentation framework",
"devDependencies": { "author": "Datopian",
"lerna": "^3.22.1" "license": "MIT",
"version": "0.1.0",
"bin": {
"portal": "./bin/portal.js"
}, },
"workspaces":[ "scripts": {
"packages/**" "dev": "next dev",
] "build": "next build",
"start": "next start",
"test": "jest --coverage"
},
"dependencies": {
"@material-ui/core": "^4.11.3",
"@material-ui/data-grid": "^4.0.0-alpha.20",
"@tailwindcss/typography": "^0.4.0",
"autoprefixer": "^10.0.4",
"datapackage-render": "git+https://github.com/frictionlessdata/datapackage-render-js.git",
"filesize": "^6.1.0",
"frictionless.js": "^0.13.4",
"next": "latest",
"plotly.js-basic-dist": "^1.58.4",
"postcss": "^8.1.10",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-plotly.js": "^2.5.1",
"react-table": "^7.6.3",
"react-vega": "^7.4.2",
"remark": "^13.0.0",
"remark-html": "^13.0.1",
"tailwindcss": "^2.0.2",
"vega": "^5.19.1",
"vega-lite": "^5.0.0",
"chalk": "^4.1.0",
"commander": "^6.2.0",
"cpy": "^8.1.1",
"cross-spawn": "^7.0.3",
"figlet": "^1.5.0",
"listr": "^0.14.3",
"open": "^8.0.2",
"ora": "^5.1.0",
"prompts": "^2.4.0"
},
"devDependencies": {
"@testing-library/dom": "^7.29.6",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"babel-jest": "^26.6.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"jest-canvas-mock": "^2.3.1",
"jest-dom": "^4.0.0"
}
} }

View File

@ -1,22 +0,0 @@
Present a (Frictionless) dataset for viewing and exploration.
## Install
Git clone then:
```
yarn install
```
## Usage
In this directory:
```bash
export PORTAL_DATASET_PATH=/path/to/my/dataset
yarn dev
```
And you will get a nice dataset page at `http://localhost:3000`
![](https://i.imgur.com/KSEtNF1.png)

View File

@ -1,57 +0,0 @@
{
"name": "portal",
"description": "The data presentation framework",
"author": "Datopian",
"license": "MIT",
"version": "0.1.0",
"bin": {
"portal": "./bin/portal.js"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"test": "jest --coverage"
},
"dependencies": {
"@material-ui/core": "^4.11.3",
"@material-ui/data-grid": "^4.0.0-alpha.20",
"@tailwindcss/typography": "^0.4.0",
"autoprefixer": "^10.0.4",
"datapackage-render": "git+https://github.com/frictionlessdata/datapackage-render-js.git",
"filesize": "^6.1.0",
"frictionless.js": "^0.13.4",
"next": "latest",
"plotly.js-basic-dist": "^1.58.4",
"postcss": "^8.1.10",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-plotly.js": "^2.5.1",
"react-table": "^7.6.3",
"react-vega": "^7.4.2",
"remark": "^13.0.0",
"remark-html": "^13.0.1",
"tailwindcss": "^2.0.2",
"vega": "^5.19.1",
"vega-lite": "^5.0.0",
"chalk": "^4.1.0",
"commander": "^6.2.0",
"cpy": "^8.1.1",
"cross-spawn": "^7.0.3",
"figlet": "^1.5.0",
"listr": "^0.14.3",
"open": "^8.0.2",
"ora": "^5.1.0",
"prompts": "^2.4.0"
},
"devDependencies": {
"@testing-library/dom": "^7.29.6",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^11.2.5",
"babel-jest": "^26.6.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"jest-canvas-mock": "^2.3.1",
"jest-dom": "^4.0.0"
}
}

View File

@ -1 +0,0 @@
import 'jest-canvas-mock';

View File

@ -6,7 +6,7 @@ import { Vega } from 'react-vega';
import { getDataset } from '../lib/dataset' import { getDataset } from '../lib/dataset'
import Chart from '../components/Chart' import Chart from '../components/Chart'
import { addView } from '../lib/utils' import { addView } from '../lib/utils'
const datasetsDirectory = process.env.PORTAL_DATASET_PATH const datasetsDirectory = process.env.PORTAL_DATASET_PATH || path.join(process.cwd(), "fixtures", "datasetsDoubleView")
export default function Home({ dataset, specs }) { export default function Home({ dataset, specs }) {

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1 +1,2 @@
import 'jest-canvas-mock';
import "@testing-library/jest-dom/extend-expect"; import "@testing-library/jest-dom/extend-expect";

3980
yarn.lock

File diff suppressed because it is too large Load Diff