|
|
@@ -34,34 +34,12 @@ import MyDraftList from './components/MyDraftList/MyDraftList';
|
|
|
import UserPictureList from './components/User/UserPictureList';
|
|
|
import TableOfContents from './components/TableOfContents';
|
|
|
|
|
|
-import AdminHome from './components/Admin/AdminHome/AdminHome';
|
|
|
-import UserGroupDetailPage from './components/Admin/UserGroupDetail/UserGroupDetailPage';
|
|
|
-import NotificationSetting from './components/Admin/Notification/NotificationSetting';
|
|
|
-import ManageGlobalNotification from './components/Admin/Notification/ManageGlobalNotification';
|
|
|
-import MarkdownSetting from './components/Admin/MarkdownSetting/MarkDownSetting';
|
|
|
-import UserManagement from './components/Admin/UserManagement';
|
|
|
-import AppSettingsPage from './components/Admin/App/AppSettingsPage';
|
|
|
-import ManageExternalAccount from './components/Admin/ManageExternalAccount';
|
|
|
-import UserGroupPage from './components/Admin/UserGroup/UserGroupPage';
|
|
|
-import Customize from './components/Admin/Customize/Customize';
|
|
|
-import ImportDataPage from './components/Admin/ImportDataPage';
|
|
|
-import ExportArchiveDataPage from './components/Admin/ExportArchiveDataPage';
|
|
|
-import FullTextSearchManagement from './components/Admin/FullTextSearchManagement';
|
|
|
-
|
|
|
import AppContainer from './services/AppContainer';
|
|
|
import PageContainer from './services/PageContainer';
|
|
|
import CommentContainer from './services/CommentContainer';
|
|
|
import EditorContainer from './services/EditorContainer';
|
|
|
import TagContainer from './services/TagContainer';
|
|
|
-import AdminHomeContainer from './services/AdminHomeContainer';
|
|
|
-import AdminCustomizeContainer from './services/AdminCustomizeContainer';
|
|
|
-import UserGroupDetailContainer from './services/UserGroupDetailContainer';
|
|
|
-import AdminUsersContainer from './services/AdminUsersContainer';
|
|
|
-import AdminAppContainer from './services/AdminAppContainer';
|
|
|
import WebsocketContainer from './services/WebsocketContainer';
|
|
|
-import AdminMarkDownContainer from './services/AdminMarkDownContainer';
|
|
|
-import AdminExternalAccountsContainer from './services/AdminExternalAccountsContainer';
|
|
|
-import AdminNotificationContainer from './services/AdminNotificationContainer';
|
|
|
|
|
|
const logger = loggerFactory('growi:app');
|
|
|
|
|
|
@@ -114,10 +92,7 @@ let componentMappings = {
|
|
|
'user-created-list': <RecentCreated />,
|
|
|
'user-draft-list': <MyDraftList />,
|
|
|
|
|
|
- 'admin-full-text-search-management': <FullTextSearchManagement />,
|
|
|
-
|
|
|
'staff-credit': <StaffCredit />,
|
|
|
- 'admin-importer': <ImportDataPage />,
|
|
|
};
|
|
|
|
|
|
// additional definitions if data exists
|
|
|
@@ -161,99 +136,6 @@ Object.keys(componentMappings).forEach((key) => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-// create unstated container instance for admin
|
|
|
-const adminHomeContainer = new AdminHomeContainer(appContainer);
|
|
|
-const adminCustomizeContainer = new AdminCustomizeContainer(appContainer);
|
|
|
-const adminUsersContainer = new AdminUsersContainer(appContainer);
|
|
|
-const adminExternalAccountsContainer = new AdminExternalAccountsContainer(appContainer);
|
|
|
-const adminNotificationContainer = new AdminNotificationContainer(appContainer);
|
|
|
-const adminMarkDownContainer = new AdminMarkDownContainer(appContainer);
|
|
|
-const adminContainers = {
|
|
|
- 'admin-home': adminHomeContainer,
|
|
|
- 'admin-customize': adminCustomizeContainer,
|
|
|
- 'admin-user-page': adminUsersContainer,
|
|
|
- 'admin-external-account-setting': adminExternalAccountsContainer,
|
|
|
- 'admin-notification-setting': adminNotificationContainer,
|
|
|
- 'admin-global-notification-setting': adminNotificationContainer,
|
|
|
- 'admin-markdown-setting': adminMarkDownContainer,
|
|
|
- 'admin-export-page': websocketContainer,
|
|
|
-};
|
|
|
-
|
|
|
-// render for admin
|
|
|
-const adminAppElem = document.getElementById('admin-app');
|
|
|
-if (adminAppElem != null) {
|
|
|
- const adminAppContainer = new AdminAppContainer(appContainer);
|
|
|
- ReactDOM.render(
|
|
|
- <Provider inject={[injectableContainers, adminAppContainer]}>
|
|
|
- <I18nextProvider i18n={i18n}>
|
|
|
- <AppSettingsPage />
|
|
|
- </I18nextProvider>
|
|
|
- </Provider>,
|
|
|
- adminAppElem,
|
|
|
- );
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * define components
|
|
|
- * key: id of element
|
|
|
- * value: React Element
|
|
|
- */
|
|
|
-const adminComponentMappings = {
|
|
|
- 'admin-home': <AdminHome />,
|
|
|
- 'admin-customize': <Customize />,
|
|
|
- 'admin-user-page': <UserManagement />,
|
|
|
- 'admin-external-account-setting': <ManageExternalAccount />,
|
|
|
- 'admin-notification-setting': <NotificationSetting />,
|
|
|
- 'admin-global-notification-setting': <ManageGlobalNotification />,
|
|
|
- 'admin-markdown-setting': <MarkdownSetting />,
|
|
|
- 'admin-export-page': <ExportArchiveDataPage crowi={appContainer} />,
|
|
|
-};
|
|
|
-
|
|
|
-
|
|
|
-Object.keys(adminComponentMappings).forEach((key) => {
|
|
|
- const adminElem = document.getElementById(key);
|
|
|
- if (adminElem) {
|
|
|
- ReactDOM.render(
|
|
|
- <Provider inject={[injectableContainers, adminContainers[key]]}>
|
|
|
- <I18nextProvider i18n={i18n}>
|
|
|
- {adminComponentMappings[key]}
|
|
|
- </I18nextProvider>
|
|
|
- </Provider>,
|
|
|
- adminElem,
|
|
|
- );
|
|
|
- }
|
|
|
-});
|
|
|
-
|
|
|
-const adminUserGroupDetailElem = document.getElementById('admin-user-group-detail');
|
|
|
-if (adminUserGroupDetailElem != null) {
|
|
|
- const userGroupDetailContainer = new UserGroupDetailContainer(appContainer);
|
|
|
- ReactDOM.render(
|
|
|
- <Provider inject={[userGroupDetailContainer]}>
|
|
|
- <I18nextProvider i18n={i18n}>
|
|
|
- <UserGroupDetailPage />
|
|
|
- </I18nextProvider>
|
|
|
- </Provider>,
|
|
|
- adminUserGroupDetailElem,
|
|
|
- );
|
|
|
-}
|
|
|
-
|
|
|
-const adminUserGroupPageElem = document.getElementById('admin-user-group-page');
|
|
|
-if (adminUserGroupPageElem != null) {
|
|
|
- const isAclEnabled = adminUserGroupPageElem.getAttribute('data-isAclEnabled') === 'true';
|
|
|
-
|
|
|
- ReactDOM.render(
|
|
|
- <Provider inject={[websocketContainer]}>
|
|
|
- <I18nextProvider i18n={i18n}>
|
|
|
- <UserGroupPage
|
|
|
- crowi={appContainer}
|
|
|
- isAclEnabled={isAclEnabled}
|
|
|
- />
|
|
|
- </I18nextProvider>
|
|
|
- </Provider>,
|
|
|
- adminUserGroupPageElem,
|
|
|
- );
|
|
|
-}
|
|
|
-
|
|
|
// うわーもうー (commented by Crowi team -- 2018.03.23 Yuki Takei)
|
|
|
$('a[data-toggle="tab"][href="#revision-history"]').on('show.bs.tab', () => {
|
|
|
ReactDOM.render(
|