From ab027ad243e6c7cbf96060ef3c38eae76f8bb1e2 Mon Sep 17 00:00:00 2001 From: mithereal Date: Tue, 14 Sep 2021 20:56:35 +0000 Subject: [PATCH] add support for web-ide and global ranking --- assets/js/components/NavBar.jsx | 23 +++ assets/js/components/Options.jsx | 82 ++++++++- assets/js/components/WakaTime.jsx | 118 ++++++++++++- assets/js/config.js | 14 +- assets/js/helpers/changeExtensionState.js | 4 + src/components/Alert.test.tsx | 26 +-- src/components/Alert.tsx | 11 +- src/components/MainList.test.tsx | 56 +++---- src/components/MainList.tsx | 153 ++++++++--------- src/config/config.test.ts | 6 +- src/config/config.ts | 192 +++++++++++----------- src/core/WakaTimeCore.ts | 60 +++---- src/html/WakatimeDevPanel.html | 20 +-- src/html/options.html | 22 +-- src/html/popup.html | 22 +-- src/manifests/chrome.json | 5 +- src/manifests/firefox.json | 5 +- src/popup.tsx | 15 +- src/reducers/currentUser.ts | 41 ++--- src/stores/createStore.ts | 48 +++--- src/types/heartbeats.ts | 42 ++--- src/types/summaries.ts | 62 +++---- src/types/user.ts | 74 ++++----- src/utils/changeExtensionIcon.ts | 36 ++-- src/utils/changeExtensionState.ts | 50 +++--- src/utils/changeExtensionTooltip.ts | 14 +- src/utils/checkCurrentUser.ts | 24 +-- src/utils/contains.ts | 24 +-- src/utils/getDomainFromUrl.ts | 4 +- src/utils/inArray.ts | 10 +- 30 files changed, 750 insertions(+), 513 deletions(-) diff --git a/assets/js/components/NavBar.jsx b/assets/js/components/NavBar.jsx index 790a1733..0c0b1cd0 100644 --- a/assets/js/components/NavBar.jsx +++ b/assets/js/components/NavBar.jsx @@ -41,6 +41,27 @@ var NavBar = reactCreateClass({ } }; +var project_name = function () { + + if(that.props.show_project_editor === false ){ + return ( +

Project: {that.props.projectName}

+ ); + }else{ + return ( +

Project:

+ ); + } + }; + + var ranking = function () { + + if (config.rankingDisplayType == 'global' && that.props.global_rank) { + return (

Global Ranking: {that.props.global_rank} / 5000

); + } + + }; + return (