Skip to content
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

chore(release) #659

Merged
merged 4 commits into from
Jan 2, 2025
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
1 change: 1 addition & 0 deletions components/molecules/Hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const Hero: FunctionComponent<PropsWithChildren<HeroProps>> = ({
focalPointY || 50
}%`,
}}
sizes={`(max-width: 2000px) 100vw, 2000px`}
priority
fetchPriority="high"
quality={90}
Expand Down
7 changes: 4 additions & 3 deletions components/molecules/Hero/styles.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"use client";
import styled from "styled-components";
import { fluidScale, containerFullBleed } from "@/styles/globalStyles";
// import Image from "@rubin-epo/epo-react-lib/Image";
import { fluidScale } from "@/styles/globalStyles";
import Image from "next/image";

export const HeroContainer = styled.div`
${containerFullBleed("CONTAINER_FULL")}
width: 100%;
max-width: var(--size-width-center, 2000px);
margin: 0 auto;
position: relative;
height: var(--Hero-height, ${fluidScale("540px", "400px")});
overflow: auto;
Expand Down
36 changes: 28 additions & 8 deletions components/templates/NewsPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
import { FunctionComponent } from "react";
import sanitizeHtml from "sanitize-html";
import sanitizeHtml, { defaults, IOptions } from "sanitize-html";
import {
AnnouncementsService,
ReleasesService,
} from "@/lib/api/noirlab/codegen";
import { Locale } from "@/lib/i18n/settings";
import NewsPageClient from "./client";

const sanitize = (dirty: string | undefined) => {
if (typeof dirty === "undefined") return;

try {
const { hostname: noirLabHostname } = new URL(
`${process.env.NOIRLAB_BASE_URL}`
);
const sanitizeOptions: IOptions = {
allowedTags: [...defaults.allowedTags, "iframe"],
allowedAttributes: {
...defaults.allowedAttributes,
iframe: ["src", "style", "width", "height", "allowfullscreen"],
},
allowedIframeHostnames: [noirLabHostname],
};

return sanitizeHtml(dirty, sanitizeOptions);
} catch {
return undefined;
}
};

const NewsPage: FunctionComponent<{
section: string;
data: PageEntry;
Expand Down Expand Up @@ -43,8 +65,8 @@ const NewsPage: FunctionComponent<{
title,
releaseUrl,
subtitle,
releaseDescription: description ? sanitizeHtml(description) : undefined,
links: links ? sanitizeHtml(links) : links,
releaseDescription: sanitize(description),
links: sanitize(links),
contacts,
images,
videos,
Expand Down Expand Up @@ -84,11 +106,9 @@ const NewsPage: FunctionComponent<{
releaseUrl,
headline,
subtitle,
releaseDescription: description ? sanitizeHtml(description) : undefined,
moreInformation: moreInformation
? sanitizeHtml(moreInformation)
: undefined,
links: links ? sanitizeHtml(links) : links,
releaseDescription: sanitize(description),
moreInformation: sanitize(moreInformation),
links: sanitize(links),
contacts,
images,
videos,
Expand Down
2 changes: 1 addition & 1 deletion lib/api/noirlab/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { Locale } from "@/lib/i18n/settings";

client.setConfig({
baseUrl: "https://noirlab.edu",
baseUrl: process.env.NOIRLAB_BASE_URL,
});

export const NOIRLabServices = {
Expand Down
6 changes: 5 additions & 1 deletion openapi-ts.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { defineConfig } from "@hey-api/openapi-ts";
import { loadEnvConfig } from "@next/env";

const projectDir = process.cwd();
loadEnvConfig(projectDir);

export default defineConfig({
client: "@hey-api/client-fetch",
input: "https://noirlab.edu/public/documentation/schema/",
input: `${process.env.NOIRLAB_BASE_URL}/public/documentation/schema/`,
output: {
format: "prettier",
lint: "eslint",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
},
"devDependencies": {
"@hey-api/openapi-ts": "^0.53.11",
"@next/env": "^15.1.3",
"@rushstack/eslint-patch": "^1.1.4",
"@storybook/addon-a11y": "^7.0.8",
"@storybook/addon-essentials": "^7.0.6",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2232,6 +2232,11 @@
resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.15.tgz#06d984e37e670d93ddd6790af1844aeb935f332f"
integrity sha512-S1qaj25Wru2dUpcIZMjxeMVSwkt8BK4dmWHHiBuRstcIyOsMapqT4A4jSB6onvqeygkSSmOkyny9VVx8JIGamQ==

"@next/env@^15.1.3":
version "15.1.3"
resolved "https://registry.yarnpkg.com/@next/env/-/env-15.1.3.tgz#bc747e041cd105170d4cae07cc802e20b4a0c153"
integrity sha512-Q1tXwQCGWyA3ehMph3VO+E6xFPHDKdHFYosadt0F78EObYxPio0S09H9UGYznDe6Wc8eLKLG89GqcFJJDiK5xw==

"@next/eslint-plugin-next@14.2.13":
version "14.2.13"
resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.13.tgz#af433f20273d67a6c9c4f840b799977fc101fe52"
Expand Down
Loading