Skip to content

Commit d4e999f

Browse files
committed
refactor(import) : refactor import task and others
- update elixir and uikit npm packages - fix phpunit config - refactor export/import to their own controllers - refactor import tasks to use interface repository pattern and a vue component along with uikit upload library - refactor icons to uikit icons instead of custom icon library - refactor caching mechanism - better route model binding along with strict types in controller methods
1 parent f66140b commit d4e999f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+737
-5352
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ phpunit.xml.dist export-ignore
1313
*.css linguist-vendored
1414
*.js linguist-vendored
1515

16+
public/js/**/*.js -diff
17+
public/js/**/*.js.map -diff
18+
public/css/**/*.css -diff
19+
public/css/**/*.css.map -diff
20+

gulpfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ elixir(mix => {
2020
.copy('resources/assets/img', 'public/img')
2121
.copy('resources/assets/less/img', 'public/img')
2222
.copy('public', '../../../public/vendor/totem');
23-
// .copy('public', '../app/public/vendor/horizon');
2423
});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"es6-promise": "^4.0.5",
1010
"gulp": "^3.9.1",
1111
"laravel-elixir": "^6.0.0-14",
12-
"laravel-elixir-vue-2": "^0.2.0",
12+
"laravel-elixir-vue-2": "^0.3.0",
1313
"laravel-elixir-webpack-official": "^1.0.2",
1414
"lodash": "^4.16.2",
1515
"moment": "^2.10.6",
1616
"phpunserialize": "1.*",
17-
"uikit": "^3.0.0-beta.30",
17+
"uikit": "^3.0.0-rc.11",
1818
"vue": "^2.2.0",
1919
"xml-loader": "1.1.0"
2020
}

phpunit.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
convertNoticesToExceptions="true"
88
convertWarningsToExceptions="true"
99
processIsolation="false"
10-
stopOnFailure="false"
11-
syntaxCheck="false"
12-
>
10+
stopOnFailure="false">
1311
<testsuites>
1412
<testsuite name="Laravel Totem Test Suite">
1513
<directory suffix="Test.php">./tests/</directory>

public/css/app.css

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/css/app.css.map

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/js/app.js

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

public/js/tasks/create.js

Lines changed: 0 additions & 76 deletions
This file was deleted.

resources/assets/js/app.js

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,58 @@
1-
import './bootstrap'
2-
import Vue from 'vue'
3-
import moment from 'moment'
4-
import Icon from './components/Icon.vue';
5-
import UIKitAlert from './components/UiKitAlert.vue'
6-
import TaskType from './tasks/components/TaskType.vue'
7-
import TaskOutput from './tasks/components/TaskOutput.vue'
8-
import StatusButton from './tasks/components/StatusButton.vue'
9-
import ExecuteButton from './tasks/components/ExecuteButton.vue'
1+
import './bootstrap';
2+
import Vue from 'vue';
3+
import moment from 'moment';
4+
import UIkit from 'uikit';
5+
import Icons from 'uikit/dist/js/uikit-icons';
6+
import UIKitAlert from './components/UiKitAlert.vue';
7+
import TaskType from './tasks/components/TaskType.vue';
8+
import TaskOutput from './tasks/components/TaskOutput.vue';
9+
import StatusButton from './tasks/components/StatusButton.vue';
10+
import ExecuteButton from './tasks/components/ExecuteButton.vue';
11+
import ImportButton from './tasks/components/ImportButton'
1012

1113
Promise.delay = function (time) {
12-
return new Promise((resolve, reject) => {
13-
setTimeout(resolve, time)
14-
})
15-
}
14+
return new Promise((resolve, reject) => {
15+
setTimeout(resolve, time)
16+
})
17+
};
1618

1719
Promise.prototype.takeAtLeast = function (time) {
18-
return new Promise((resolve, reject) => {
19-
Promise.all([this, Promise.delay(time)]).then(([result]) => {
20-
resolve(result)
21-
}, reject)
22-
})
23-
}
20+
return new Promise((resolve, reject) => {
21+
Promise.all([this, Promise.delay(time)]).then(([result]) => {
22+
resolve(result)
23+
}, reject)
24+
})
25+
};
2426

2527
Vue.mixin({
26-
methods: {
27-
/**
28-
* Format the given date with respect to timezone.
29-
*/
30-
formatDate(unixTime){
31-
return moment(unixTime * 1000).add(new Date().getTimezoneOffset() / 60)
32-
},
28+
methods: {
29+
/**
30+
* Format the given date with respect to timezone.
31+
*/
32+
formatDate(unixTime){
33+
return moment(unixTime * 1000).add(new Date().getTimezoneOffset() / 60)
34+
},
3335

34-
/**
35-
* Convert to human readable timestamp.
36-
*/
37-
readableTimestamp(timestamp){
38-
return this.formatDate(timestamp).format('HH:mm:ss')
39-
}
36+
/**
37+
* Convert to human readable timestamp.
38+
*/
39+
readableTimestamp(timestamp){
40+
return this.formatDate(timestamp).format('HH:mm:ss')
4041
}
41-
})
42+
}
43+
});
4244

4345
new Vue({
44-
el: '#root',
45-
components: {
46-
'icon' : Icon,
47-
'uikit-alert' : UIKitAlert,
48-
'status-button': StatusButton,
49-
'execute-button': ExecuteButton,
50-
'task-type' : TaskType,
51-
'task-output' : TaskOutput
52-
}
53-
})
46+
el: '#root',
47+
components: {
48+
'uikit-alert' : UIKitAlert,
49+
'status-button': StatusButton,
50+
'execute-button': ExecuteButton,
51+
'import-button': ImportButton,
52+
'task-type' : TaskType,
53+
'task-output' : TaskOutput
54+
},
55+
mounted() {
56+
UIkit.use(Icons);
57+
}
58+
});

resources/assets/js/components/Icon.vue

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)