Skip to content

Commit fc1e478

Browse files
authored
Merge pull request #9 from oslabs-beta/shanon
Fix multiselect imports in component tab components; FUNCTIONAL codes…
2 parents b450524 + 7d07b88 commit fc1e478

File tree

8 files changed

+73
-31
lines changed

8 files changed

+73
-31
lines changed

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"lodash.throttle": "^4.1.1",
2929
"mousetrap": "^1.6.5",
3030
"node-gyp": "^8.4.1",
31+
"prismjs": "^1.25.0",
3132
"quasar": "^2.0.0",
3233
"quasar-dotenv": "^1.0.5",
3334
"vue-draggable-resizable": "^2.3.0",

src-electron/electron-main.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,14 @@ function setOauthListener() {
131131
// logEverywhere(`process.env.SLACK_CLIENT_ID in electron-main: ${process.env.SLACK_CLIENT_ID}`);
132132
// logEverywhere(`process.env.SLACK_CLIENT_SECRET in electron-main: ${process.env.SLACK_CLIENT_SECRET}`);
133133

134-
return deeplink.on("received", link => {
135-
// logEverywhere(`auth worked here link: ${link}`);
136-
// Extracts Slack authorization code from deep link
137-
authCode = link.split("=")[1];
138-
sendTokenRequest();
139-
});
134+
if (process.env.PROD) {
135+
return deeplink.on("received", link => {
136+
// logEverywhere(`auth worked here link: ${link}`);
137+
// Extracts Slack authorization code from deep link
138+
authCode = link.split("=")[1];
139+
sendTokenRequest();
140+
});
141+
}
140142
}
141143

