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

refactor History -> RecentChanges

Yuki Takei 5 лет назад
Родитель
Сommit
9115c96cab

+ 2 - 0
resource/locales/en-US/translation.json

@@ -130,6 +130,8 @@
   "Deleted Pages": "Deleted Pages",
   "Sign out": "Logout",
   "Disassociate": "Disassociate",
+  "Recent Created": "Recent Created",
+  "Recent Changes": "Recent Changes",
   "form_validation": {
     "error_message": "Some values ​​are incorrect",
     "required": "%s is required",

+ 2 - 0
resource/locales/ja/translation.json

@@ -129,6 +129,8 @@
   "Deleted Pages": "削除済みページ",
   "Sign out": "ログアウト",
   "Disassociate": "連携解除",
+  "Recent Created": "最新の作成",
+  "Recent Changes": "最新の変更",
   "form_validation": {
     "error_message": "いくつかの値が設定されていません",
     "required": "%sに値を入力してください",

+ 5 - 5
src/client/js/components/Sidebar.jsx

@@ -14,7 +14,7 @@ import { createSubscribedElement } from './UnstatedUtils';
 import AppContainer from '../services/AppContainer';
 
 import SidebarNav from './Sidebar/SidebarNav';
-import History from './Sidebar/History';
+import RecentChanges from './Sidebar/RecentChanges';
 import CustomSidebar from './Sidebar/CustomSidebar';
 
 
@@ -28,7 +28,7 @@ class Sidebar extends React.Component {
   };
 
   state = {
-    currentContentsId: 'history',
+    currentContentsId: 'recent',
   };
 
   componentWillMount() {
@@ -103,11 +103,11 @@ class Sidebar extends React.Component {
   );
 
   renderSidebarContents = () => {
-    let contents = <CustomSidebar></CustomSidebar>;
+    let contents = <CustomSidebar />;
 
     switch (this.state.currentContentsId) {
-      case 'history':
-        contents = <History></History>;
+      case 'recent':
+        contents = <RecentChanges />;
         break;
     }
 

+ 1 - 1
src/client/js/components/Sidebar/CustomSidebar.jsx

@@ -39,7 +39,7 @@ class CustomSidebar extends React.Component {
         <MenuSection>
           { () => (
             <div className="grw-sidebar-content-container p-3">
-              (TBD) Under implemented
+              (TBD) Under implementation
             </div>
           ) }
         </MenuSection>

+ 6 - 5
src/client/js/components/Sidebar/History.jsx → src/client/js/components/Sidebar/RecentChanges.jsx

@@ -22,7 +22,7 @@ import FormattedDistanceDate from '../FormattedDistanceDate';
 import UserPicture from '../User/UserPicture';
 
 const logger = loggerFactory('growi:History');
-class History extends React.Component {
+class RecentChanges extends React.Component {
 
   static propTypes = {
     t: PropTypes.func.isRequired, // i18next
@@ -89,7 +89,8 @@ class History extends React.Component {
         <HeaderSection>
           { () => (
             <div className="grw-sidebar-header-container p-3 d-flex">
-              <h3>{t('History')}</h3>
+              <h3>{t('Recent Changes')}</h3>
+              {/* <h3>{t('Recent Created')}</h3> */} {/* TODO: impl switching */}
               <button type="button" className="btn btn-xs btn-outline-secondary ml-auto" onClick={this.reloadData}>
                 <i className="icon icon-reload"></i>
               </button>
@@ -114,8 +115,8 @@ class History extends React.Component {
 /**
  * Wrapper component for using unstated
  */
-const HistoryWrapper = (props) => {
-  return createSubscribedElement(History, props, [AppContainer]);
+const RecentChangesWrapper = (props) => {
+  return createSubscribedElement(RecentChanges, props, [AppContainer]);
 };
 
-export default withTranslation()(HistoryWrapper);
+export default withTranslation()(RecentChangesWrapper);

+ 1 - 1
src/client/js/components/Sidebar/SidebarNav.jsx

@@ -69,7 +69,7 @@ class SidebarNav extends React.Component {
       <GlobalNav
         primaryItems={[
           this.generatePrimaryItemObj('custom', 'Custom Sidebar', 'fa fa-code'),
-          this.generatePrimaryItemObj('history', 'History', 'icon-clock'),
+          this.generatePrimaryItemObj('recent', 'Recent Changes', 'icon-clock'),
         ]}
         secondaryItems={[
           this.generateSecondaryItemObj('admin', 'Admin', 'icon-settings', '/admin'),