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

[WIP] feat: add share button for flow links #3483

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
30cae3d
add option for link
RODO94 Jul 31, 2024
01a6c92
add skeleton layout
RODO94 Aug 5, 2024
430a345
openable dialog added without content
RODO94 Aug 5, 2024
325e732
add test link for dialog item
RODO94 Aug 5, 2024
01fdece
add header to dialog box
RODO94 Aug 5, 2024
0af7127
add export to theme setting image wrapper and added to link header:
RODO94 Aug 5, 2024
5dddd17
adjust img wrap and add stack comp to handle link list
RODO94 Aug 5, 2024
2cccbf8
swap export imageWrapper to bespoke within component
RODO94 Aug 5, 2024
e812312
remove export from shared comp
RODO94 Aug 5, 2024
68760d9
add changes to dialog box
RODO94 Aug 6, 2024
a330d3d
add comp for containing link logic
RODO94 Aug 6, 2024
838561c
add isPublished logic to published link
RODO94 Aug 6, 2024
f08f3e9
remove old copy message
RODO94 Aug 6, 2024
1610886
add domain to Link list
RODO94 Aug 6, 2024
52d0c5b
remove console log and string for string replace
RODO94 Aug 6, 2024
a4c8267
add planx-core changes and toggle button
RODO94 Aug 6, 2024
ee3f778
add stylin in line with figma
RODO94 Aug 6, 2024
3538dd3
styling and permissions
RODO94 Aug 6, 2024
80ba13e
fix padding on copy button and switch name to view in line with the text
RODO94 Aug 6, 2024
f56b658
alter copy button name to view button
RODO94 Aug 6, 2024
026a0ec
remove redundant styling
RODO94 Aug 6, 2024
1aa1fa8
fix issue with text under publish button
RODO94 Aug 6, 2024
329beb3
add href for links
RODO94 Aug 6, 2024
a25baab
revert sidebar toggle button
RODO94 Aug 7, 2024
4348a4b
remove z-index style from root
RODO94 Aug 7, 2024
ea6f633
add domain to store init team query
RODO94 Aug 7, 2024
2a8f163
add theme to initTeamStore
RODO94 Aug 7, 2024
cdda20c
add dialog as separate comp
RODO94 Aug 7, 2024
46a30a1
add logic for styling the header
RODO94 Aug 7, 2024
b011484
fix logic for opening and closing dialog in sidebar
RODO94 Aug 7, 2024
78c8ed0
style change for buttons to allow single line txt
RODO94 Aug 7, 2024
616bb7a
reconfig dialog open state to trigger from button
RODO94 Aug 7, 2024
ca510f1
add logic to only look at last instance
RODO94 Aug 7, 2024
10fdc7c
setting up code for new dialog designs
RODO94 Aug 8, 2024
ad75b92
progress modular components for new publish link structure:
RODO94 Aug 12, 2024
e23fdbd
refine link comps and types
RODO94 Aug 12, 2024
4df9605
refactor header logic which creates new array instead of mutating cur…
RODO94 Aug 12, 2024
b1b5f23
stylin updates
RODO94 Aug 12, 2024
4d8d507
tidying types, props, and imported modules
RODO94 Aug 12, 2024
27e77ce
add console and refresh buttons
RODO94 Aug 12, 2024
c4d8629
create logic for published descriptions and service settings nav
RODO94 Aug 12, 2024
2949ae0
adjust publish link comp structure and logic
RODO94 Aug 12, 2024
e1171ad
add href to Link comp
RODO94 Aug 12, 2024
34bfdc2
add copybutton to published link comp
RODO94 Aug 12, 2024
e9b241b
add flowSlug to subdomain
RODO94 Aug 12, 2024
9e2f471
only make subdomain truthy if teamDomain exists logic added
RODO94 Aug 12, 2024
25f1470
refine text of links
RODO94 Aug 12, 2024
6283e66
adjust text for links
RODO94 Aug 12, 2024
606c00d
switch local state to global state for flow status
RODO94 Aug 12, 2024
adffcbf
swap debug console icon as it was same as toggle
RODO94 Aug 12, 2024
2cd239c
alter button styling to match global button style
RODO94 Aug 13, 2024
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: 1 addition & 1 deletion editor.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@mui/material": "^5.15.10",
"@mui/utils": "^5.15.11",
"@opensystemslab/map": "^0.8.3",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#6b2fd26",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#7c37fc3",
"@tiptap/core": "^2.4.0",
"@tiptap/extension-bold": "^2.0.3",
"@tiptap/extension-bubble-menu": "^2.1.13",
Expand Down
16 changes: 8 additions & 8 deletions editor.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions editor.planx.uk/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { clearLocalFlow } from "lib/local";
import { capitalize } from "lodash";
import { Route } from "navi";
import { useAnalyticsTracking } from "pages/FlowEditor/lib/analytics/provider";
import React, { RefObject, useRef, useState } from "react";
import React, { RefObject, useEffect, useRef, useState } from "react";
import {
Link as ReactNaviLink,
useCurrentRoute,
Expand Down Expand Up @@ -577,16 +577,31 @@ const Toolbar: React.FC<ToolbarProps> = ({ headerRef }) => {
};

const Header: React.FC = () => {
const [isOutsideEditor, setIsOutsideEditor] = useState<boolean>(false);
const headerRef = useRef<HTMLDivElement>(null);
const theme = useStore((state) => state.teamTheme);
const environment = useStore((state) => state.previewEnvironment);
const pathnameArray = window.location.pathname.split("/");

useEffect(() => {
const findPathname =
pathnameArray.slice(-1)[0] === "preview" ||
pathnameArray.slice(-1)[0] === "draft";

setIsOutsideEditor(Boolean(findPathname));
}, pathnameArray);

return (
<Root
position="static"
elevation={0}
color="transparent"
ref={headerRef}
sx={{
backgroundColor: theme?.primaryColour || "#2c2c2c",
backgroundColor:
isOutsideEditor || environment === "standalone"
? theme.primaryColour
: "#2c2c2c",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm following the introduction of isOutsideEditor and why this new backgroundColor condition is necessary?

state.previewEnvironment does semi-confusingly return "editor" rather than "standalone" for /draft & /preview routes - but I think we'd want to update this directly rather than introduce a new variable?

Also, broadly, how does changing the header color related to sharing links?

"@media print": { backgroundColor: "white", color: "black" },
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const Flow = ({ breadcrumbs = [] }: any) => {
href: `${window.location.pathname.split(id)[0]}${id}`,
}));

console.log(useStore.getState().flowStatus);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops lingering console.log, please remove!


return (
<>
<ol id="flow" data-layout={flowLayout} className="decisions">
Expand Down
Loading
Loading