Skip to content

Commit 8a1b688

Browse files
authored
Merge pull request #113 from socialblue/develop
release new sql code highlighting
2 parents efd4978 + 4f3be3a commit 8a1b688

File tree

16 files changed

+137
-63
lines changed

16 files changed

+137
-63
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ Publish Laravel-Query-Adviser
2222
php artisan vendor:publish --provider="Socialblue\LaravelQueryAdviser\LaravelQueryAdviserServiceProvider"
2323
```
2424

25+
** publish the front-end application after updating **
26+
```bash
27+
php artisan vendor:publish --tag=public --force
28+
```
29+
30+
2531
**When updating from `0.13.2` to `0.14.0` please use**
2632

2733
```bash

package-lock.json

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

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
"watch": "mix watch"
88
},
99
"devDependencies": {
10-
"bulma": "^0.7.5",
10+
"bulma": "^0.9.4",
1111
"bulma-extensions": "^6.2.7",
1212
"cross-env": "^5.2.1",
13-
"highlight.js": "^11.6.0",
1413
"laravel-mix": "^6.0.49",
1514
"node-sass": "^7.0.3",
1615
"postcss": "^8.4.16",
1716
"resolve-url-loader": "^4.0.0",
1817
"sass": "^1.54.9",
1918
"sass-loader": "^12.6.0",
2019
"sql-formatter": "^10.6.0",
20+
"sql-highlight": "^4.2.1",
2121
"v-clipboard": "^2.2.3",
2222
"vue": "^2.7.10",
23-
"vue-json-pretty": "^1.9.2",
2423
"vue-loader": "^15.10.0",
2524
"vue-router": "^3.6.5",
2625
"vue-template-compiler": "^2.7.10"
27-
}
26+
},
27+
"dependencies": {}
2828
}

public/css/app.css

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/mix-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"/js/app.js": "/js/app.js?id=1b85ca16b9b43cd073884e9e5d4692a4",
3-
"/css/app.css": "/css/app.css?id=2d7161bbcbcf464e7be644297f4184f9"
2+
"/js/app.js": "/js/app.js?id=812eb08c08eea5cf829d679ca810bca8",
3+
"/css/app.css": "/css/app.css?id=b1e5df534d3e9de7ba4cdaa2a4ebeba4"
44
}

resources/assets/js/components/query-block.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</div>
4646
</template>
4747
</div>
48-
<pre class="highlight" ref="sqlcode" ><code class="language-sql">{{prettyPrint(query.sql)}}</code></pre>
48+
<sqlHighlight :sql="query.sql" />
4949
<time :datetime="dateTime">{{ dateTime }}</time>
5050

5151
</div>
@@ -72,10 +72,13 @@
7272
</template>
7373

7474
<script>
75-
import highlight from "../mixin/hightlight";
75+
import sqlHighlight from "./sql-highlight";
76+
import { format } from 'sql-formatter';
7677
7778
export default {
78-
mixins: [highlight],
79+
components: {
80+
sqlHighlight
81+
},
7982
8083
props: {
8184
query: {
@@ -115,6 +118,13 @@ export default {
115118
116119
clipboardSuccess() {
117120
window.EventBus.$emit('show-notification', {message: 'Query is copied to your clipboard'});
121+
},
122+
123+
format(sql) {
124+
return format(`${sql};`, {
125+
language: 'mysql',
126+
keywordCase: "upper",
127+
});
118128
}
119129
},
120130

resources/assets/js/components/query-execute.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@
4242
</template>
4343

4444
<script>
45-
import highlight from "../mixin/hightlight";
46-
4745
export default {
48-
mixins: [highlight],
4946
5047
data() {
5148
return {

resources/assets/js/components/session-import.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export default {
3737
method,
3838
body,
3939
headers
40-
}).then(() => this.hide());
40+
}).then(() => {
41+
this.$router.push({name: 'sessions'});
42+
});
4143
},
4244
4345
hide() {

resources/assets/js/components/session.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
7979
methods: {
8080
openSession() {
81-
this.$router.push('session', {id: this.id});
81+
this.$router.push({name: 'session', params: {id: this.id}});
8282
}
8383
}
8484
}

0 commit comments

Comments
 (0)