Compare commits

...

9 Commits

Author SHA1 Message Date
github-actions[bot]
4a1ccd2f8d Version Packages (#1012)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-21 15:26:25 -03:00
Anuar Ustayev (aka Anu)
728d5b1465 Merge pull request #1014 from datopian/feat/cloud-waitlist-form
feat(site): the newsletter form is now a cloud waitlist form
2023-08-22 00:24:23 +06:00
João Demenech
a43d4a3b86 feat(site): the newsletter form is now a cloud waitlist form
Refs: #432
2023-08-21 14:47:59 -03:00
João Demenech
4bc7ce5ce7 [site,newsletter][s]: fix hero newsletter form (broken after Brevo update) 2023-08-18 09:41:31 -03:00
João Demenech
8c5c6a2112 Merge pull request #1011 from datopian/fix-flatui
Fix flatui
2023-08-15 15:00:04 -03:00
Luccas Mateus
8e896138c6 [@portaljs/components][sm] - fix bug of multiple flatuitable with different urls 2023-08-14 16:46:15 -03:00
github-actions[bot]
b2b4fbdf12 Version Packages (#1010)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-14 12:06:36 -03:00
Luccas Mateus
099f3c5204 [@portaljs/ckan][sm] - fix types (#1009) 2023-08-14 11:16:51 -03:00
Luccas Mateus
88ccee6f0a [@portaljs/ckan][sm] - fix types 2023-08-14 11:02:56 -03:00
13 changed files with 120 additions and 80 deletions

View File

@@ -1,5 +1,17 @@
# @portaljs/ckan
## 0.0.5
### Patch Changes
- [#1009](https://github.com/datopian/portaljs/pull/1009) [`88ccee6f`](https://github.com/datopian/portaljs/commit/88ccee6f0aa05decd3efbe7279925340ae817127) Thanks [@luccasmmg](https://github.com/luccasmmg)! - added package_count to organization type
## 0.0.4
### Patch Changes
- [#1009](https://github.com/datopian/portaljs/pull/1009) [`099f3c52`](https://github.com/datopian/portaljs/commit/099f3c520407a7215b5b41f67dc8ea5ac73d07c4) Thanks [@luccasmmg](https://github.com/luccasmmg)! - added package_count to organization type
## 0.0.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@portaljs/ckan",
"version": "0.0.3",
"version": "0.0.5",
"type": "module",
"description": "https://portaljs.org",
"keywords": [

View File

@@ -1,6 +1,6 @@
import { Activity } from "./activity.interface";
import { Dataset, Tag } from "./dataset.interface";
import { User } from "./user.interface";
import { Activity } from './activity.interface';
import { Dataset, Tag } from './dataset.interface';
import { User } from './user.interface';
export interface Group {
display_name: string;
@@ -10,9 +10,9 @@ export interface Group {
created: string;
name: string;
is_organization: false;
state: "active" | "deleted" | "inactive";
state: 'active' | 'deleted' | 'inactive';
image_url: string;
type: "group";
type: 'group';
title: string;
revision_id: string;
num_followers: number;

View File

@@ -1,6 +1,6 @@
import { Activity } from "./activity.interface";
import { Dataset, Tag } from "./dataset.interface";
import { User } from "./user.interface";
import { Activity } from './activity.interface';
import { Dataset, Tag } from './dataset.interface';
import { User } from './user.interface';
export interface Organization {
id: string;
@@ -13,8 +13,9 @@ export interface Organization {
image_display_url?: string;
created?: string;
is_organization: boolean;
approval_status?: "approved";
state: "active";
package_count: number;
approval_status?: 'approved';
state: 'active';
packages?: Array<Dataset>;
activity_stream?: Array<Activity>;
users?: Array<User>;

View File

@@ -1,5 +1,11 @@
# @portaljs/components
## 0.3.2
### Patch Changes
- [#1011](https://github.com/datopian/portaljs/pull/1011) [`8e896138`](https://github.com/datopian/portaljs/commit/8e896138c622615d9bd9bd1d4a18de0cf38d85ec) Thanks [@luccasmmg](https://github.com/luccasmmg)! - fix bug when there were multiple flatuitable components at the same time
## 0.3.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@portaljs/components",
"version": "0.3.1",
"version": "0.3.2",
"type": "module",
"description": "https://portaljs.org",
"keywords": [

View File

@@ -42,6 +42,7 @@ export interface FlatUiTableProps {
data?: { [key: string]: number | string }[];
rawCsv?: string;
corsProxy?: string;
randomId?: number;
}
export const FlatUiTable: React.FC<FlatUiTableProps> = ({
url,
@@ -49,10 +50,17 @@ export const FlatUiTable: React.FC<FlatUiTableProps> = ({
rawCsv,
corsProxy,
}) => {
const randomId = Math.random();
return (
// Provide the client to your App
<QueryClientProvider client={queryClient}>
<TableInner corsProxy={corsProxy} url={url} data={data} rawCsv={rawCsv} />
<TableInner
corsProxy={corsProxy}
url={url}
data={data}
rawCsv={rawCsv}
randomId={randomId}
/>
</QueryClientProvider>
);
};
@@ -62,6 +70,7 @@ const TableInner: React.FC<FlatUiTableProps> = ({
data,
rawCsv,
corsProxy,
randomId,
}) => {
if (data) {
return (
@@ -71,12 +80,12 @@ const TableInner: React.FC<FlatUiTableProps> = ({
);
}
const { data: csvString, isLoading: isDownloadingCSV } = useQuery(
['dataCsv', url],
['dataCsv', url, randomId],
() => getCsv(url as string, corsProxy),
{ enabled: !!url }
);
const { data: parsedData, isLoading: isParsing } = useQuery(
['dataPreview', csvString],
['dataPreview', csvString, randomId],
() => parseCsv(rawCsv ? (rawCsv as string) : (csvString as string)),
{ enabled: rawCsv ? true : !!csvString }
);

View File

@@ -3,31 +3,6 @@ import ButtonLink from './ButtonLink';
import NewsletterForm from './NewsletterForm';
import Image from 'next/image';
import DatahubExampleImg from '@/public/images/showcases/datahub.webp';
const codeLanguage = 'javascript';
const code = `export default {
strategy: 'predictive',
engine: {
cpus: 12,
backups: ['./storage/cache.wtf'],
},
}`;
const tabs = [
{ name: 'cache-advance.config.js', isActive: true },
{ name: 'package.json', isActive: false },
];
function TrafficLightsIcon(props) {
return (
<svg aria-hidden="true" viewBox="0 0 42 10" fill="none" {...props}>
<circle cx="5" cy="5" r="4.5" />
<circle cx="21" cy="5" r="4.5" />
<circle cx="37" cy="5" r="4.5" />
</svg>
);
}
/* eslint jsx-a11y/label-has-associated-control: off */
export function Hero() {
const el = useRef(null);
@@ -50,7 +25,7 @@ export function Hero() {
Rapidly build rich data portals using a modern frontend framework.
</p>
<ButtonLink className="mt-8" href="/docs">
<ButtonLink style="secondary" className="mt-8" href="/docs">
Get started
</ButtonLink>

View File

@@ -1,14 +1,37 @@
import { loadScripts } from '@/lib/loadNewsletterScripts';
import Script from 'next/script';
import { useEffect } from 'react';
import { CloudIcon } from '@heroicons/react/solid';
export default function NewsletterForm() {
useEffect(() => {
/*
* The newsletter scripts MUST be loaded after
* the document is loaded, as they depend on
* the presence of some elements
*
*/
if (document.readyState === 'complete') {
const { resetElements } = loadScripts();
return () => {
resetElements();
};
} else {
window.addEventListener('load', loadScripts);
return () => window.removeEventListener('load', loadScripts);
}
}, []);
return (
<div>
<div
id="sib-form-container"
className="mt-8 sm:mx-auto sm:text-center lg:text-left lg:mx-0"
>
<p className="text-base font-medium text-slate-400 dark:text-slate-400">
Sign up to get notified about updates
<p className="text-base font-medium flex items-center">
<CloudIcon className="w-6 h-6 mr-1" />
Join the PortalJS Cloud waitlist and get early access!
</p>
<div id="sib-container" className="!bg-transparent !p-0 !pb-5">
<form
@@ -47,7 +70,7 @@ export default function NewsletterForm() {
>
<path d="M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z" />
</svg>
Notify Me
Join now
</button>
<input
type="text"
@@ -88,37 +111,6 @@ export default function NewsletterForm() {
</div>
</div>
</div>
<Script
id="newsletter-form-validation-message"
dangerouslySetInnerHTML={{
__html: `
window.REQUIRED_CODE_ERROR_MESSAGE = 'Please choose a country code';
window.LOCALE = 'en';
window.EMAIL_INVALID_MESSAGE = window.SMS_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";
window.REQUIRED_ERROR_MESSAGE = "This field cannot be left blank. ";
window.GENERIC_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";
window.translation = {
common: {
selectedList: '{quantity} list selected',
selectedLists: '{quantity} lists selected'
}
};
var AUTOHIDE = Boolean(0);
`,
}}
/>
<Script
strategy="worker"
id="newsletter-submit-form"
src="https://sibforms.com/forms/end-form/build/main.js"
/>
</div>
);
}

View File

@@ -0,0 +1,45 @@
import { HTMLProps } from "react";
const loadScript = (
props: HTMLProps<HTMLScriptElement> & { textContent?: string }
): (() => void) => {
const script = document.createElement("script");
Object.assign(script, props);
document.head.appendChild(script);
return () => document.head.removeChild(script);
};
export const loadScripts = () => {
const formValidationScript = loadScript({
id: "newsletter-form-validation-message",
textContent: `
window.LOCALE = 'en';
window.EMAIL_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";
window.REQUIRED_ERROR_MESSAGE = "This field cannot be left blank. ";
window.GENERIC_INVALID_MESSAGE = "The information provided is invalid. Please review the field format and try again.";
window.translation = {
common: {
selectedList: '{quantity} list selected',
selectedLists: '{quantity} lists selected'
}
};
var AUTOHIDE = Boolean(0);
`,
});
const formSubmitScript = loadScript({
id: "newsletter-submit-form",
src: "https://sibforms.com/forms/end-form/build/main.js",
async: true,
defer: true,
});
return {
resetElements: () => {
formSubmitScript();
formValidationScript();
},
};
};

View File

@@ -9,7 +9,7 @@
"version": "0.1.0",
"dependencies": {
"@headlessui/react": "^1.3.0",
"@heroicons/react": "^1.0.3",
"@heroicons/react": "^1.0.6",
"@mdx-js/loader": "^2.3.0",
"@portaljs/core": "^1.0.6",
"@portaljs/remark-callouts": "^1.0.5",
@@ -367,9 +367,9 @@
}
},
"node_modules/@heroicons/react": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@heroicons/react/-/react-1.0.3.tgz",
"integrity": "sha512-wdzWbDiFKzeL6xFJsgY2PqvDkx4hFmQDpEFRVj872EA71XOjr8g0DQj5rHWm0y7LwfGOFL0eQmEiMbTyGNOnTQ==",
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@heroicons/react/-/react-1.0.6.tgz",
"integrity": "sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ==",
"peerDependencies": {
"react": ">= 16"
}

View File

@@ -12,7 +12,7 @@
},
"dependencies": {
"@headlessui/react": "^1.3.0",
"@heroicons/react": "^1.0.3",
"@heroicons/react": "^1.0.6",
"@mdx-js/loader": "^2.3.0",
"@portaljs/core": "^1.0.6",
"@portaljs/remark-callouts": "^1.0.5",