Просмотр исходного кода

try to show /me/in-app-notification html

kaori 4 лет назад
Родитель
Сommit
bb38f0f505

+ 2 - 0
packages/app/src/client/app.jsx

@@ -5,6 +5,7 @@ import { I18nextProvider } from 'react-i18next';
 
 import loggerFactory from '~/utils/logger';
 
+import AllInAppNotificationList from '../components/InAppNotification/AllInAppNotificationList';
 import ErrorBoundary from '../components/ErrorBoudary';
 import Sidebar from '../components/Sidebar';
 import SearchPage from '../components/SearchPage';
@@ -83,6 +84,7 @@ Object.assign(componentMappings, {
   'grw-sidebar-wrapper': <Sidebar />,
 
   'search-page': <SearchPage crowi={appContainer} />,
+  'all-in-app-notification-list': <AllInAppNotificationList />,
 
   // 'revision-history': <PageHistory pageId={pageId} />,
   'tags-page': <TagsList crowi={appContainer} />,

+ 1 - 1
packages/app/src/components/InAppNotification/InAppNotificationDropdown.tsx

@@ -157,7 +157,7 @@ const InAppNotificationDropdown: FC<Props> = (props: Props) => {
         <InAppNotificationContents />
         <DropdownItem divider />
         {/* TODO: Able to show all notifications by #79317 */}
-        <a className="dropdown-item d-flex justify-content-center">See All</a>
+        <a className="dropdown-item d-flex justify-content-center" href="/me/in-app-notification">See All</a>
       </DropdownMenu>
     </Dropdown>
   );

+ 9 - 0
packages/app/src/server/routes/in-app-notification.ts

@@ -0,0 +1,9 @@
+import {
+  Request, Response,
+} from 'express';
+
+export const list = (req: Request, res: Response): void => {
+  console.log('hogehoge');
+
+  return res.render('/me/in-app-notification');
+};

+ 2 - 0
packages/app/src/server/routes/index.js

@@ -3,6 +3,7 @@ import express from 'express';
 import injectResetOrderByTokenMiddleware from '../middlewares/inject-reset-order-by-token-middleware';
 
 import * as forgotPassword from './forgot-password';
+import * as inAppNotification from './in-app-notification';
 
 const multer = require('multer');
 const autoReap = require('multer-autoreap');
@@ -138,6 +139,7 @@ module.exports = function(crowi, app) {
   app.get('/me/external-accounts'                         , loginRequiredStrictly , me.externalAccounts.list);
   // my drafts
   app.get('/me/drafts'                , loginRequiredStrictly, me.drafts.list);
+  app.get('/me/in-app-notification'   , loginRequiredStrictly, inAppNotification.list);
 
   app.get('/:id([0-9a-z]{24})'       , loginRequired , page.redirector);
   app.get('/_r/:id([0-9a-z]{24})'    , loginRequired , page.redirector); // alias

+ 21 - 0
packages/app/src/server/views/me/in-app-notification.html

@@ -0,0 +1,21 @@
+{% extends '../layout/layout.html' %}
+
+{% block html_title %}{{ customizeService.generateCustomTitleForFixedPageName(t('My Drafts')) }}{% endblock %}
+
+{% block layout_main %}
+
+{% block content_header_wrapper %}
+<header class="py-3">
+  <div class="container-fluid">
+    <h1 class="title">{{ t('My Drafts') }}</h1>
+  </div>
+</header>
+<div id="grw-fav-sticky-trigger" class="sticky-top"></div>
+{% endblock %}
+
+<div id="main" class="main">
+  <div id="content-main" class="content-main grw-container-convertible">
+    <div id="my-drafts"></div>
+  </div>
+</div>
+{% endblock %}