1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

[department] added an option to control if libraries can be shared in… (#4778)

* [department] added an option to control if libraries can be shared into a department

* update seahub web api

Co-authored-by: lian <lian@seafile.com>
This commit is contained in:
llj
2021-01-13 14:11:35 +08:00
committed by GitHub
parent ae9874c84f
commit 2db2c08032
8 changed files with 40 additions and 14 deletions

View File

@@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Button } from 'reactstrap';
import Select from 'react-select';
import { gettext, isPro } from '../../utils/constants';
import { gettext, isPro, enableShareToDepartment } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api.js';
import { Utils } from '../../utils/utils';
import toaster from '../toast';
@@ -135,6 +135,12 @@ class ShareToGroup extends React.Component {
seafileAPI.shareableGroups().then((res) => {
let options = [];
for (let i = 0 ; i < res.data.length; i++) {
const item = res.data[i];
if (item.parent_group_id != 0) { // it's a department
if (!enableShareToDepartment) {
continue;
}
}
let obj = {};
obj.value = res.data[i].name;
obj.id = res.data[i].id;