diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-12-09 10:50:20 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-12-09 14:28:10 +0100 |
commit | 25a0ec7276939bb217f422bedbc8708cb7044131 (patch) | |
tree | 421cab6eeea41bc2ea73a2fac0e1e9a3576b564a | |
parent | 73d214a4d36f23016f6dd1b8dd014343c502aa62 (diff) | |
download | sonarqube-25a0ec7276939bb217f422bedbc8708cb7044131.tar.gz sonarqube-25a0ec7276939bb217f422bedbc8708cb7044131.zip |
remove _ dependecy in RecentHistory
-rw-r--r-- | server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js b/server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js index 6454cfe8afb..e7dc3f06f09 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js +++ b/server/sonar-web/src/main/js/app/components/nav/component/RecentHistory.js @@ -17,8 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import _ from 'underscore'; - const STORAGE_KEY = 'sonar_recent_history'; const HISTORY_LIMIT = 10; @@ -51,16 +49,16 @@ export default class RecentHistory { if (componentKey) { const newEntry = { key: componentKey, name: componentName, icon }; - let newHistory = _.reject(sonarHistory, entry => entry.key === newEntry.key); + let newHistory = sonarHistory.filter(entry => entry.key !== newEntry.key); newHistory.unshift(newEntry); - newHistory = _.first(newHistory, HISTORY_LIMIT); + newHistory = newHistory.slice(0, HISTORY_LIMIT); RecentHistory.set(newHistory); } } static remove (componentKey) { const history = RecentHistory.get(); - const newHistory = _.reject(history, entry => entry.key === componentKey); + const newHistory = history.filter(entry => entry.key !== componentKey); RecentHistory.set(newHistory); } } |