From 5465aef099beb98f0112ef45344c523b58f06e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Tue, 1 Sep 2020 10:09:04 +0200 Subject: [PATCH] Merge pull request #3126 from overleaf/msm-outline-react-style Update file outline to follow React code style guidelines GitOrigin-RevId: 8b32e27d20378cbf573d24feb799eb6f99746402 --- .../outline/components/outline-item.js} | 2 +- .../outline/components/outline-list.js} | 2 +- .../outline/components/outline-pane.js} | 2 +- .../outline/components/outline-root.js} | 2 +- .../outline/controllers/outline-controller.js} | 2 +- .../outline/outline-manager.js} | 8 ++------ .../outline/outline-parser.js} | 0 services/web/frontend/js/ide.js | 2 +- 8 files changed, 8 insertions(+), 12 deletions(-) rename services/web/frontend/js/{ide/outline/components/OutlineItem.js => features/outline/components/outline-item.js} (98%) rename services/web/frontend/js/{ide/outline/components/OutlineList.js => features/outline/components/outline-list.js} (95%) rename services/web/frontend/js/{ide/outline/components/OutlinePane.js => features/outline/components/outline-pane.js} (98%) rename services/web/frontend/js/{ide/outline/components/OutlineRoot.js => features/outline/components/outline-root.js} (95%) rename services/web/frontend/js/{ide/outline/controllers/OutlineController.js => features/outline/controllers/outline-controller.js} (94%) rename services/web/frontend/js/{ide/outline/OutlineManager.js => features/outline/outline-manager.js} (93%) rename services/web/frontend/js/{ide/outline/OutlineParser.js => features/outline/outline-parser.js} (100%) diff --git a/services/web/frontend/js/ide/outline/components/OutlineItem.js b/services/web/frontend/js/features/outline/components/outline-item.js similarity index 98% rename from services/web/frontend/js/ide/outline/components/OutlineItem.js rename to services/web/frontend/js/features/outline/components/outline-item.js index 33823bee3e..fb775b33c9 100644 --- a/services/web/frontend/js/ide/outline/components/OutlineItem.js +++ b/services/web/frontend/js/features/outline/components/outline-item.js @@ -2,7 +2,7 @@ import React, { useState, useEffect, createRef, useRef } from 'react' import PropTypes from 'prop-types' import scrollIntoViewIfNeeded from 'scroll-into-view-if-needed' import classNames from 'classnames' -import OutlineList from './OutlineList' +import OutlineList from './outline-list' function getChildrenLines(children) { return (children || []) diff --git a/services/web/frontend/js/ide/outline/components/OutlineList.js b/services/web/frontend/js/features/outline/components/outline-list.js similarity index 95% rename from services/web/frontend/js/ide/outline/components/OutlineList.js rename to services/web/frontend/js/features/outline/components/outline-list.js index 30e0bd3044..f6f5efa9b0 100644 --- a/services/web/frontend/js/ide/outline/components/OutlineList.js +++ b/services/web/frontend/js/features/outline/components/outline-list.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import classNames from 'classnames' -import OutlineItem from './OutlineItem' +import OutlineItem from './outline-item' function OutlineList({ outline, jumpToLine, isRoot, highlightedLine }) { const listClasses = classNames('outline-item-list', { diff --git a/services/web/frontend/js/ide/outline/components/OutlinePane.js b/services/web/frontend/js/features/outline/components/outline-pane.js similarity index 98% rename from services/web/frontend/js/ide/outline/components/OutlinePane.js rename to services/web/frontend/js/features/outline/components/outline-pane.js index e4750ab1e2..17baaca032 100644 --- a/services/web/frontend/js/ide/outline/components/OutlinePane.js +++ b/services/web/frontend/js/features/outline/components/outline-pane.js @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react' import PropTypes from 'prop-types' import { OverlayTrigger, Tooltip } from 'react-bootstrap' import classNames from 'classnames' -import OutlineRoot from './OutlineRoot' +import OutlineRoot from './outline-root' import localStorage from '../../../modules/localStorage' function OutlinePane({ diff --git a/services/web/frontend/js/ide/outline/components/OutlineRoot.js b/services/web/frontend/js/features/outline/components/outline-root.js similarity index 95% rename from services/web/frontend/js/ide/outline/components/OutlineRoot.js rename to services/web/frontend/js/features/outline/components/outline-root.js index c83337e861..44b3a10ca8 100644 --- a/services/web/frontend/js/ide/outline/components/OutlineRoot.js +++ b/services/web/frontend/js/features/outline/components/outline-root.js @@ -1,6 +1,6 @@ import React from 'react' import PropTypes from 'prop-types' -import OutlineList from './OutlineList' +import OutlineList from './outline-list' function OutlineRoot({ outline, jumpToLine, highlightedLine }) { return ( diff --git a/services/web/frontend/js/ide/outline/controllers/OutlineController.js b/services/web/frontend/js/features/outline/controllers/outline-controller.js similarity index 94% rename from services/web/frontend/js/ide/outline/controllers/OutlineController.js rename to services/web/frontend/js/features/outline/controllers/outline-controller.js index 31b482f700..e1836e1187 100644 --- a/services/web/frontend/js/ide/outline/controllers/OutlineController.js +++ b/services/web/frontend/js/features/outline/controllers/outline-controller.js @@ -1,5 +1,5 @@ import App from '../../../base' -import OutlinePane from '../components/OutlinePane' +import OutlinePane from '../components/outline-pane' import { react2angular } from 'react2angular' App.controller('OutlineController', function($scope, ide, eventTracking) { diff --git a/services/web/frontend/js/ide/outline/OutlineManager.js b/services/web/frontend/js/features/outline/outline-manager.js similarity index 93% rename from services/web/frontend/js/ide/outline/OutlineManager.js rename to services/web/frontend/js/features/outline/outline-manager.js index 9b67ae0a7e..8db064a943 100644 --- a/services/web/frontend/js/ide/outline/OutlineManager.js +++ b/services/web/frontend/js/features/outline/outline-manager.js @@ -1,9 +1,5 @@ -import './controllers/OutlineController' -import './components/OutlinePane' -import './components/OutlineRoot' -import './components/OutlineList' -import './components/OutlineItem' -import { matchOutline, nestOutline } from './OutlineParser' +import './controllers/outline-controller' +import { matchOutline, nestOutline } from './outline-parser' import isValidTeXFile from '../../main/is-valid-tex-file' class OutlineManager { diff --git a/services/web/frontend/js/ide/outline/OutlineParser.js b/services/web/frontend/js/features/outline/outline-parser.js similarity index 100% rename from services/web/frontend/js/ide/outline/OutlineParser.js rename to services/web/frontend/js/features/outline/outline-parser.js diff --git a/services/web/frontend/js/ide.js b/services/web/frontend/js/ide.js index ef03ee5b59..ed78027d98 100644 --- a/services/web/frontend/js/ide.js +++ b/services/web/frontend/js/ide.js @@ -29,7 +29,7 @@ import BinaryFilesManager from './ide/binary-files/BinaryFilesManager' import ReferencesManager from './ide/references/ReferencesManager' import MetadataManager from './ide/metadata/MetadataManager' import ReviewPanelManager from './ide/review-panel/ReviewPanelManager' -import OutlineManager from './ide/outline/OutlineManager' +import OutlineManager from './features/outline/outline-manager' import SafariScrollPatcher from './ide/SafariScrollPatcher' import './ide/cobranding/CobrandingDataService' import './ide/settings/index'