Skip to content

Commit 5498f0c

Browse files
committed
remove jquery libs, adjust widgster, remove jquery from core components
1 parent b99acab commit 5498f0c

File tree

16 files changed

+288
-136
lines changed

16 files changed

+288
-136
lines changed

package.json

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "4.5.0",
44
"private": true,
55
"scripts": {
6-
"install": "napa",
76
"serve": "vue-cli-service serve",
87
"build": "vue-cli-service build",
98
"lint": "vue-cli-service lint",
@@ -15,35 +14,21 @@
1514
"bootstrap": "^4.1.1",
1615
"bootstrap-vue": "^2.0.0-rc.11",
1716
"css-loader": "^1.0.0",
18-
"d3": "3.5.17",
19-
"easy-pie-chart": "^2.1.7",
2017
"expose-loader": "^0.7.5",
21-
"express": "^4.16.4",
22-
"flot": "^0.8.0-alpha",
2318
"font-awesome": "4.7.0",
2419
"glyphicons-halflings": "1.9.1",
25-
"govpredict-morris": "0.5.1",
2620
"imports-loader": "^0.8.0",
27-
"jquery": "^3.3.1",
28-
"jquery-sparkline": "2.4.0",
29-
"jquery-ui": "^1.12.1",
3021
"line-awesome": "icons8/line-awesome",
31-
"messenger": "git+https://github.com/HubSpot/messenger.git#v1.4.2",
32-
"napa": "^3.0.0",
3322
"node-sass": "^4.9.0",
34-
"nvd3": "1.8.6",
3523
"rickshaw": "1.6.6",
3624
"sass-loader": "^7.0.1",
37-
"vee-validate": "^2.1.0-beta.6",
3825
"vue": "^2.5.17",
3926
"vue-router": "^3.0.1",
4027
"vue-touch": "2.0.0-beta.4",
4128
"vue2-google-maps": "^0.10.2",
4229
"vuetrend": "^0.3.2",
4330
"vuex": "^3.0.1",
44-
"webpack-cli": "^3.1.2",
45-
"webpack-raphael": "^2.1.4",
46-
"widgster": "^1.0.0"
31+
"webpack-cli": "^3.1.2"
4732
},
4833
"devDependencies": {
4934
"@vue/cli-plugin-babel": "^3.0.5",
@@ -52,11 +37,6 @@
5237
"vue-template-compiler": "^2.5.17",
5338
"core-js": "^2.6.5"
5439
},
55-
"napa": {
56-
"jquery.flot.animator": "https://github.com/Codicode/flotanimator.git#3c256c0183d713fd3bf41d04417873928eb1a751",
57-
"flot.dashes": "https://github.com/cquartier/flot.dashes.git",
58-
"jquery.flot-orderBars": "https://github.com/emmerich/flot-orderBars.git"
59-
},
6040
"eslintConfig": {
6141
"root": true,
6242
"env": {

src/components/Chat/Chat.scss

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55
overflow: hidden;
66
top: 0;
77
bottom: 0;
8-
right: -250px;
9-
width: 250px;
8+
right: -$chat-sidebar-width-open;
9+
width: $chat-sidebar-width-open;
1010
background-color: $chat-sidebar-bg-color;
1111
color: #aaa;
1212
transition: right 0.3s ease-in-out;
1313

14-
@include media-breakpoint-down(md) {
15-
right: -275px;
16-
width: 275px;
17-
}
18-
1914
&.chatOpen {
2015
right: 0;
2116
}

src/components/Chat/Chat.vue

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
<h5 class="navTitle">TODAY</h5>
1212
<b-list-group id="chat-sidebar-user-group" class="chatSidebarUserGroup">
1313
<b-list-group-item
14-
v-for="conversation in todayConversations.filter(filterConversations)"
15-
@click="(e) => openMessages(conversation, e)"
14+
v-for="(conversation, index) in todayConversations.filter(filterConversations)"
15+
@click="(e) => openMessages(conversation, index)"
1616
:key="conversation.name"
17+
:class="{active: index === 0 && chatNotificationMessageState === messageStates.NEW}"
1718
>
1819
<i :class="`fa fa-circle float-right text-${conversation.status}`" />
20+
<span v-if="index === 0 && chatNotificationMessageState === messageStates.NEW" class="badge badge-danger badge-pill float-right animated bounceInDown">3</span>
1921
<span class="thumb-sm float-left mr">
2022
<img class="rounded-circle" :src="conversation.image" alt="..." />
2123
</span>
@@ -29,7 +31,7 @@
2931
<b-list-group id="chat-sidebar-user-group" class="chatSidebarUserGroup">
3032
<b-list-group-item
3133
v-for="conversation in lastWeekConversations.filter(filterConversations)"
32-
@click="(e) => openMessages(conversation, e)"
34+
@click="(e) => openMessages(conversation)"
3335
:key="conversation.name"
3436
>
3537
<i :class="`fa fa-circle float-right text-${conversation.status}`" />
@@ -75,20 +77,21 @@
7577

7678
<script>
7779
import Vue from 'vue';
78-
import { mapState } from 'vuex';
79-
import $ from 'jquery';
80+
import { mapState, mapActions } from 'vuex';
8081
8182
import a1 from '../../assets/people/a1.jpg';
8283
import a2 from '../../assets/people/a2.jpg';
8384
import a3 from '../../assets/people/a3.jpg';
8485
import a4 from '../../assets/people/a4.jpg';
8586
import a5 from '../../assets/people/a5.jpg';
8687
import a6 from '../../assets/people/a6.jpg';
88+
import { MessageStates } from '../../store/layout';
8789
8890
export default {
8991
name: 'Chat',
9092
data() {
9193
return {
94+
messageStates: MessageStates,
9295
todayConversations: [{
9396
name: 'Chris Gray',
9497
status: 'success',
@@ -156,6 +159,7 @@ export default {
156159
};
157160
},
158161
methods: {
162+
...mapActions('layout', ['readMessage']),
159163
filterConversations(item) {
160164
const isFindName = item.name.toLowerCase()
161165
.indexOf(this.searchValue.toLowerCase()) !== -1;
@@ -166,11 +170,13 @@ export default {
166170
handleSearchInput(value) {
167171
Vue.set(this, 'searchValue', value);
168172
},
169-
openMessages(conversation, e) {
173+
openMessages(conversation, index) {
170174
Vue.set(this, 'conversation', conversation);
171175
Vue.set(this, 'chatMessageOpened', false);
172176
173-
$(e.currentTarget).removeClass('active').find('.badge').remove();
177+
if (index === 0) {
178+
this.readMessage();
179+
}
174180
},
175181
addMessage(e) {
176182
if (e.key === 'Enter' && e.target.value) {
@@ -191,9 +197,7 @@ export default {
191197
},
192198
},
193199
computed: {
194-
...mapState('layout', {
195-
chatOpen: state => state.chatOpen,
196-
}),
200+
...mapState('layout', ['chatOpen', 'chatNotificationMessageState']),
197201
},
198202
};
199203
</script>

src/components/Header/Header.scss

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
}
1515
}
1616

17-
.navbarForm {
17+
.navbar-form {
1818
padding: 6px 0 6px 1rem;
1919
margin-left: 10px;
2020
display: inline-block;
2121
top: 2px;
2222
width: auto;
2323

24-
.inputAddon {
24+
.input-addon {
2525
position: relative;
2626
display: inline;
2727
border: none;
@@ -42,7 +42,7 @@
4242
width: 30px;
4343
}
4444

45-
.chatNotification {
45+
.chat-notification {
4646
position: absolute;
4747
right: 2px;
4848
width: 300px;
@@ -51,6 +51,13 @@
5151
margin-top: 3px;
5252
padding: 5px 0;
5353
cursor: pointer;
54+
opacity: 1;
55+
transition: $transition-base;
56+
57+
&.notification-hidden {
58+
opacity: 0;
59+
pointer-events: none;
60+
}
5461

5562
&::before {
5663
content: ' ';
@@ -64,7 +71,7 @@
6471
border-bottom: 5px solid #343434;
6572
}
6673

67-
.chatNotificationInner {
74+
.chat-notification-inner {
6875
min-width: 120px;
6976
padding: 8px;
7077
font-size: 12px;
@@ -92,7 +99,7 @@
9299
}
93100
}
94101

95-
.navbarBrand {
102+
.navbar-brand {
96103
position: absolute;
97104
left: 0;
98105
right: 0;
@@ -110,20 +117,20 @@
110117
}
111118
}
112119

113-
.notificationsMenu {
120+
.notifications-menu {
114121
.dropdown-menu {
115122
left: auto !important;
116123
right: 0 !important;
117124
top: $navbar-height !important;
118125
}
119126
}
120127

121-
.settingsDropdown {
128+
.settings-dropdown {
122129
.dropdown-item:focus {
123130
outline: none;
124131
}
125132
}
126133

127-
.notificationsWrapper {
134+
.notifications-wrapper {
128135
width: min-content;
129136
}

src/components/Header/Header.vue

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</b-form-group>
3939
</b-form>
4040
</b-nav>
41-
<a class="navbarBrand d-md-none">
41+
<a class="navbar-brand d-md-none">
4242
<i class="fa fa-circle text-gray mr-n-sm" />
4343
<i class="fa fa-circle text-warning" />
4444
&nbsp;
@@ -50,8 +50,8 @@
5050
<b-nav class="ml-auto">
5151
<b-nav-item-dropdown
5252
id="basic-nav-dropdown"
53-
class="notificationsMenu d-sm-down-none mr-2"
54-
extra-menu-classes="notificationsWrapper py-0 animated animated-fast fadeInUp"
53+
class="notifications-menu d-sm-down-none mr-2"
54+
extra-menu-classes="notifications-wrapper py-0 animated animated-fast fadeInUp"
5555
right>
5656
<template slot="button-content">
5757
<span class="avatar thumb-sm float-left mr-2">
@@ -62,7 +62,7 @@
6262
</template>
6363
<Notifications />
6464
</b-nav-item-dropdown>
65-
<b-nav-item-dropdown class="settingsDropdown d-sm-down-none" no-caret right>
65+
<b-nav-item-dropdown class="settings-dropdown d-sm-down-none" no-caret right>
6666
<template slot="button-content">
6767
<i class="la la-cog px-2" />
6868
</template>
@@ -81,8 +81,9 @@
8181
<a class="d-sm-down-none px-2" id="toggle-chat" href="#" @click="toggleChat">
8282
<i class="la la-globe" />
8383
</a>
84-
<div id="chat-notification" class="chatNotification hide">
85-
<div class="chatNotificationInner">
84+
<i v-if="chatNotificationIcon" class="chat-notification-sing animated bounceIn"></i>
85+
<div id="chat-notification" class="chat-notification" :class="{'notification-hidden': !chatNotificationPopover}">
86+
<div class="chat-notification-inner">
8687
<h6 class="title d-flex text-white">
8788
<span class="thumb-xs">
8889
<img src="../../assets/people/a6.jpg" alt=""
@@ -108,20 +109,16 @@
108109

109110
<script>
110111
import { mapState, mapActions } from 'vuex';
111-
import $ from 'jquery';
112112
import Notifications from '@/components/Notifications/Notifications';
113113
114114
export default {
115-
name: 'Headed',
115+
name: 'Header',
116116
components: { Notifications },
117117
computed: {
118-
...mapState('layout', {
119-
sidebarClose: state => state.sidebarClose,
120-
sidebarStatic: state => state.sidebarStatic,
121-
}),
118+
...mapState('layout', ['sidebarClose', 'sidebarStatic', 'chatNotificationIcon', 'chatNotificationPopover']),
122119
},
123120
methods: {
124-
...mapActions('layout', ['toggleSidebar', 'toggleChat', 'switchSidebar', 'changeSidebarActive']),
121+
...mapActions('layout', ['toggleSidebar', 'toggleChat', 'switchSidebar', 'changeSidebarActive', 'initApp']),
125122
switchSidebarMethod() {
126123
if (!this.sidebarClose) {
127124
this.switchSidebar(true);
@@ -151,22 +148,7 @@ export default {
151148
},
152149
created() {
153150
if (window.innerWidth > 576) {
154-
setTimeout(() => {
155-
const $chatNotification = $('#chat-notification');
156-
$chatNotification.removeClass('hide').addClass('animated fadeIn')
157-
.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', () => {
158-
$chatNotification.removeClass('animated fadeIn');
159-
setTimeout(() => {
160-
$chatNotification.addClass('animated fadeOut')
161-
.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd'
162-
+ ' oanimationend animationend', () => {
163-
$chatNotification.addClass('hide');
164-
});
165-
}, 6000);
166-
});
167-
$chatNotification.siblings('#toggle-chat')
168-
.append('<i class="chat-notification-sing animated bounceIn"></i>');
169-
}, 4000);
151+
this.initApp();
170152
}
171153
},
172154
};

src/components/Layout/Layout.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
transition: left $sidebar-transition-time ease-in-out;
88

99
&.chatOpen {
10-
left: -($sidebar-width-open + $sidebar-width-closed);
10+
left: -($chat-sidebar-width-open);
1111
}
1212
}
1313

src/components/Layout/Layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="wrap">
66
<Header />
77
<Chat />
8-
<v-touch class="content" @swipeleft="handleSwipe" @swiperight="handleSwipe" :swipe-options="{direction: 'horizontal', threshold: 100}">
8+
<v-touch class="content" @swipe="handleSwipe" :swipe-options="{direction: 'horizontal'}">
99
<router-view />
1010
<footer class="contentFooter">
1111
Sing Vue Version - Made by <a href="https://flatlogic.com" rel="nofollow noopener noreferrer" target="_blank">Flatlogic</a>

src/components/Loader/Loader.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@import "../../styles/app";
2+
3+
.data-loader {
4+
width: 100%;
5+
height: 100%;
6+
display: flex;
7+
align-items: center;
8+
justify-content: center;
9+
10+
i {
11+
font-size: 21px;
12+
margin: 0 $spacer;
13+
}
14+
}

src/components/Loader/Loader.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<div class="data-loader">
3+
<i class="la la-spinner la-spin" v-bind:style="{fontSize: size + 'px'}"></i>
4+
</div>
5+
</template>
6+
<script>
7+
8+
export default {
9+
name: 'Loader',
10+
props: {
11+
size: {type: Number, default: 21}
12+
}
13+
}
14+
</script>
15+
16+
<style src="./Loader.scss" lang="scss"/>

src/components/Sidebar/NavLink/NavLink.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
> a,
2424
> div a {
25+
align-items: center;
2526
position: relative;
2627
padding-left: 50px;
2728
line-height: 35px;
@@ -69,7 +70,6 @@
6970

7071
.headerLabel {
7172
font-weight: 600;
72-
color: theme-color('warning');
7373
}
7474

7575
.caretWrapper {

0 commit comments

Comments
 (0)