From 955c292ce83817af4470a54bc0efc8d1d3eaab61 Mon Sep 17 00:00:00 2001 From: llj Date: Tue, 31 Oct 2023 21:06:39 +0800 Subject: [PATCH] ['file history' page] redesigned it for markdown file; fixed UI for common files in production environment (#5725) --- frontend/src/css/file-history.css | 8 +++- frontend/src/file-history-old.js | 16 ++++---- frontend/src/file-history.js | 37 +++++++------------ frontend/src/pages/file-history/main-panel.js | 26 ++++++------- 4 files changed, 39 insertions(+), 48 deletions(-) diff --git a/frontend/src/css/file-history.css b/frontend/src/css/file-history.css index e3c5f8f4440..2c7d58370a0 100644 --- a/frontend/src/css/file-history.css +++ b/frontend/src/css/file-history.css @@ -7,6 +7,12 @@ font-size: 1rem; padding: 0.5rem 1rem; } + +.file-history-header { /* for markdown file history */ + background-color: #fff; + height: 50px; +} + .history-header .title { font-size: 1.25rem; line-height: 1rem; @@ -95,7 +101,7 @@ line-height: 50px; font-size: 1rem; padding: 0 10px; - background-color: rgb(250,250,249); + /*background-color: rgb(250,250,249);*/ font-weight: bolder; } diff --git a/frontend/src/file-history-old.js b/frontend/src/file-history-old.js index a9647dfefcf..300366fce32 100644 --- a/frontend/src/file-history-old.js +++ b/frontend/src/file-history-old.js @@ -216,22 +216,22 @@ class FileHistory extends React.Component { Utils.handleSearchedItemClick(searchedItem); }; + goBack = (e) => { + e.preventDefault(); + window.history.back(); + } + render() { return (
- {/* eslint-disable-next-line */} - +

{fileName}{' '}{gettext('History Versions')}

diff --git a/frontend/src/file-history.js b/frontend/src/file-history.js index 561b4acdff8..c123cbe8fd0 100644 --- a/frontend/src/file-history.js +++ b/frontend/src/file-history.js @@ -1,17 +1,13 @@ -import React, { Fragment } from 'react'; +import React from 'react'; import ReactDom from 'react-dom'; import axios from 'axios'; import { fileName, historyRepoID } from './utils/constants'; -import { Utils } from './utils/utils'; -import CommonToolbar from './components/toolbar/common-toolbar'; import SidePanel from './pages/file-history/side-panel'; import MainPanel from './pages/file-history/main-panel'; import { seafileAPI } from './utils/seafile-api'; import './css/layout.css'; import './css/file-history.css'; -import './css/toolbar.css'; -import './css/search.css'; class FileHistory extends React.Component { @@ -24,10 +20,6 @@ class FileHistory extends React.Component { }; } - onSearchedClick = (searchedItem) => { - Utils.handleSearchedItemClick(searchedItem); - }; - setDiffContent = (newMarkdownContent, oldMarkdownContent)=> { this.setState({ renderingContent: false, @@ -68,28 +60,25 @@ class FileHistory extends React.Component { }; render() { - return( - -