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

Production deploy #3310

Merged
merged 5 commits into from
Jun 21, 2024
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
2 changes: 2 additions & 0 deletions editor.planx.uk/src/@planx/components/List/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { ResidentialUnitsExisting } from "./schemas/ResidentialUnits/Existing";
import { ResidentialUnitsGLAGained } from "./schemas/ResidentialUnits/GLA/Gained";
import { ResidentialUnitsGLALost } from "./schemas/ResidentialUnits/GLA/Lost";
import { ResidentialUnitsProposed } from "./schemas/ResidentialUnits/Proposed";
import { NonResidentialFloorspace } from "./schemas/Floorspace";

type Props = EditorProps<TYPES.List, List>;

Expand All @@ -35,6 +36,7 @@ export const SCHEMAS = [
schema: ResidentialUnitsGLAGained,
},
{ name: "Residential units (GLA) - Lost", schema: ResidentialUnitsGLALost },
{ name: "Non-residential floorspace", schema: NonResidentialFloorspace },
{
name: "Existing and proposed uses (GLA)",
schema: ExistingAndProposedUsesGLA,
Expand Down
171 changes: 171 additions & 0 deletions editor.planx.uk/src/@planx/components/List/schemas/Floorspace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
import { Schema } from "@planx/components/List/model";

export const NonResidentialFloorspace: Schema = {
type: "Non-residential floorspace",
fields: [
{
type: "question",
data: {
title: "Use class or type",
fn: "useClass",
options: [
{ id: "bTwo", data: { text: "B2 - General industry", val: "bTwo" } },
{
id: "bEight",
data: { text: "B8 - Storage and distribution", val: "bEight" },
},
{ id: "cOne", data: { text: "C1 - Hotels", val: "cOne" } },
{
id: "cTwo",
data: { text: "C2 - Residential institutions", val: "cTwo" },
},
{
id: "cTwoA",
data: {
text: "C2a - Secure residential institutions",
val: "cTwoA",
},
},
{
id: "eAShops",
data: { text: "E(a) - Retail (other than hot food): Shops", val: "eAShops" },
},
{
id: "eANetTradeableArea",
data: { text: "E(a) - Retail (other than hot food): Net tradeable area", val: "eANetTradeableArea" },
},
{
id: "eB",
data: { text: "E(b) - Sale of food and drink (mostly consumed on the premises)", val: "eB" },
},
{
id: "eCI",
data: { text: "E(c)(i) - Financial services", val: "eCI" },
},
{
id: "eCII",
data: { text: "E(c)(ii) - Professional services (other than health or medical)", val: "eCII" },
},
{
id: "eCIII",
data: { text: "E(c)(iii) - Any other service", val: "eCIII" },
},
{
id: "eD",
data: { text: "E(d) - Indoor sports, recreation or fitness", val: "eD" },
},
{
id: "eF",
data: { text: "E(f) - Creche or day nursery", val: "eF" },
},
{
id: "eGI",
data: { text: "E(g)(i) - Office (to carry out operational or administrative functions)", val: "eGI" },
},
{
id: "eGII",
data: { text: "E(g)(ii) - Research and development of products or processes", val: "eGII" },
},
{
id: "eGIII",
data: { text: "E(g)(iii) - Any industrial process (can be carried out within a residential area)", val: "eGIII" },
},
{
id: "fOneA",
data: {
text: "F1(a) - Education",
val: "fOneA",
},
},
{
id: "fOneB",
data: {
text: "F1(b) - Display works of art",
val: "fOneB",
},
},
{
id: "fOneC",
data: {
text: "F1(c) - Museum",
val: "fOneC",
},
},
{
id: "fOneD",
data: {
text: "F1(d) - Public library",
val: "fOneD",
},
},
{
id: "fOneE",
data: {
text: "F1(e) - Public hall or exhibition hall",
val: "fOneE",
},
},
{
id: "fOneF",
data: {
text: "F1(f) - Public worship or religious instruction",
val: "fOneF",
},
},
{
id: "fOneG",
data: {
text: "F1(g) - Law court",
val: "fOneG",
},
},
{
id: "fTwoA",
data: { text: "F2(a) - Shop selling essential goods (not over 280sqm and no other such facility in 1000m radius)", val: "fTwoA" },
},
{
id: "fTwoB",
data: { text: "F2(b) - Hall or meeting place for local community (principal use)", val: "fTwoB" },
},
{
id: "fTwoC",
data: { text: "F2(c) - Outdoor sport or recreation", val: "fTwoC" },
},
{
id: "fTwoD",
data: { text: "F2(d) - Indoor or outdoor swimming pool or skating rink", val: "fTwoD" },
},
{ id: "other", data: { text: "Other", val: "other" } },
],
},
},
{
type: "number",
data: {
title: "What is the existing gross internal floor area?",
units: "m²",
fn: "area.existing",
allowNegatives: false,
},
},
{
type: "number",
data: {
title: "What is the gross internal floor area to be lost by change of use or demolition?",
units: "m²",
fn: "area.loss",
allowNegatives: false,
},
},
{
type: "number",
data: {
title: "What is the total gross internal floor area proposed (including change of use)?",
units: "m²",
fn: "area.proposed",
allowNegatives: false,
},
},
],
min: 1,
} as const;
59 changes: 31 additions & 28 deletions editor.planx.uk/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { styled, Theme } from "@mui/material/styles";
import MuiToolbar from "@mui/material/Toolbar";
import Typography from "@mui/material/Typography";
import useMediaQuery from "@mui/material/useMediaQuery";
import { visuallyHidden } from "@mui/utils";
import { ComponentType as TYPES } from "@opensystemslab/planx-core/types";
import { clearLocalFlow } from "lib/local";
import { capitalize } from "lodash";
Expand Down Expand Up @@ -48,8 +47,8 @@ import TestEnvironmentBanner from "./TestEnvironmentBanner";

export const HEADER_HEIGHT = 74;

const Root = styled(AppBar)(() => ({
color: "#fff",
const Root = styled(AppBar)(({ theme }) => ({
color: theme.palette.common.white,
}));

const BreadcrumbsRoot = styled(Box)(() => ({
Expand All @@ -60,6 +59,12 @@ const BreadcrumbsRoot = styled(Box)(() => ({
alignItems: "center",
}));

const BreadcrumbsLink = styled(Link)(({ theme }) => ({
color: theme.palette.common.white,
textDecoration: "none",
borderBottom: "1px solid currentColor",
})) as typeof Link;

const StyledToolbar = styled(MuiToolbar)(() => ({
height: HEADER_HEIGHT,
}));
Expand Down Expand Up @@ -103,7 +108,7 @@ const StyledPopover = styled(Popover)(({ theme }) => ({

const StyledPaper = styled(Paper)(({ theme }) => ({
backgroundColor: theme.palette.background.dark,
color: "#fff",
color: theme.palette.common.white,
borderRadius: 0,
boxShadow: "none",
minWidth: 180,
Expand Down Expand Up @@ -131,7 +136,7 @@ const SkipLink = styled("a")(({ theme }) => ({
width: "100vw",
height: HEADER_HEIGHT / 2,
backgroundColor: theme.palette.background.dark,
color: "#fff",
color: theme.palette.common.white,
textDecoration: "underline",
padding: theme.spacing(1),
paddingLeft: theme.spacing(3),
Expand Down Expand Up @@ -203,33 +208,25 @@ const Breadcrumbs: React.FC = () => {

return (
<BreadcrumbsRoot>
<Link
style={{
color: "#fff",
textDecoration: "none",
}}
<BreadcrumbsLink
component={ReactNaviLink}
href={"/"}
prefetch={false}
{...(isStandalone && { target: "_blank" })}
>
Plan✕
</Link>
</BreadcrumbsLink>
{team.slug && (
<>
{" / "}
<Link
style={{
color: "#fff",
textDecoration: "none",
}}
<BreadcrumbsLink
component={ReactNaviLink}
href={`/${team.slug}`}
prefetch={false}
{...(isStandalone && { target: "_blank" })}
>
{team.slug}
</Link>
</BreadcrumbsLink>
</>
)}
{route.data.flow && (
Expand Down Expand Up @@ -467,26 +464,32 @@ const EditorToolbar: React.FC<{
<MenuOpenIcon />
</IconButton>
)}
<Box mr={1}>
<Box mr={1}></Box>
<IconButton
edge="end"
color="inherit"
aria-label="Toggle Menu"
onClick={handleMenuToggle}
size="large"
>
<Avatar
component="span"
sx={{
bgcolor: grey[200],
color: "text.primary",
fontSize: "1em",
fontWeight: "600",
fontSize: "1rem",
fontWeight: FONT_WEIGHT_SEMI_BOLD,
width: 33,
height: 33,
marginRight: "0.5rem",
}}
>
{user.firstName[0]}
{user.lastName[0]}
</Avatar>
</Box>
<IconButton
edge="end"
color="inherit"
aria-label="Toggle Menu"
onClick={handleMenuToggle}
size="large"
>
<Typography variant="body2" fontSize="small">
Menu
</Typography>
<KeyboardArrowDown />
</IconButton>
</ProfileSection>
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const hasJWT = (): boolean | void => {
// Remove JWT from URL, and re-run this function
setCookie("jwt", jwtSearchParams);
setCookie("auth", { loggedIn: true });
window.location.href = "/";
window.history.go(-1);
};

const Layout: React.FC<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import InputDescription from "ui/editor/InputDescription";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

import { DesignPreview, FormProps, SettingsForm } from ".";
import { DesignPreview, FormProps } from ".";
import { SettingsForm } from "../shared/SettingsForm";

export const ButtonForm: React.FC<FormProps> = ({
formikConfig,
Expand All @@ -33,7 +34,7 @@ export const ButtonForm: React.FC<FormProps> = ({
});

return (
<SettingsForm
<SettingsForm<TeamTheme>
formik={formik}
legend="Button colour"
description={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";
import InputRowLabel from "ui/shared/InputRowLabel";

import { FormProps, SettingsForm } from ".";
import { FormProps } from ".";
import { SettingsForm } from "../shared/SettingsForm";

export const FaviconForm: React.FC<FormProps> = ({
formikConfig,
Expand All @@ -36,7 +37,7 @@ export const FaviconForm: React.FC<FormProps> = ({
: formik.setFieldValue("favicon", null);

return (
<SettingsForm
<SettingsForm<TeamTheme>
formik={formik}
legend="Favicon"
description={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import InputDescription from "ui/editor/InputDescription";
import InputRow from "ui/shared/InputRow";
import InputRowItem from "ui/shared/InputRowItem";

import { DesignPreview, FormProps, SettingsForm } from ".";
import { DesignPreview, FormProps } from ".";
import { SettingsForm } from "../shared/SettingsForm";

export const TextLinkForm: React.FC<FormProps> = ({
formikConfig,
Expand Down Expand Up @@ -43,7 +44,7 @@ export const TextLinkForm: React.FC<FormProps> = ({
});

return (
<SettingsForm
<SettingsForm<TeamTheme>
formik={formik}
legend="Text link colour"
description={
Expand Down
Loading
Loading