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

[MIM-1747] Make highmap show in edit mode #2537

Merged
merged 1 commit into from
Feb 20, 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
1 change: 1 addition & 0 deletions src/main/resources/site/parts/highchart/highchart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function renderPart(req: XP.Request, highchartIds: Array<string>): XP.Response {
if (isEnabled('highchart-react', true, 'ssb')) {
// R4xp disables hydration in edit mode, but highcharts need hydration to show
// we sneaky swap mode since we want a render of higchart in edit mode
// Works good for highchart macro, not so much when part
const _req = req
if (req.mode === 'edit') _req.mode = 'preview'

Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/site/parts/highmap/highmap.ts
Copy link
Contributor

Choose a reason for hiding this comment

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

På linje 72 rendres en placeholder i stedet for å kjøre render på parten, så den når aldri koden du har endret på så i edit-mode når jeg setter inn en highmap-part ser det slik ut (se skjermbilde under). Er det med vilje?
Screenshot 2024-02-19 at 10 26 44

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tror vi beholder den for highmap parten. Visning i edit mode funker best når du er på selve highmap innholdet eller bruker det gjennom macro, funker litt dårlig når det er part.

Copy link
Contributor

Choose a reason for hiding this comment

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

Den fungerer forøvrig med visning både når jeg redigerer selve highmapen og som makro når jeg redigerer en artikkel. Så derfor lurer jeg på om den kunne ha vært rendret her også

Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ function renderPart(req: XP.Request, highmapId: string | undefined): XP.Response
language: page.language,
}


// R4xp disables hydration in edit mode, but highmap need hydration to show
// we sneaky swap mode since we want a render of highmap in edit mode
// Works good for highmap macro, not so much when part
if (req.mode === 'edit') req.mode = 'preview'
return render('site/parts/highmap/Highmap', props, req)
}
return {
Expand Down
Loading