142144
function createWindow () {

src/components/dashboard_items/CodeSnippet.vue

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,25 @@ Description:
1414
<div v-else>{{ `${this.activeComponent}.vue` }}</div>
1515
<prism-editor
1616
v-model="code"
17-
language="js"
18-
:line-numbers="lineNumbers"
19-
class="code-editor fill"
20-
:readonly="true"
17+
:highlight="highlighter"
18+
line-numbers
19+
class="my-editor"
20+
readonly
2121
/>
2222
</div>
2323
</template>
2424

2525
<script>
2626
import { mapState } from 'vuex'
27+
2728
import { PrismEditor }from 'vue-prism-editor';
2829
import 'vue-prism-editor/dist/prismeditor.min.css';
30+
import { highlight, languages } from 'prismjs/components/prism-core';
31+
import 'prismjs/components/prism-clike';
32+
import 'prismjs/components/prism-javascript';
33+
import 'prismjs/themes/prism-tomorrow.css'; // import syntax highlighting styles
34+
35+
2936
3037
// import 'prismjs'
3138
// import 'prismjs/themes/prism-okaidia.css'
@@ -57,6 +64,9 @@ export default {
5764
}
5865
},
5966
methods: {
67+
highlighter(myCode) {
68+
return highlight(myCode, languages.js)
69+
},
6070
getWindowHeight (e) {
6171
let minHeight =
6272
window.outerHeight < 900 ? 22 : window.outerHeight < 1035 ? 24 : 27.5
@@ -281,7 +291,7 @@ export default {
281291
// },
282292
beforeDestroy () {
283293
window.removeEventListener('resize', this.getWindowHeight)
284-
}
294+
},
285295
// watch: {
286296
// activeComponent: {
287297
// handler () {
@@ -310,17 +320,33 @@ export default {
310320
}
311321
</script>
312322

313-
<style lang="scss" scoped>
323+
<style lang="scss">
324+
// Had scoped before, but could not get rid of outline with scoped style
325+
326+
314327
// resize handled by vue lifecycle methods
315-
.code-editor {
328+
.my-editor {
316329
font-size: 12px;
330+
background: #2d2d2d;
331+
color: #ccc;
332+
/* you must provide font-family font-size line-height. Example: */
333+
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
334+
line-height: 1.5;
335+
padding: 5px;
317336
}
318337
319338
.codesnippet-container {
320339
margin-bottom: 1rem;
321340
}
322341
323-
::-webkit-scrollbar {
324-
display: none;
342+
.prism-editor__textarea:focus {
343+
outline: none;
325344
}
345+
346+
</style>
347+
348+
<style lang="scss" scoped>
349+
::-webkit-scrollbar {
350+
display: none;
351+
}
326352
</style>

src/components/home_sidebar_items/ComponentTab/AddProps.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</q-input>
1717

1818
<div id="props-select">
19-
<!-- <multiselect
19+
<VueMultiselect
2020
v-model="selectProps"
2121
class="multiselect"
2222
placeholder="Select Props for Component"
@@ -30,7 +30,7 @@
3030
@search-change="stopDelete($event)"
3131
>
3232
<span slot="noResult">No props found.</span>
33-
</multiselect> -->
33+
</VueMultiselect>
3434
</div>
3535
<br/>
3636
<div>
@@ -48,12 +48,12 @@
4848

4949
<script>
5050
import { mapState, mapActions } from 'vuex'
51-
// import Multiselect from 'vue-multiselect'
51+
import VueMultiselect from 'vue-multiselect'
5252
5353
export default {
5454
name: 'addProps',
5555
components: {
56-
// Multiselect
56+
VueMultiselect
5757
},
5858
data () {
5959
return {

src/components/home_sidebar_items/ComponentTab/ComponentActions.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<template>
1010
<div>
1111
<div id="action-select">
12-
<!-- <multiselect
12+
<VueMultiselect
1313
v-model="selectAction"
1414
class="multiselect"
1515
placeholder="Select Action for Component"
@@ -23,7 +23,7 @@
2323
@search-change="stopDelete($event)"
2424
>
2525
<span slot="noResult">No actions found.</span>
26-
</multiselect> -->
26+
</VueMultiselect>
2727
<br/>
2828
<q-btn
2929
v-if="selectAction.length"
@@ -61,12 +61,12 @@
6161

6262
<script>
6363
import { mapState, mapActions } from "vuex";
64-
// import Multiselect from 'vue-multiselect';
64+
import VueMultiselect from 'vue-multiselect';
6565
6666
export default {
6767
name: "ComponentActions",
6868
components: {
69-
// Multiselect
69+
VueMultiselect
7070
},
7171
computed: {
7272
...mapState([

src/components/home_sidebar_items/ComponentTab/ComponentState.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<template>
1010
<div>
1111
<div id="state-select">
12-
<multiselect
12+
<VueMultiselect
1313
v-model="selectState"
1414
class="multiselect"
1515
placeholder="Select State for Component"
@@ -23,7 +23,7 @@
2323
@search-change="stopDelete($event)"
2424
>
2525
<span slot="noResult">No state found.</span>
26-
</multiselect>
26+
</VueMultiselect>
2727
<br/>
2828
<q-btn
2929
v-if="selectState.length"
@@ -62,11 +62,13 @@
6262
<script>
6363
import { mapState, mapActions } from "vuex";
6464
// import Multiselect from 'vue-multiselect';
65+
import VueMultiselect from 'vue-multiselect'
6566
6667
export default {
6768
name: "ComponentState",
6869
components: {
6970
// Multiselect
71+
VueMultiselect
7072
},
7173
computed: {
7274
...mapState([

src/components/home_sidebar_items/ComponentTab/EditDeleteComponents.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Description:
3333

3434
</q-input>
3535
<!-- for the icon list -->
36-
<!-- <multiselect
36+
<VueMultiselect
3737
v-model="testModel"
3838
placeholder="Add/Remove Children"
3939
:multiple="true"
@@ -43,7 +43,7 @@ Description:
4343
:max-height="90"
4444
:option-height="20"
4545
:searchable="false"
46-
/> -->
46+
/>
4747

4848

4949
<q-list
@@ -122,7 +122,7 @@ Description:
122122
indicator-color="secondary"
123123
>
124124
<q-expansion-item group="accordion" label="Select another Component">
125-
<!-- <multiselect
125+
<VueMultiselect
126126
class="multiselect"
127127
v-model="value"
128128
:options="options"
@@ -134,7 +134,7 @@ Description:
134134
placeholder="Select/Search component"
135135
>
136136
<span slot="noResult">No components found.</span>
137-
</multiselect> -->
137+
</VueMultiselect>
138138
</q-expansion-item>
139139
</q-list>
140140
</div>
@@ -143,7 +143,7 @@ Description:
143143

144144
<script>
145145
import { mapState, mapActions } from "vuex";
146-
// import Multiselect from "vue-multiselect";
146+
import VueMultiselect from "vue-multiselect";
147147
// import { ToggleButton } from "vue-js-toggle-button";
148148
import HTMLQueue from "../../dashboard_items/HTMLQueue.vue";
149149
import Icons from "../Icons.vue";
@@ -165,7 +165,7 @@ export default {
165165
};
166166
},
167167
components: {
168-
// Multiselect,
168+
VueMultiselect,
169169
// ToggleButton,
170170
HTMLQueue,
171171
Icons,

0 commit comments

Comments
 (0)