itizawa 5 лет назад
Родитель
Сommit
35fbaeb040

+ 0 - 1
resource/locales/en_US/translation.json

@@ -76,7 +76,6 @@
   "Go to this version": "View this version",
   "View diff": "View diff",
   "No diff": "No diff",
-  "Shrink versions that have no diffs": "Shrink versions that have no diffs",
   "User ID": "User ID",
   "User Information": "User information",
   "Basic Info": "Basic info",

+ 0 - 1
resource/locales/ja_JP/translation.json

@@ -77,7 +77,6 @@
   "Go to this version": "このバージョンを見る",
   "View diff": "差分を表示",
   "No diff": "差分なし",
-  "Shrink versions that have no diffs": "差分のないバージョンをコンパクトに表示する",
   "User ID": "ユーザーID",
   "User Information": "ユーザー情報",
   "Basic Info": "ユーザーの基本情報",

+ 0 - 1
resource/locales/zh_CN/translation.json

@@ -80,7 +80,6 @@
 	"Go to this version": "查看此版本",
 	"View diff": "查看差异",
 	"No diff": "无差异",
-	"Shrink versions that have no diffs": "收缩没有差异的版本",
 	"User ID": "用户ID",
 	"Home": "首页",
 	"My Drafts": "My Drafts",

+ 3 - 35
src/client/js/components/PageHistory/PageRevisionList.jsx

@@ -9,20 +9,6 @@ import RevisionSelector from '../RevisionComparer/RevisionSelector';
 
 class PageRevisionList extends React.Component {
 
-  constructor(props) {
-    super(props);
-
-    this.state = {
-      isCompactNodiffRevisions: true,
-    };
-
-    this.cbCompactizeChangeHandler = this.cbCompactizeChangeHandler.bind(this);
-  }
-
-  cbCompactizeChangeHandler() {
-    this.setState({ isCompactNodiffRevisions: !this.state.isCompactNodiffRevisions });
-  }
-
   /**
    * render a row (Revision component and RevisionDiff component)
    * @param {Revison} revision
@@ -49,7 +35,6 @@ class PageRevisionList extends React.Component {
             isLatestRevision={revision === latestRevision}
             revisionDiffOpened={revisionDiffOpened}
             hasDiff={hasDiff}
-            isCompactNodiffRevisions={this.state.isCompactNodiffRevisions}
             key={`revision-history-rev-${revisionId}`}
           />
           {hasDiff && (
@@ -63,7 +48,7 @@ class PageRevisionList extends React.Component {
                 aria-expanded="true"
               >
                 <span className="float-left">
-                  hoge
+                  最新と比較
                 </span>
               </button>
               <div className="dropdown-menu" aria-labelledby="dropdownMenuButton">
@@ -115,28 +100,11 @@ class PageRevisionList extends React.Component {
       return this.renderRow(revision, previousRevision, hasDiff, isContiguousNodiff);
     });
 
-    const classNames = ['revision-history-list'];
-    if (this.state.isCompactNodiffRevisions) {
-      classNames.push('revision-history-list-compact');
-    }
-
     return (
       <React.Fragment>
-        <div className="d-flex">
-          <h3>{t('page_history.revision_list')}</h3>
-          <div className="custom-control custom-checkbox custom-checkbox-info ml-auto">
-            <input
-              type="checkbox"
-              id="cbCompactize"
-              className="custom-control-input"
-              checked={this.state.isCompactNodiffRevisions}
-              onChange={this.cbCompactizeChangeHandler}
-            />
-            <label className="custom-control-label" htmlFor="cbCompactize">{ t('Shrink versions that have no diffs') }</label>
-          </div>
-        </div>
+        <h3>{t('page_history.revision_list')}</h3>
         <hr />
-        <div className={classNames.join(' ')}>
+        <div className="revision-history-list revision-history-list-compact">
           <div className="revision-history-list-container">
             <div className="revision-history-list-content-header sticky-top bg-white">
               <div className="row no-gutters">

+ 1 - 2
src/client/js/components/PageHistory/Revision.jsx

@@ -74,7 +74,7 @@ export default class Revision extends React.Component {
   render() {
     const revision = this.props.revision;
 
-    if (this.props.isCompactNodiffRevisions && !this.props.hasDiff) {
+    if (!this.props.hasDiff) {
       return this.renderSimplifiedNodiff(revision);
     }
 
@@ -90,5 +90,4 @@ Revision.propTypes = {
   isLatestRevision: PropTypes.bool.isRequired,
   revisionDiffOpened: PropTypes.bool.isRequired,
   hasDiff: PropTypes.bool.isRequired,
-  isCompactNodiffRevisions: PropTypes.bool.isRequired,
 };

+ 2 - 4
src/client/styles/scss/_page-history.scss

@@ -57,10 +57,8 @@
   }
 
   // compacted list
-  .revision-history-list-compact {
-    .revision-history-outer-contiguous-nodiff {
-      border-top: unset !important; // force unset border
-    }
+  .revision-history-outer-contiguous-nodiff {
+    border-top: unset !important; // force unset border
   }
 
   .revision-compare {