From a7c279fab5d51c8866ea997f0e181bd89418ad60 Mon Sep 17 00:00:00 2001 From: Linda Date: Wed, 22 Aug 2018 15:05:21 -0400 Subject: [PATCH 1/3] cut of studio name on studio adding dialog using css and not using the library for that anymore, also displays full title as a title of the div --- src/components/modal/addtostudio/modal.scss | 5 ++++- src/components/modal/addtostudio/studio-button.jsx | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/modal/addtostudio/modal.scss b/src/components/modal/addtostudio/modal.scss index 08b4c1abc..38267fe90 100644 --- a/src/components/modal/addtostudio/modal.scss +++ b/src/components/modal/addtostudio/modal.scss @@ -112,11 +112,14 @@ */ margin: .575rem 2.18375rem .175rem .6875rem; width: 13.3125rem; - height: 1rem; /* diff from spec, in case we ever do valign to middle */ + height: 1.25rem; /* diff from spec, in case we ever do valign to middle; changed to match line-height because else with overflow hidden it cuts off some letters */ line-height: 1.25rem; font-family: "Helvetica Neue"; font-size: .875rem; font-weight: regular; + overflow: hidden; + text-overflow:ellipsis; + white-space: nowrap; } .studio-selector-button-selected { diff --git a/src/components/modal/addtostudio/studio-button.jsx b/src/components/modal/addtostudio/studio-button.jsx index 137c4cc8a..45e0ebf99 100644 --- a/src/components/modal/addtostudio/studio-button.jsx +++ b/src/components/modal/addtostudio/studio-button.jsx @@ -44,8 +44,9 @@ const StudioButton = ({ {'studio-selector-button-text-selected': includesProject || hasRequestOutstanding}, {'studio-selector-button-text-unselected': !includesProject && !hasRequestOutstanding} )} + title={title} > - {truncateAtWordBoundary(title, 25)} + {title}
Date: Wed, 22 Aug 2018 15:10:19 -0400 Subject: [PATCH 2/3] remove now obsolete truncate library --- package.json | 1 - src/components/modal/addtostudio/studio-button.jsx | 1 - src/lib/truncate.js | 9 --------- 3 files changed, 11 deletions(-) delete mode 100644 src/lib/truncate.js diff --git a/package.json b/package.json index e8bbee511..6b1315452 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,6 @@ "lodash.merge": "3.3.2", "lodash.omit": "3.1.0", "lodash.range": "3.0.1", - "lodash.truncate": "4.4.2", "minilog": "2.0.8", "node-dir": "0.1.16", "node-sass": "4.6.1", diff --git a/src/components/modal/addtostudio/studio-button.jsx b/src/components/modal/addtostudio/studio-button.jsx index 45e0ebf99..3a19ac5de 100644 --- a/src/components/modal/addtostudio/studio-button.jsx +++ b/src/components/modal/addtostudio/studio-button.jsx @@ -1,4 +1,3 @@ -const truncateAtWordBoundary = require('../../../lib/truncate').truncateAtWordBoundary; const PropTypes = require('prop-types'); const React = require('react'); const classNames = require('classnames'); diff --git a/src/lib/truncate.js b/src/lib/truncate.js deleted file mode 100644 index 36a7477f7..000000000 --- a/src/lib/truncate.js +++ /dev/null @@ -1,9 +0,0 @@ -const lodashTruncate = require('lodash.truncate'); - -/* -* Function that applies regex for word boundaries, replaces removed string -* with indication of ellipsis (...) -*/ -module.exports.truncateAtWordBoundary = (str, length) => ( - lodashTruncate(str, {length: length, separator: /[.,:;]*\s+/}) -); From 56d9ac2af9af80a4227ea5ea49f75dc9e9d340fa Mon Sep 17 00:00:00 2001 From: Linda Date: Wed, 22 Aug 2018 16:48:07 -0400 Subject: [PATCH 3/3] resolve travis errors caused by wrong ordering of css stuff --- src/components/modal/addtostudio/modal.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/modal/addtostudio/modal.scss b/src/components/modal/addtostudio/modal.scss index 38267fe90..3719b1e57 100644 --- a/src/components/modal/addtostudio/modal.scss +++ b/src/components/modal/addtostudio/modal.scss @@ -113,13 +113,13 @@ margin: .575rem 2.18375rem .175rem .6875rem; width: 13.3125rem; height: 1.25rem; /* diff from spec, in case we ever do valign to middle; changed to match line-height because else with overflow hidden it cuts off some letters */ + overflow: hidden; + text-overflow: ellipsis; line-height: 1.25rem; + white-space: nowrap; font-family: "Helvetica Neue"; font-size: .875rem; font-weight: regular; - overflow: hidden; - text-overflow:ellipsis; - white-space: nowrap; } .studio-selector-button-selected {