Skip to content

Commit 058d858

Browse files
committed
v1.5 updates
Delete issue functionality Added links at footer
1 parent a7092c5 commit 058d858

File tree

11 files changed

+58335
-38
lines changed

11 files changed

+58335
-38
lines changed

assets/css/app.css

Lines changed: 12552 additions & 3 deletions
Large diffs are not rendered by default.

assets/js/app.js

Lines changed: 45580 additions & 1 deletion
Large diffs are not rendered by default.

assets/plugins/@mdi/font/package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
{
2-
"_from": "@mdi/font@^4.9.95",
2+
"_args": [
3+
[
4+
"@mdi/font@4.9.95",
5+
"D:\\xampp-7.3.10\\htdocs\\projects\\laravel-packages\\bugphix\\bugphix-laravel"
6+
]
7+
],
8+
"_from": "@mdi/font@4.9.95",
39
"_id": "@mdi/font@4.9.95",
410
"_inBundle": false,
511
"_integrity": "sha512-m2sbAs+SMwRnWpkMriBxEulwuhmqRyh6X+hdOZlqSxYZUM2C2TaDnQ4gcilzdoAgru2XYnWViZ/xPuSDGgRXVw==",
612
"_location": "/@mdi/font",
713
"_phantomChildren": {},
814
"_requested": {
9-
"type": "range",
15+
"type": "version",
1016
"registry": true,
11-
"raw": "@mdi/font@^4.9.95",
17+
"raw": "@mdi/font@4.9.95",
1218
"name": "@mdi/font",
1319
"escapedName": "@mdi%2ffont",
1420
"scope": "@mdi",
15-
"rawSpec": "^4.9.95",
21+
"rawSpec": "4.9.95",
1622
"saveSpec": null,
17-
"fetchSpec": "^4.9.95"
23+
"fetchSpec": "4.9.95"
1824
},
1925
"_requiredBy": [
20-
"#USER",
2126
"/"
2227
],
2328
"_resolved": "https://registry.npmjs.org/@mdi/font/-/font-4.9.95.tgz",
24-
"_shasum": "00ed2ffe289c9230f146e74559c07542d3f4475a",
25-
"_spec": "@mdi/font@^4.9.95",
26-
"_where": "D:\\xampp-7.3.10\\htdocs\\projects\\laravel-packages\\jheckcode\\bugphix-laravel",
29+
"_spec": "4.9.95",
30+
"_where": "D:\\xampp-7.3.10\\htdocs\\projects\\laravel-packages\\bugphix\\bugphix-laravel",
2731
"author": {
2832
"name": "Austin Andrews",
2933
"url": "http://twitter.com/templarian"
3034
},
3135
"bugs": {
3236
"url": "https://github.com/Templarian/MaterialDesign/issues"
3337
},
34-
"bundleDependencies": false,
35-
"deprecated": false,
3638
"description": "Dist for Material Design Webfont. This includes the Stock and Community icons in a single webfont collection.",
3739
"homepage": "https://materialdesignicons.com",
3840
"keywords": [

src/Bugphix.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,22 @@ class Bugphix
1414
{
1515
use BugphixProcess, BugphixHelpers;
1616

17+
public function version()
18+
{
19+
return 'v1.5';
20+
}
21+
1722
public function asset($asset = '')
1823
{
1924
return trim(url(config('bugphix.assets.url')) . "{$asset}", '/');
2025
}
2126

2227
public function isAssetsExists()
2328
{
24-
try{
25-
$fileHeaders=get_headers($this->asset('/js/app.js'));
26-
return stripos($fileHeaders[0],"200 OK") ? true : false;
27-
} catch(\Exception $e){
29+
try {
30+
$fileHeaders = get_headers($this->asset('/js/app.js'));
31+
return stripos($fileHeaders[0], "200 OK") ? true : false;
32+
} catch (\Exception $e) {
2833
return false;
2934
}
3035
}

src/Http/Controllers/IssuesController.php

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,18 @@ public function update(Request $req, $id)
136136
*/
137137
public function destroy($id)
138138
{
139-
//
139+
$success = false;
140+
$message = 'Cannot delete issue';
141+
142+
$delete = Issue::where('id', $id)->delete();
143+
if ($delete) {
144+
$success = true;
145+
$message = 'Issue deleted!';
146+
}
147+
return response()->json([
148+
'success' => $success,
149+
'message' => $message,
150+
]);
140151
}
141152

142153
public function bulkUpdate(Request $req, $id)
@@ -154,10 +165,29 @@ public function bulkUpdate(Request $req, $id)
154165

155166
$item->update($post);
156167
$success = true;
157-
$message = 'Issues updated!';
168+
$message = count($ids) .' Issues updated!';
158169
}
159170
}
160171

172+
return response()->json([
173+
'success' => $success,
174+
'message' => $message,
175+
]);
176+
}
177+
178+
public function bulkDelete($id)
179+
{
180+
$ids = explode(',', $id);
181+
$success = false;
182+
$message = 'Deleting issue failed';
183+
184+
if (count($ids)) {
185+
$delete = Issue::whereIn('id', $ids)->delete();
186+
if ($delete) {
187+
$success = true;
188+
$message = count($ids) .' Issues deleted!';
189+
}
190+
}
161191

162192
return response()->json([
163193
'success' => $success,

src/Resources/js/components/App.vue

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,38 @@
6767
router-view
6868

6969
.footer
70-
.content.has-text-centered
71-
p
72-
a(
73-
href="https://github.com/bugphix/bugphix-laravel"
74-
target="_blank"
75-
) Bugphix
76-
span.copyright © 2020. All rights reserved –
77-
a(
78-
href="https://github.com/jericizon"
79-
target="_blank"
80-
) Jeric
81-
70+
.content
71+
.columns
72+
.column
73+
p
74+
a(
75+
href="https://github.com/bugphix/bugphix-laravel/issues"
76+
target="_blank"
77+
) Report issue
78+
79+
span   |  
80+
81+
a(
82+
href="https://bugphix-docs.netlify.com"
83+
target="_blank"
84+
) Docs
85+
86+
span   |  
87+
88+
a(
89+
href="https://github.com/bugphix/bugphix-laravel"
90+
target="_blank"
91+
) Bugphix
92+
93+
span(v-html="version")
94+
95+
.column
96+
p.copyright
97+
span © 2020 - Present. All rights reserved – 
98+
a(
99+
href="https://github.com/jericizon"
100+
target="_blank"
101+
) Jeric
82102
.notification-groups
83103
notifications(position="bottom right")
84104

@@ -94,6 +114,7 @@ export default {
94114
return {
95115
toggleMenu: false,
96116
logoutUrl: '',
117+
version: '',
97118
menuLinks: {
98119
'issues': 'Issues',
99120
'projects': 'Projects',
@@ -108,6 +129,7 @@ export default {
108129
mounted(){
109130
this.setActivePage(this.$route.name);
110131
this.logoutUrl = window.Bugphix.logout_url
132+
this.checkVersion();
111133
},
112134
methods: {
113135
...mapMutations([
@@ -121,6 +143,23 @@ export default {
121143
this.setActiveProject(projectId);
122144
window.location.reload();
123145
},
146+
checkVersion(){
147+
this.version = '' + window.Bugphix.app_version || '1.0';
148+
fetch('https://api.github.com/repos/bugphix/bugphix-laravel/releases')
149+
.then((response) => {
150+
return response.json();
151+
})
152+
.then((data) => {
153+
if(typeof data[0] !== 'undefined'){
154+
const latestVersion = data[0];
155+
const { name, html_url } = latestVersion;
156+
157+
if(this.version !== '' && this.version !== name){
158+
this.version = ` – <a href="${html_url}" target="_blank"><strong>New version available! (${name})</strong></a>`;
159+
}
160+
}
161+
});
162+
},
124163
},
125164
computed: {
126165
...mapState([
@@ -138,7 +177,7 @@ export default {
138177
bugphixLogo(){
139178
const {assets_url} = window.Bugphix;
140179
return `${assets_url}/images/logo.png`
141-
}
180+
},
142181
},
143182
watch: {
144183
$route(to, from) {
@@ -190,8 +229,8 @@ export default {
190229
.footer{
191230
padding: 20px;
192231
193-
span.copyright {
194-
margin: 0 5px;
232+
.copyright {
233+
text-align: right;
195234
}
196235
}
197236
}

src/Resources/js/components/Pages/Issues/IssueItem.vue

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
button.button(
1111
:class="{'is-loading' : buttonIsLoading}"
1212
@click="updateStatus('unresolved')"
13+
title="Unresolve issue"
1314
)
1415
span.icon
1516
i.mdi.mdi-alert-outline
@@ -20,6 +21,7 @@
2021
:class="{'is-loading' : buttonIsLoading}"
2122
:disabled="buttonIsLoading"
2223
@click="updateStatus('resolved')"
24+
title="Resolve issue"
2325
)
2426
span.icon
2527
i.mdi.mdi-check
@@ -29,11 +31,22 @@
2931
:class="{'is-loading' : buttonIsLoading}"
3032
:disabled="buttonIsLoading"
3133
@click="updateStatus('ignored')"
34+
title="Ignore issue"
3235
)
3336
span.icon
3437
i.mdi.mdi-close
3538
span Ignore issue
3639

40+
button.button.is-danger(
41+
:class="{'is-loading' : buttonIsLoading}"
42+
:disabled="buttonIsLoading"
43+
@click="deleteIssue()"
44+
title="Delete issue permanently"
45+
)
46+
span.icon
47+
i.mdi.mdi-delete
48+
span Delete
49+
3750
h2.title.is-4 {{issueItem.issue_error_exception}}
3851

3952
a.issue-url-request(
@@ -142,6 +155,9 @@ export default {
142155
}
143156
},
144157
methods: {
158+
...mapMutations([
159+
'setIsPageLoading',
160+
]),
145161
...mapActions([
146162
'setActiveProject',
147163
]),
@@ -152,6 +168,32 @@ export default {
152168
'setIssueItem',
153169
'setEventItem',
154170
]),
171+
deleteIssue(){
172+
this.buttonIsLoading=true;
173+
IssueApi.delete(this.issueItem.id)
174+
.then((response) => {
175+
if(response.data.success){
176+
this.$notify({
177+
text: response.data.message,
178+
});
179+
this.setIsPageLoading(true);
180+
setTimeout(()=>{
181+
this.setIsPageLoading(false);
182+
this.$router.push({ name: "issues"});
183+
}, 1000);
184+
}
185+
})
186+
.catch((error) => {
187+
this.$notify({
188+
type: 'error',
189+
text: 'Oops, something went wrong. Try again later.',
190+
});
191+
})
192+
.then(()=>{
193+
// commit('setIsPageLoading', false, {root:true})
194+
this.buttonIsLoading=false;
195+
})
196+
},
155197
updateStatus(status='resolve'){
156198
this.buttonIsLoading=true;
157199
const formData = {

src/Resources/js/components/Pages/Issues/Issues.vue

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@
3434
i.mdi.mdi-close
3535
span Ignore {{ selected.length }} issues
3636

37+
button.button.is-danger(
38+
:class="{'is-loading' : buttonIsLoading}"
39+
:disabled="buttonIsLoading"
40+
@click="deleteIssue()"
41+
title="Delete issue permanently"
42+
)
43+
span.icon
44+
i.mdi.mdi-delete
45+
span Delete {{ selected.length }} issues
46+
3747
.dropdown.is-right(
3848
:class="{'is-active' : openStatusFilter}"
3949
@click="openStatusFilter = !openStatusFilter"
@@ -168,7 +178,31 @@ export default {
168178
.then((response) => {
169179
if(response.data.success){
170180
this.$notify({
171-
text: 'Issues updated',
181+
text: response.data.message || 'Issues updated!',
182+
});
183+
this.setIssueList(1);
184+
}
185+
})
186+
.catch((error) => {
187+
this.$notify({
188+
type: 'error',
189+
text: 'Oops, something went wrong. Try again later.',
190+
});
191+
})
192+
.then(()=>{
193+
this.selected = [];
194+
})
195+
},
196+
deleteIssue(){
197+
198+
if(this.selected.length === 0) return;
199+
200+
const ids = this.selected.join(',');
201+
IssueApi.bulkDelete(ids)
202+
.then((response) => {
203+
if(response.data.success){
204+
this.$notify({
205+
text: response.data.message || 'Issues deleted!',
172206
});
173207
this.setIssueList(1);
174208
}

0 commit comments

Comments
 (0)