Add cover for folder namve

This commit is contained in:
Bogdan Lyashenko
2018-10-28 11:16:18 +01:00
parent 055d97075d
commit 2f28609cd5
4 changed files with 27 additions and 7 deletions

View File

@@ -194303,6 +194303,8 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var utils_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! utils/constants */ "./js/utils/constants.js");
/* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./index.scss */ "./js/components/treeDiagram/component/Node/index.scss");
/* harmony import */ var _index_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_index_scss__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _store_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../store/constants */ "./js/components/treeDiagram/store/constants.js");
@@ -194310,7 +194312,7 @@ __webpack_require__.r(__webpack_exports__);
var FolderName = function FolderName(props) {
var position = props.position,
name = props.name,
dependency = props.dependency,
cover = props.cover,
disabled = props.disabled,
openedState = props.openedState,
onIconClick = props.onIconClick,
@@ -194321,14 +194323,21 @@ var FolderName = function FolderName(props) {
var iconSize = closed ? 14 : 15;
var iconPositionX = position.x + 3;
var iconPositionY = position.y + (closed ? -16 : -17);
var nameWidth = name.length * _store_constants__WEBPACK_IMPORTED_MODULE_4__["SYMBOL_WIDTH"];
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("g", {
className: 'FolderNode'
}, dependency ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("rect", {
}, cover ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("rect", {
x: position.x + 2,
y: position.y - 16,
width: 16,
height: 15,
className: 'NodeText-cover'
}) : null, cover ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("rect", {
x: position.x + 20,
y: position.y - 16,
width: nameWidth,
height: 15,
className: 'NodeText-cover'
}) : null, closed ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("polyline", {
points: [iconPositionX - 1, iconPositionY + 17, iconPositionX + 16, iconPositionY + 17].join(', '),
strokeDasharray: "2",
@@ -194989,7 +194998,7 @@ function (_React$Component) {
key: path,
position: position,
name: name,
dependency: dependenciesDiagramOn,
cover: dependenciesDiagramOn || codeCrumbsDiagramOn,
disabled: sourceDimFolders,
openedState: openedFolders[node.data.path],
onTextClick: function onTextClick() {

File diff suppressed because one or more lines are too long

View File

@@ -3,9 +3,10 @@ import classNames from 'classnames';
import { FOLDER_OPEN_STATE, ICONS_DIR } from 'utils/constants';
import './index.scss';
import { SYMBOL_WIDTH } from '../../store/constants';
export const FolderName = props => {
const { position, name, dependency, disabled, openedState, onIconClick, onTextClick } = props;
const { position, name, cover, disabled, openedState, onIconClick, onTextClick } = props;
const closed = openedState === FOLDER_OPEN_STATE.CLOSED;
const notActiveChildrenCollapsed = openedState === FOLDER_OPEN_STATE.OPEN_ACTIVE_CHILDREN_ONLY;
@@ -17,10 +18,11 @@ export const FolderName = props => {
const iconPositionX = position.x + 3;
const iconPositionY = position.y + (closed ? -16 : -17);
const nameWidth = name.length * SYMBOL_WIDTH;
return (
<g className={'FolderNode'}>
{dependency ? (
{cover ? (
<rect
x={position.x + 2}
y={position.y - 16}
@@ -29,6 +31,15 @@ export const FolderName = props => {
className={'NodeText-cover'}
/>
) : null}
{cover ? (
<rect
x={position.x + 20}
y={position.y - 16}
width={nameWidth}
height={15}
className={'NodeText-cover'}
/>
) : null}
{closed ? (
<polyline
points={[

View File

@@ -119,7 +119,7 @@ class SourceTree extends React.Component {
key={path}
position={position}
name={name}
dependency={dependenciesDiagramOn}
cover={dependenciesDiagramOn || codeCrumbsDiagramOn}
disabled={sourceDimFolders}
openedState={openedFolders[node.data.path]}
onTextClick={() => onNodeTextClick(node.data)}