Compare commits

...

11 Commits

Author SHA1 Message Date
Luccas Mateus
38febe2f60 [packanges/ckan][xs] - fix type 2023-08-24 16:04:12 -03:00
João Demenech
c09c78b015 feat(site,seo): disallow the people/* path to be crawled 2023-08-23 16:33:28 -03:00
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
23 changed files with 140 additions and 87 deletions

View File

@@ -0,0 +1,5 @@
---
'@portaljs/ckan': patch
---
remove optional from id in resource interface

View File

@@ -1,5 +1,17 @@
# @portaljs/ckan # @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 ## 0.0.3
### Patch Changes ### Patch Changes

View File

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

View File

@@ -41,7 +41,7 @@ export interface Resource {
description?: string; description?: string;
format?: string; format?: string;
hash?: string; hash?: string;
id?: string; id: string;
last_modified?: string; last_modified?: string;
metadata_modified?: string; metadata_modified?: string;
mimetype?: string; mimetype?: string;

View File

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

View File

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

View File

@@ -1,5 +1,11 @@
# @portaljs/components # @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 ## 0.3.1
### Patch Changes ### Patch Changes

View File

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

View File

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

View File

@@ -3,31 +3,6 @@ import ButtonLink from './ButtonLink';
import NewsletterForm from './NewsletterForm'; import NewsletterForm from './NewsletterForm';
import Image from 'next/image'; import Image from 'next/image';
import DatahubExampleImg from '@/public/images/showcases/datahub.webp'; 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 */ /* eslint jsx-a11y/label-has-associated-control: off */
export function Hero() { export function Hero() {
const el = useRef(null); const el = useRef(null);
@@ -50,7 +25,7 @@ export function Hero() {
Rapidly build rich data portals using a modern frontend framework. Rapidly build rich data portals using a modern frontend framework.
</p> </p>
<ButtonLink className="mt-8" href="/docs"> <ButtonLink style="secondary" className="mt-8" href="/docs">
Get started Get started
</ButtonLink> </ButtonLink>

View File

@@ -1,14 +1,37 @@
import { loadScripts } from '@/lib/loadNewsletterScripts';
import Script from 'next/script'; import Script from 'next/script';
import { useEffect } from 'react';
import { CloudIcon } from '@heroicons/react/solid';
export default function NewsletterForm() { 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 ( return (
<div> <div>
<div <div
id="sib-form-container" id="sib-form-container"
className="mt-8 sm:mx-auto sm:text-center lg:text-left lg:mx-0" 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"> <p className="text-base font-medium flex items-center">
Sign up to get notified about updates <CloudIcon className="w-6 h-6 mr-1" />
Join the PortalJS Cloud waitlist and get early access!
</p> </p>
<div id="sib-container" className="!bg-transparent !p-0 !pb-5"> <div id="sib-container" className="!bg-transparent !p-0 !pb-5">
<form <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" /> <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> </svg>
Notify Me Join now
</button> </button>
<input <input
type="text" type="text"
@@ -88,37 +111,6 @@ export default function NewsletterForm() {
</div> </div>
</div> </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> </div>
); );
} }

View File

@@ -2,4 +2,5 @@
id: anuveyatsu id: anuveyatsu
name: Anuar Ustayev name: Anuar Ustayev
avatar: https://avatars.githubusercontent.com/anuveyatsu avatar: https://avatars.githubusercontent.com/anuveyatsu
--- ---
<NextSeo noindex={true} nofollow={true} />

View File

@@ -2,4 +2,5 @@
id: joaodemenech id: joaodemenech
name: João Demenech name: João Demenech
avatar: https://avatars.githubusercontent.com/demenech avatar: https://avatars.githubusercontent.com/demenech
--- ---
<NextSeo noindex={true} nofollow={true} />

View File

@@ -2,4 +2,5 @@
id: luccasmateus id: luccasmateus
name: Luccas Mateus name: Luccas Mateus
avatar: https://avatars.githubusercontent.com/luccasmmg avatar: https://avatars.githubusercontent.com/luccasmmg
--- ---
<NextSeo noindex={true} nofollow={true} />

View File

@@ -2,4 +2,5 @@
id: mikanebu id: mikanebu
name: Meiran Zhiyenbayev name: Meiran Zhiyenbayev
avatar: https://avatars.githubusercontent.com/mikanebu avatar: https://avatars.githubusercontent.com/mikanebu
--- ---
<NextSeo noindex={true} nofollow={true} />

View File

@@ -3,3 +3,4 @@ id: ola-rubaj
name: Ola Rubaj name: Ola Rubaj
avatar: https://avatars.githubusercontent.com/olayway avatar: https://avatars.githubusercontent.com/olayway
--- ---
<NextSeo noindex={true} nofollow={true} />

View File

@@ -2,4 +2,5 @@
id: popovayoana id: popovayoana
name: Yoana Popova name: Yoana Popova
avatar: https://avatars.githubusercontent.com/popovayoana avatar: https://avatars.githubusercontent.com/popovayoana
--- ---
<NextSeo noindex={true} nofollow={true} />

View File

@@ -2,4 +2,5 @@
id: rufuspollock id: rufuspollock
name: Rufus Pollock name: Rufus Pollock
avatar: https://avatars.githubusercontent.com/rufuspollock avatar: https://avatars.githubusercontent.com/rufuspollock
--- ---
<NextSeo noindex={true} nofollow={true} />

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

@@ -4,6 +4,7 @@ module.exports = {
generateRobotsTxt: true, generateRobotsTxt: true,
robotsTxtOptions: { robotsTxtOptions: {
policies: [ policies: [
{ userAgent: '*', disallow: '/people/' },
{ userAgent: '*', disallow: '/people' }, { userAgent: '*', disallow: '/people' },
{ userAgent: '*', disallow: '/?amp=1' }, { userAgent: '*', disallow: '/?amp=1' },
], ],

View File

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

View File

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