@@ -51,14 +51,18 @@ import {
51
51
import {
52
52
$authTokenPermissions ,
53
53
$dataSources ,
54
+ $editingPageId ,
54
55
$instances ,
55
56
$pages ,
56
57
$project ,
57
58
$propsIndex ,
58
59
$publishedOrigin ,
59
60
$userPlanFeatures ,
60
61
} from "~/shared/nano-states" ;
61
- import { $publishDialog } from "../../shared/nano-states" ;
62
+ import {
63
+ $publishDialog ,
64
+ setActiveSidebarPanel ,
65
+ } from "../../shared/nano-states" ;
62
66
import { Domains , PENDING_TIMEOUT , getPublishStatusAndText } from "./domains" ;
63
67
import { CollapsibleDomainSection } from "./collapsible-domain-section" ;
64
68
import {
@@ -242,7 +246,8 @@ const $usedProFeatures = computed(
242
246
( pages , dataSources , instances , propsIndex , styleObjectModel ) => {
243
247
const features = new Map <
244
248
string ,
245
- undefined | { awareness ?: Awareness ; info ?: ReactNode }
249
+ | undefined
250
+ | { awareness ?: Awareness ; view ?: "pageSettings" ; info ?: ReactNode }
246
251
> ( ) ;
247
252
if ( pages === undefined ) {
248
253
return features ;
@@ -258,13 +263,13 @@ const $usedProFeatures = computed(
258
263
instanceSelector : [ page . rootInstanceId ] ,
259
264
} ;
260
265
if ( isPathnamePattern ( page . path ) ) {
261
- features . set ( "Dynamic path" , { awareness } ) ;
266
+ features . set ( "Dynamic path" , { awareness, view : "pageSettings" } ) ;
262
267
}
263
268
if ( page . meta . status && page . meta . status !== `200` ) {
264
- features . set ( "Page status code" , { awareness } ) ;
269
+ features . set ( "Page status code" , { awareness, view : "pageSettings" } ) ;
265
270
}
266
271
if ( page . meta . redirect && page . meta . redirect !== `""` ) {
267
- features . set ( "Redirect" , { awareness } ) ;
272
+ features . set ( "Redirect" , { awareness, view : "pageSettings" } ) ;
268
273
}
269
274
}
270
275
// has resource variables
@@ -824,14 +829,20 @@ const UpgradeBanner = () => {
824
829
< Text variant = "regularBold" > Following Pro features are used:</ Text >
825
830
< Text as = "ul" color = "destructive" css = { { paddingLeft : "1em" } } >
826
831
{ Array . from ( usedProFeatures ) . map (
827
- ( [ message , { awareness, info } = { } ] , index ) => (
832
+ ( [ message , { awareness, view , info } = { } ] , index ) => (
828
833
< li key = { index } >
829
834
< Flex align = "center" gap = "1" >
830
835
{ awareness ? (
831
836
< button
832
837
className = { buttonLinkClass }
833
838
type = "button"
834
- onClick = { ( ) => $awareness . set ( awareness ) }
839
+ onClick = { ( ) => {
840
+ $awareness . set ( awareness ) ;
841
+ if ( view === "pageSettings" ) {
842
+ setActiveSidebarPanel ( "pages" ) ;
843
+ $editingPageId . set ( awareness . pageId ) ;
844
+ }
845
+ } }
835
846
>
836
847
{ message }
837
848
</ button >
0 commit comments