Skip to content

Commit

Permalink
remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
Aries-0331 committed Aug 18, 2024
1 parent f24ed0c commit 3b6b22e
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 12 deletions.
1 change: 0 additions & 1 deletion frontend/src/components/cur-dir-path/dir-tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const propTypes = {
sortOrder: PropTypes.string,
sortItems: PropTypes.func,
viewId: PropTypes.string,
viewType: PropTypes.string,
};

class DirTool extends React.Component {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/components/cur-dir-path/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const propTypes = {
repoTags: PropTypes.array.isRequired,
onFileTagChanged: PropTypes.func.isRequired,
viewId: PropTypes.string,
viewType: PropTypes.string,
onItemMove: PropTypes.func.isRequired,
};

Expand Down Expand Up @@ -103,7 +102,6 @@ class CurDirPath extends React.Component {
sortOrder={this.props.sortOrder}
sortItems={this.props.sortItems}
viewId={this.props.viewId}
viewType={this.props.viewType}
/>}
{!isDesktop && this.props.direntList.length > 0 &&
<span className="sf3-font sf3-font-sort action-icon" onClick={this.toggleSortOptionsDialog}></span>}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/metadata/hooks/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export const MetadataProvider = ({ repoID, hideMetadataView, selectMetadataView,
parentNode: {},
key: repoID,
view_id: view._id,
view_type: view.type,
};
selectMetadataView(node);
setShowFirstView(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { CommonlyUsedHotkey, getValidGroupbys } from '../../_basic';
import { gettext } from '../../utils';
import { useMetadata } from '../../hooks';
import TableMain from './table-main';
import Gallery from './gallery';
import { Utils } from '../../../../utils/utils';

import './index.css';
import Gallery from './gallery';

const Container = () => {
const [isLoadingMore, setLoadingMore] = useState(false);
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/pages/lib-content-view/lib-content-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const propTypes = {
filePermission: PropTypes.string,
content: PropTypes.string,
viewId: PropTypes.string,
viewType: PropTypes.string,
lastModified: PropTypes.string,
latestContributor: PropTypes.string,
onLinkClick: PropTypes.func.isRequired,
Expand Down Expand Up @@ -222,7 +221,6 @@ class LibContentContainer extends React.Component {
onFileTagChanged={this.props.onToolbarFileTagChanged}
repoTags={this.props.repoTags}
viewId={this.props.viewId}
viewType={this.props.viewType}
onItemMove={this.props.onItemMove}
/>
<ToolbarForSelectedDirents
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/pages/lib-content-view/lib-content-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class LibContentView extends React.Component {
asyncOperationProgress: 0,
asyncOperatedFilesLength: 0,
viewId: '0000',
viewType: 'table',
};

this.oldonpopstate = window.onpopstate;
Expand Down Expand Up @@ -512,7 +511,7 @@ class LibContentView extends React.Component {
window.history.pushState({ url: url, path: filePath }, filePath, url);
};

showFileMetadata = (filePath, viewId, viewType) => {
showFileMetadata = (filePath, viewId) => {
const repoID = this.props.repoID;
const repoInfo = this.state.currentRepoInfo;

Expand All @@ -523,7 +522,6 @@ class LibContentView extends React.Component {
isFileLoadedErr: false,
content: '__sf-metadata',
viewId: viewId,
viewType: viewType,
isDirentDetailShow: false
});

Expand Down Expand Up @@ -1834,7 +1832,7 @@ class LibContentView extends React.Component {
}
} else if (Utils.isFileMetadata(node?.object?.type)) {
if (node.path !== this.state.path) {
this.showFileMetadata(node.path, node.view_id || '0000', node.view_type || 'table');
this.showFileMetadata(node.path, node.view_id || '0000');
}
} else {
let url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
Expand Down Expand Up @@ -2207,7 +2205,6 @@ class LibContentView extends React.Component {
filePermission={this.state.filePermission}
content={this.state.content}
viewId={this.state.viewId}
viewType={this.state.viewType}
lastModified={this.state.lastModified}
latestContributor={this.state.latestContributor}
onLinkClick={this.onLinkClick}
Expand Down

0 comments on commit 3b6b22e

Please sign in to comment.