Skip to content

Commit

Permalink
DIGG-449: Organisationlink from dataset page
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Gasperini authored and Alessandro Gasperini committed Dec 5, 2024
2 parents 5f686f3 + d8cde92 commit 2767b3d
Show file tree
Hide file tree
Showing 222 changed files with 5,868 additions and 3,910 deletions.
40 changes: 36 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
{
"extends": ["next/core-web-vitals"],
"plugins": ["prettier"],
"extends": [
"next/core-web-vitals",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript"
],
"plugins": ["prettier", "import", "@typescript-eslint"],
"settings": {
"import/resolver": {
"typescript": true,
"node": true
}
},
"rules": {
"no-console": ["error", { "allow": ["warn", "error"] }],
"react-hooks/exhaustive-deps": "off",
"@next/next/no-sync-scripts": "off",
"cypress": "off",
"comma-dangle": "off",
"@typescript-eslint/comma-dangle": "off",
"no-unused-vars": 2,
"prettier/prettier": "error"
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"prettier/prettier": "error",
"import/order": [
"error",
{
"groups": [
"builtin", // Built-in imports (come from NodeJS native) go first
"external", // <- External imports
"internal", // <- Absolute imports
["sibling", "parent"], // <- Relative imports, the sibling and parent types they can be mingled together
"index", // <- index imports
"unknown" // <- unknown
],
"newlines-between": "always",
"alphabetize": {
/* sort in ascending order. Options: ["ignore", "asc", "desc"] */
"order": "asc",
/* ignore case. Options: [true, false] */
"caseInsensitive": true
}
}
]
}
}
3 changes: 3 additions & 0 deletions assets/icons/check-done.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/chevron-down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/chevron-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions assets/icons/chevronDown.svg

This file was deleted.

3 changes: 0 additions & 3 deletions assets/icons/chevronUp.svg

This file was deleted.

2 changes: 1 addition & 1 deletion assets/icons/closeCross.svg → assets/icons/cross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/diamond.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/icons/external-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/holdingHands.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/icons/mail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/specList.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import useTranslation from "next-translate/useTranslation";
import { FC, useContext, useState } from "react";
import { FaqFragment as IFaq } from "@/graphql/__generated__/operations";
import { HtmlParser } from "@/components/global/Typography/HtmlParser";
import CloseIcon from "@/assets/icons/closeCross.svg";

import CrossIcon from "@/assets/icons/cross.svg";
import PlusIcon from "@/assets/icons/plus.svg";
import useTranslation from "next-translate/useTranslation";
import { SettingsContext } from "@/providers/SettingsProvider";
import { HtmlParser } from "@/components/typography/html-parser";
import { FaqFragment as IFaq } from "@/graphql/__generated__/operations";
import { SettingsContext } from "@/providers/settings-provider";

