GeezerVison is showing github.com — fix(view): apply notifier configuration · stackpress/stackpress@cf51da9
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .agents/references/00012-view-api-contracts.md +2-1Lines changed: 2 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -113,7 +113,8 @@ setViewProps(req: Request, res: Response, ctx: Server): void | 113 | 113 | It returns immediately when the no-view flag exists. Otherwise it copies | 114 | 114 | sanitized config subsets into `res.data`: | 115 | 115 |
| 116 | | -- `view`: `base` default `/`, `props` default `{}`; | | 116 | +- `view`: `base` default `/`, `props` default `{}`, notifier options from | | 117 | + `notify` default `{}`; | 117 | 118 | - `brand`: name `Stackpress`, logo `/logo.png`, icon `/icon.png`, favicon | 118 | 119 | `/favicon.ico`; | 119 | 120 | - `language`: key `locale`, locale `en_US`, languages `{}`. | |
Collapse file Copy file name to clipboard +2-13Lines changed: 2 additions & 13 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -//modules | 2 | | -import { useEffect } from 'react'; | 3 | | -import { notify, unload } from 'frui/Notifier'; | 4 | 1 | //stackpress-view | 5 | 2 | import LayoutPanel from 'stackpress-view/layout/LayoutPanel'; | 6 | 3 | //stackpress-admin | @@ -18,18 +15,10 @@ export default function LayoutAdmin(props: AdminLayoutProps) { | 18 | 15 | } = props; | 19 | 16 | const { admin = {} } = data || {}; | 20 | 17 | const { menu = [] } = admin; | 21 | | - //effects | 22 | | - // unload any flash messages from the server | 23 | | - useEffect(() => { | 24 | | - unload(cookie); | 25 | | - }, []); | 26 | | - // if there is an error in the response, show a notification | 27 | | - useEffect(() => { | 28 | | - response?.error && notify('error', response.error); | 29 | | - }, [ response?.error ]); | 30 | 18 | //render | 31 | 19 | return ( | 32 | 20 | <LayoutPanel | | 21 | + cookie={cookie} | 33 | 22 | menu={menu} | 34 | 23 | data={data} | 35 | 24 | session={session} | @@ -39,4 +28,4 @@ export default function LayoutAdmin(props: AdminLayoutProps) { | 39 | 28 | {children} | 40 | 29 | </LayoutPanel> | 41 | 30 | ); | 42 | | -}; | | 31 | +}; |
Collapse file Copy file name to clipboardExpand all lines: packages/stackpress-admin/src/transform/pages/copy.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -131,7 +131,8 @@ const admin = ctx.config.path<AdminConfig>('admin', {}); | 131 | 131 | //set data for template layer | 132 | 132 | res.data.set('view', { | 133 | 133 | base: view.base || '/', | 134 | | - props: view.props || {} | | 134 | + props: view.props || {}, | | 135 | + notify: view.notify || {} | 135 | 136 | }); | 136 | 137 | res.data.set('brand', { | 137 | 138 | name: brand.name || 'Stackpress', | |
Collapse file Copy file name to clipboardExpand all lines: packages/stackpress-admin/src/transform/pages/create.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -118,7 +118,8 @@ const admin = ctx.config.path<AdminConfig>('admin', {}); | 118 | 118 | //set data for template layer | 119 | 119 | res.data.set('view', { | 120 | 120 | base: view.base || '/', | 121 | | - props: view.props || {} | | 121 | + props: view.props || {}, | | 122 | + notify: view.notify || {} | 122 | 123 | }); | 123 | 124 | res.data.set('brand', { | 124 | 125 | name: brand.name || 'Stackpress', | |
Collapse file Copy file name to clipboardExpand all lines: packages/stackpress-admin/src/transform/pages/detail.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -136,7 +136,8 @@ const admin = ctx.config.path<AdminConfig>('admin', {}); | 136 | 136 | //set data for template layer | 137 | 137 | res.data.set('view', { | 138 | 138 | base: view.base || '/', | 139 | | - props: view.props || {} | | 139 | + props: view.props || {}, | | 140 | + notify: view.notify || {} | 140 | 141 | }); | 141 | 142 | res.data.set('brand', { | 142 | 143 | name: brand.name || 'Stackpress', | |
Collapse file Copy file name to clipboardExpand all lines: packages/stackpress-admin/src/transform/pages/detail/create.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -157,7 +157,8 @@ const admin = ctx.config.path<AdminConfig>('admin', {}); | 157 | 157 | //set data for template layer | 158 | 158 | res.data.set('view', { | 159 | 159 | base: view.base || '/', | 160 | | - props: view.props || {} | | 160 | + props: view.props || {}, | | 161 | + notify: view.notify || {} | 161 | 162 | }); | 162 | 163 | res.data.set('brand', { | 163 | 164 | name: brand.name || 'Stackpress', | |
Collapse file Copy file name to clipboardExpand all lines: packages/stackpress-admin/src/transform/pages/detail/search.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -139,7 +139,8 @@ const admin = ctx.config.path<AdminConfig>('admin', {}); | 139 | 139 | //set data for template layer | 140 | 140 | res.data.set('view', { | 141 | 141 | base: view.base || '/', | 142 | | - props: view.props || {} | | 142 | + props: view.props || {}, | | 143 | + notify: view.notify || {} | 143 | 144 | }); | 144 | 145 | res.data.set('brand', { | 145 | 146 | name: brand.name || 'Stackpress', | |
Collapse file Copy file name to clipboardExpand all lines: packages/stackpress-admin/src/transform/pages/remove.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -114,7 +114,8 @@ const admin = ctx.config.path<AdminConfig>('admin', {}); | 114 | 114 | //set data for template layer | 115 | 115 | res.data.set('view', { | 116 | 116 | base: view.base || '/', | 117 | | - props: view.props || {} | | 117 | + props: view.props || {}, | | 118 | + notify: view.notify || {} | 118 | 119 | }); | 119 | 120 | res.data.set('brand', { | 120 | 121 | name: brand.name || 'Stackpress', | |
Collapse file Copy file name to clipboardExpand all lines: packages/stackpress-admin/src/transform/pages/restore.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -120,7 +120,8 @@ const admin = ctx.config.path<AdminConfig>('admin', {}); | 120 | 120 | //set data for template layer | 121 | 121 | res.data.set('view', { | 122 | 122 | base: view.base || '/', | 123 | | - props: view.props || {} | | 123 | + props: view.props || {}, | | 124 | + notify: view.notify || {} | 124 | 125 | }); | 125 | 126 | res.data.set('brand', { | 126 | 127 | name: brand.name || 'Stackpress', | |
Collapse file Copy file name to clipboardExpand all lines: packages/stackpress-admin/src/transform/pages/search.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -113,7 +113,8 @@ const admin = ctx.config.path<AdminConfig>('admin', {}); | 113 | 113 | //set data for template layer | 114 | 114 | res.data.set('view', { | 115 | 115 | base: view.base || '/', | 116 | | - props: view.props || {} | | 116 | + props: view.props || {}, | | 117 | + notify: view.notify || {} | 117 | 118 | }); | 118 | 119 | res.data.set('brand', { | 119 | 120 | name: brand.name || 'Stackpress', | |
|