diff --git a/client/modules/IDE/components/FileNode.jsx b/client/modules/IDE/components/FileNode.jsx
index 57238cf8..e7869f26 100644
--- a/client/modules/IDE/components/FileNode.jsx
+++ b/client/modules/IDE/components/FileNode.jsx
@@ -10,6 +10,61 @@ import FolderRightIcon from '../../../images/triangle-arrow-right.svg';
import FolderDownIcon from '../../../images/triangle-arrow-down.svg';
import FileIcon from '../../../images/file.svg';
+function parseFileName(name) {
+ const nameArray = name.split('.');
+ if (nameArray.length > 1) {
+ const extension = `.${nameArray[nameArray.length - 1]}`;
+ const baseName = nameArray.slice(0, -1).join('');
+ const firstLetter = baseName[0];
+ const lastLetter = baseName[baseName.length - 1];
+ const middleText = baseName.slice(1, -1);
+ return {
+ baseName,
+ firstLetter,
+ lastLetter,
+ middleText,
+ extension
+ };
+ }
+ const firstLetter = name[0];
+ const lastLetter = name[name.length - 1];
+ const middleText = name.slice(1, -1);
+ return {
+ baseName: name,
+ firstLetter,
+ lastLetter,
+ middleText
+ };
+}
+
+function FileName({ name }) {
+ const {
+ baseName,
+ firstLetter,
+ lastLetter,
+ middleText,
+ extension
+ } = parseFileName(name);
+ return (
+
+ {firstLetter}
+ {baseName.length > 2 &&
+ {middleText}
+ }
+ {baseName.length > 1 &&
+ {lastLetter}
+ }
+ {extension &&
+ {extension}
+ }
+
+ );
+}
+
+FileName.propTypes = {
+ name: PropTypes.string.isRequired
+};
+
export class FileNode extends React.Component {
constructor(props) {
super(props);
@@ -206,11 +261,12 @@ export class FileNode extends React.Component {
}
', () => {
};
const expectFileNameToBe = async (expectedName) => {
- const name = screen.getByLabelText(/Name/i);
+ const name = screen.getByTestId('file-name');
await waitFor(() => within(name).queryByText(expectedName));
};
diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx
index 04cbad77..252006b3 100644
--- a/client/modules/IDE/pages/IDEView.jsx
+++ b/client/modules/IDE/pages/IDEView.jsx
@@ -254,7 +254,7 @@ class IDEView extends React.Component {
onChange={size => this.setState({ sidebarSize: size })}
onDragFinished={this._handleSidebarPaneOnDragFinished}
allowResize={this.props.ide.sidebarIsExpanded}
- minSize={20}
+ minSize={125}
>