interface AccordionBlockProps extends IFaq {
idx: number;
Expand Down Expand Up @@ -37,7 +38,7 @@ export const AccordionBlock: FC<AccordionBlockProps> = ({
{question}
</span>
{open ? (
<CloseIcon
<CrossIcon
width={iconSize * 1.5}
height={iconSize * 1.5}
viewBox="0 0 24 24"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import React from "react";
import { FC } from "react";

import { AccordionBlock } from "@/components/blocks/accordion-block";
import { MediaBlock } from "@/components/blocks/media-block";
import { PromotedContentBlock } from "@/components/blocks/promoted-content-block";
import { QuoteBlock } from "@/components/blocks/quote-block";
import { RelatedContentBlock } from "@/components/blocks/related-content-block";
import { TextBlock } from "@/components/blocks/text-block";
import { VideoBlock } from "@/components/blocks/video-block";
import { FormPage } from "@/features/pages/form-page";
import {
ModuleDataFragment,
ModuleListDataFragment,
FaqFragment,
ContainerDataFragment,
NewsItemDataFragment,
GoodExampleDataFragment,
} from "@/graphql/__generated__/operations";
import { ModuleDataFragment } from "@/graphql/__generated__/operations";
import { RelatedContentBlock } from "@/components/content/blocks/RelatedContentBlock";
import { TextBlock } from "@/components/content/blocks/TextBlock";
import { AccordionBlock } from "@/components/content/blocks/AccordionBlock";
import { MediaBlock } from "@/components/content/blocks/MediaBlock";
import { VideoBlock } from "@/components/content/blocks/VideoBlock";
import { FormPage } from "@/components/content/FormPage";
import { QuoteBlock } from "@/components/content/blocks/QuoteBlock";
import { PromotedContentBlock } from "@/components/content/blocks/PromotedContentBlock";

interface blockListProps {
blocks:
| ContainerDataFragment["blocks"]
Expand Down Expand Up @@ -60,7 +62,7 @@ const handleFaqs = (blocks: blockListProps["blocks"], pos: number) => {
);
};

export const BlockList: React.FC<blockListProps> = ({
export const BlockList: FC<blockListProps> = ({
blocks,
className,
landingPage,
Expand Down Expand Up @@ -98,14 +100,15 @@ export const BlockList: React.FC<blockListProps> = ({
landingPage={landingPage}
/>
);
case "dataportal_Digg_ModuleList":
case "dataportal_Digg_ModuleList": {
const typedBlock = block as ModuleListDataFragment;
return (
typedBlock.modules &&
typedBlock.modules.map((module) => (
<BlockList {...module} key={module.identifier} />
))
);
}
case "dataportal_Digg_FormBlock":
return (
<FormPage
Expand All @@ -116,15 +119,17 @@ export const BlockList: React.FC<blockListProps> = ({
__typename="dataportal_Digg_Form"
/>
);
default:
default: {
const unknownBlock = block as { __typename: string; id: string };
return (
<div key={id}>
<div key={unknownBlock.id}>
<h2>
<>{(block as any)?.__typename} Not found</>
<>{unknownBlock.__typename} Not found</>
</h2>
<pre>{JSON.stringify(block, null, 2)}</pre>
<pre>{JSON.stringify(unknownBlock, null, 2)}</pre>
</div>
);
}
}
})}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { MediaFragment } from "@/graphql/__generated__/operations";
import { checkLang } from "@/utilities";
import env from "@beam-australia/react-env";
import { MediaBaseFragment } from "@/graphql/__generated__/operations";
import { isExternalLink } from "@/utilities";
import { CustomImage } from "@/components/global/CustomImage";
import { Heading } from "@/components/global/Typography/Heading";
import Link from "next/link";
import { FC } from "react";

import DocumentIcon from "@/assets/icons/document.svg";
import PDFIcon from "@/assets/icons/PDF.svg";
import { CustomImage } from "@/components/custom-image";
import { Heading } from "@/components/typography/heading";
import {
MediaBaseFragment,
MediaFragment,
} from "@/graphql/__generated__/operations";
import { isExternalLink, checkLang } from "@/utilities";

export const handleUrl = ({ screen9, url, __typename }: MediaBaseFragment) => {
const documentBaseUrl = env("DOCUMENT_BASE_URL");
Expand Down Expand Up @@ -67,7 +70,7 @@ const renderMedia = (
}
};

export const MediaBlock: React.FC<MediaFragment> = ({
export const MediaBlock: FC<MediaFragment> = ({
heading,
description,
media,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { FC } from "react";
import { Heading } from "@/components/global/Typography/Heading";
import useTranslation from "next-translate/useTranslation";
import { PromotedContentFragment } from "@/graphql/__generated__/operations";
import { CustomImage } from "@/components/global/CustomImage";
import { ButtonLink } from "@/components/global/Button";
import { FC } from "react";

import Arrow from "@/assets/icons/arrowRight.svg";
import { ButtonLink } from "@/components/button";
import { CustomImage } from "@/components/custom-image";
import { Heading } from "@/components/typography/heading";
import { PromotedContentFragment } from "@/graphql/__generated__/operations";

export const PromotedContentBlock: FC<PromotedContentFragment> = ({
heading,
externalLink,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { FC } from "react";

import QuoteIcon from "@/assets/icons/quote.svg";
import { CustomImage } from "@/components/custom-image";
import { QuoteFragment } from "@/graphql/__generated__/operations";
import { CustomImage } from "@/components/global/CustomImage";

export const QuoteBlock: FC<QuoteFragment> = ({ quote, author, image }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { FC } from "react";
import { PromoProps, Promo } from "@/components/content/Promo";
import { ButtonLink } from "@/components/global/Button";
import { Heading } from "@/components/global/Typography/Heading";
import useTranslation from "next-translate/useTranslation";
import { FC } from "react";

import { ButtonLink } from "@/components/button";
import { PromoProps, Promo } from "@/components/promo";
import { Heading } from "@/components/typography/heading";
import { RelatedContentFragment } from "@/graphql/__generated__/operations";

interface RelatedContentProps extends RelatedContentFragment {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { FC } from "react";

import { Heading } from "@/components/typography/heading";
import { HtmlParser } from "@/components/typography/html-parser";
import { TextFragment } from "@/graphql/__generated__/operations";
import { Heading } from "@/components/global/Typography/Heading";
import { HtmlParser } from "@/components/global/Typography/HtmlParser";

export const TextBlock: FC<TextFragment> = ({ heading, text }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { FC } from "react";

import { Heading } from "@/components/typography/heading";
import { VideoPlayer } from "@/components/video-player";
import { VideoFragment } from "@/graphql/__generated__/operations";
import { checkLang } from "@/utilities";
import { Heading } from "@/components/global/Typography/Heading";
import { VideoPlayer } from "@/components/global/VideoPlayer";

export const VideoBlock: React.FC<VideoFragment> = ({
export const VideoBlock: FC<VideoFragment> = ({
heading,
description,
video_id,
Expand Down
Loading

0 comments on commit 2767b3d

Please sign in to comment.