Skip to content

Commit

Permalink
Fix department group no repo style (#7035)
Browse files Browse the repository at this point in the history
* fix department group no repo

* Revert "add new repo in my-libraries-view and group-view"

This reverts commit b75d772.
  • Loading branch information
Michael18811380328 authored Nov 13, 2024
1 parent 9d313a8 commit 3824a89
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 105 deletions.
37 changes: 15 additions & 22 deletions frontend/src/pages/groups/group-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import LeaveGroupDialog from '../../components/dialog/leave-group-dialog';
import SharedRepoListView from '../../components/shared-repo-list-view/shared-repo-list-view';
import SortOptionsDialog from '../../components/dialog/sort-options';
import SingleDropdownToolbar from '../../components/toolbar/single-dropdown-toolbar';
import NewLibrary from '../my-libs/new-library';

import '../../css/group-view.css';

Expand Down Expand Up @@ -145,8 +144,7 @@ class GroupView extends React.Component {
return (
<EmptyTip
title={gettext('No libraries')}
text={gettext('You can create libraries by clicking the "New Library" button above.')}
className="m-0 pt-0 pb-8"
text={gettext('You can create libraries by clicking the "New Library" button in the menu bar.')}
/>
);
}
Expand Down Expand Up @@ -389,7 +387,7 @@ class GroupView extends React.Component {
};

render() {
const { errMessage, emptyTip, currentGroup, isDepartmentGroup, isMembersDialogOpen, isStaff } = this.state;
const { errMessage, emptyTip, currentGroup, isDepartmentGroup, isMembersDialogOpen } = this.state;

let useRate = 0;
if (isDepartmentGroup && currentGroup.group_quota) {
Expand Down Expand Up @@ -443,24 +441,19 @@ class GroupView extends React.Component {
{(!this.state.isLoading && errMessage) && <div className="error text-center mt-2">{errMessage}</div>}
{(!this.state.isLoading && this.state.repoList.length === 0) && emptyTip}
{(!this.state.isLoading && this.state.repoList.length > 0) &&
<>
<SharedRepoListView
repoList={this.state.repoList}
hasNextPage={this.state.hasNextPage}
currentGroup={this.state.currentGroup}
sortBy={this.state.sortBy}
sortOrder={this.state.sortOrder}
sortItems={this.sortItems}
onItemUnshare={this.onItemUnshare}
onItemDelete={this.onItemDelete}
onItemRename={this.onItemRename}
onMonitorRepo={this.onMonitorRepo}
onTransferRepo={this.onItemTransfer}
/>
{((!isDepartmentGroup && canAddRepo) || (isDepartmentGroup && isStaff)) &&
<NewLibrary onClick={this.onCreateRepoToggle} />
}
</>
<SharedRepoListView
repoList={this.state.repoList}
hasNextPage={this.state.hasNextPage}
currentGroup={this.state.currentGroup}
sortBy={this.state.sortBy}
sortOrder={this.state.sortOrder}
sortItems={this.sortItems}
onItemUnshare={this.onItemUnshare}
onItemDelete={this.onItemDelete}
onItemRename={this.onItemRename}
onMonitorRepo={this.onMonitorRepo}
onTransferRepo={this.onItemTransfer}
/>
}
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/my-libs/my-libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class MyLibraries extends Component {
onTransferRepo={this.onTransferRepo}
onMonitorRepo={this.onMonitorRepo}
sortRepoList={this.sortRepoList}
toggleCreateRepoDialog={this.toggleCreateRepoDialog}
/>
}
</div>
Expand Down
52 changes: 16 additions & 36 deletions frontend/src/pages/my-libs/mylib-repo-list-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { LIST_MODE } from '../../components/dir-view-mode/constants';
import ContextMenu from '../../components/context-menu/context-menu';
import { Utils } from '../../utils/utils';
import { hideMenu, handleContextClick } from '../../components/context-menu/actions';
import NewLibrary from './new-library';

const propTypes = {
sortBy: PropTypes.string.isRequired,
Expand Down Expand Up @@ -117,41 +116,22 @@ class MylibRepoListView extends React.Component {
const sortIcon = this.props.sortOrder === 'asc' ? <span className="sf3-font sf3-font-down rotate-180 d-inline-block"></span> : <span className="sf3-font sf3-font-down"></span>;

return currentViewMode == LIST_MODE ? (
<>
<table className={inAllLibs ? 'table-thead-hidden' : ''}>
<thead>
<tr>
<th width="4%"></th>
<th width="3%">
<span className="sr-only">{gettext('Library Type')}</span>
</th>
<th width={showStorageBackend ? '36%' : '35%'}>
<a className="d-block table-sort-op" href="#" onClick={this.sortByName}>
{gettext('Name')} {this.props.sortBy === 'name' && sortIcon}
</a>
</th>
<th width="10%">
<span className="sr-only">{gettext('Actions')}</span>
</th>
<th width={showStorageBackend ? '15%' : '14%'}>
<a className="d-block table-sort-op" href="#" onClick={this.sortBySize}>
{gettext('Size')} {this.props.sortBy === 'size' && sortIcon}
</a>
</th>
{showStorageBackend ? <th width="17%">{gettext('Storage Backend')}</th> : null}
<th width={showStorageBackend ? '15%' : '34%'}>
<a className="d-block table-sort-op" href="#" onClick={this.sortByTime}>
{gettext('Last Update')} {this.props.sortBy === 'time' && sortIcon}
</a>
</th>
</tr>
</thead>
<tbody>
{this.renderRepoListView()}
</tbody>
</table>
{!inAllLibs && <NewLibrary onClick={this.props.toggleCreateRepoDialog} />}
</>
<table className={inAllLibs ? 'table-thead-hidden' : ''}>
<thead>
<tr>
<th width="4%"></th>
<th width="3%"><span className="sr-only">{gettext('Library Type')}</span></th>
<th width={showStorageBackend ? '36%' : '35%'}><a className="d-block table-sort-op" href="#" onClick={this.sortByName}>{gettext('Name')} {this.props.sortBy === 'name' && sortIcon}</a></th>
<th width="10%"><span className="sr-only">{gettext('Actions')}</span></th>
<th width={showStorageBackend ? '15%' : '14%'}><a className="d-block table-sort-op" href="#" onClick={this.sortBySize}>{gettext('Size')} {this.props.sortBy === 'size' && sortIcon}</a></th>
{showStorageBackend ? <th width="17%">{gettext('Storage Backend')}</th> : null}
<th width={showStorageBackend ? '15%' : '34%'}><a className="d-block table-sort-op" href="#" onClick={this.sortByTime}>{gettext('Last Update')} {this.props.sortBy === 'time' && sortIcon}</a></th>
</tr>
</thead>
<tbody>
{this.renderRepoListView()}
</tbody>
</table>
) : (
<div className="d-flex justify-content-between flex-wrap">
{this.renderRepoListView()}
Expand Down
31 changes: 0 additions & 31 deletions frontend/src/pages/my-libs/new-library.css

This file was deleted.

15 changes: 0 additions & 15 deletions frontend/src/pages/my-libs/new-library.js

This file was deleted.

0 comments on commit 3824a89

Please sign in to comment.