Merge branch 'develop' into dependencies
This commit is contained in:
commit
5272141615
7 changed files with 127 additions and 47 deletions
|
@ -13,7 +13,6 @@ module.exports = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
||||||
'vue/script-indent': ['error', 2, { baseIndent: 1 }],
|
'vue/script-indent': ['error', 2, { baseIndent: 1 }],
|
||||||
'max-len': 'off',
|
'max-len': 'off',
|
||||||
|
|
5
package-lock.json
generated
5
package-lock.json
generated
|
@ -13002,11 +13002,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/vue-analytics/-/vue-analytics-5.22.1.tgz",
|
"resolved": "https://registry.npmjs.org/vue-analytics/-/vue-analytics-5.22.1.tgz",
|
||||||
"integrity": "sha512-HPKQMN7gfcUqS5SxoO0VxqLRRSPkG1H1FqglsHccz6BatBatNtm/Vyy8brApktZxNCfnAkrSVDpxg3/FNDeOgQ=="
|
"integrity": "sha512-HPKQMN7gfcUqS5SxoO0VxqLRRSPkG1H1FqglsHccz6BatBatNtm/Vyy8brApktZxNCfnAkrSVDpxg3/FNDeOgQ=="
|
||||||
},
|
},
|
||||||
"vue-async-computed": {
|
|
||||||
"version": "3.9.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/vue-async-computed/-/vue-async-computed-3.9.0.tgz",
|
|
||||||
"integrity": "sha512-ac6m/9zxHHNGGKNOU1en8qNk+fAmEbJLuWL7qyQTFuH3vjv3V4urv//QHcVzCobROM6btnaDG2b+XYMncF/ETA=="
|
|
||||||
},
|
|
||||||
"vue-cli-plugin-sitemap": {
|
"vue-cli-plugin-sitemap": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/vue-cli-plugin-sitemap/-/vue-cli-plugin-sitemap-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/vue-cli-plugin-sitemap/-/vue-cli-plugin-sitemap-2.3.0.tgz",
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
"sass": "^1.26.11",
|
"sass": "^1.26.11",
|
||||||
"vue": "^2.6.12",
|
"vue": "^2.6.12",
|
||||||
"vue-analytics": "^5.22.1",
|
"vue-analytics": "^5.22.1",
|
||||||
"vue-async-computed": "^3.9.0",
|
|
||||||
"vue-markdown": "^2.2.4",
|
"vue-markdown": "^2.2.4",
|
||||||
"vue-material-design-icons": "^4.9.0",
|
"vue-material-design-icons": "^4.9.0",
|
||||||
"vue-mq": "^1.0.1",
|
"vue-mq": "^1.0.1",
|
||||||
|
|
|
@ -7,30 +7,54 @@
|
||||||
:released="version.released"
|
:released="version.released"
|
||||||
:github="version.github"
|
:github="version.github"
|
||||||
:download="version.download" />
|
:download="version.download" />
|
||||||
<spinner class="loading" v-if="versions === null" />
|
<spinner class="loading" v-if="loading" />
|
||||||
|
<home-download-load-more-button
|
||||||
|
v-if="moreLink !== null && !loading"
|
||||||
|
@click="loadMore"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import HomeDownloadBetaItem from './HomeDownloadBetaItem.vue';
|
import HomeDownloadBetaItem from './HomeDownloadBetaItem.vue';
|
||||||
|
import HomeDownloadLoadMoreButton from './HomeDownloadLoadMoreButton.vue';
|
||||||
import Spinner from './Spinner.vue';
|
import Spinner from './Spinner.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'home-download-beta',
|
name: 'home-download-beta',
|
||||||
components: {
|
components: {
|
||||||
HomeDownloadBetaItem,
|
HomeDownloadBetaItem,
|
||||||
|
HomeDownloadLoadMoreButton,
|
||||||
Spinner,
|
Spinner,
|
||||||
},
|
},
|
||||||
asyncComputed: {
|
data: () => ({
|
||||||
async versions() {
|
versions: [],
|
||||||
const response = await this.$http.get('https://api.github.com/repos/wulkanowy/wulkanowy/releases');
|
moreLink: 'https://api.github.com/repos/wulkanowy/wulkanowy/releases',
|
||||||
return response.body.map((release) => ({
|
loading: false,
|
||||||
|
}),
|
||||||
|
async created() {
|
||||||
|
await this.loadMore();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async loadMore() {
|
||||||
|
if (this.loading || this.moreLink === null) return;
|
||||||
|
this.loading = true;
|
||||||
|
try {
|
||||||
|
const response = await this.$http.get(this.moreLink);
|
||||||
|
this.versions.push(...response.body.map((release) => ({
|
||||||
code: release.tag_name,
|
code: release.tag_name,
|
||||||
released: release.published_at,
|
released: release.published_at,
|
||||||
github: release.html_url,
|
github: release.html_url,
|
||||||
download: release.assets.length === 0 ? release.html_url : release.assets[0].browser_download_url,
|
download: release.assets.length === 0 ? release.html_url : release.assets[0].browser_download_url,
|
||||||
id: release.id,
|
id: release.id,
|
||||||
}));
|
})));
|
||||||
|
const nextLinkRegex = /<([^<>]+)>; ?rel="next"/;
|
||||||
|
const match = nextLinkRegex.exec(response.headers.get('link'));
|
||||||
|
this.moreLink = match === null ? null : match[1];
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,7 +20,11 @@
|
||||||
:user="version.user"
|
:user="version.user"
|
||||||
:build="version.build"
|
:build="version.build"
|
||||||
:commit="version.commit" />
|
:commit="version.commit" />
|
||||||
<spinner class="loading" v-if="versions === null || master === null" />
|
<spinner class="loading" v-if="loading || master === null" />
|
||||||
|
<home-download-load-more-button
|
||||||
|
v-if="moreLink !== null && !loading"
|
||||||
|
@click="loadMore"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -28,6 +32,7 @@
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import HomeDownloadDevItem from './HomeDownloadDevItem.vue';
|
import HomeDownloadDevItem from './HomeDownloadDevItem.vue';
|
||||||
import HomeDownloadDevMaster from './HomeDownloadDevMaster.vue';
|
import HomeDownloadDevMaster from './HomeDownloadDevMaster.vue';
|
||||||
|
import HomeDownloadLoadMoreButton from './HomeDownloadLoadMoreButton.vue';
|
||||||
import Spinner from './Spinner.vue';
|
import Spinner from './Spinner.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -35,13 +40,26 @@
|
||||||
components: {
|
components: {
|
||||||
HomeDownloadDevItem,
|
HomeDownloadDevItem,
|
||||||
HomeDownloadDevMaster,
|
HomeDownloadDevMaster,
|
||||||
|
HomeDownloadLoadMoreButton,
|
||||||
Spinner,
|
Spinner,
|
||||||
},
|
},
|
||||||
asyncComputed: {
|
data: () => ({
|
||||||
async master() {
|
master: null,
|
||||||
|
versions: [],
|
||||||
|
moreLink: 'https://api.github.com/repos/wulkanowy/wulkanowy/pulls?state=open',
|
||||||
|
loading: false,
|
||||||
|
}),
|
||||||
|
async created() {
|
||||||
|
await Promise.all([
|
||||||
|
this.loadMaster(),
|
||||||
|
this.loadMore(),
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async loadMaster() {
|
||||||
const redirectorUrl = 'https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/develop/artifacts/0/info';
|
const redirectorUrl = 'https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/develop/artifacts/0/info';
|
||||||
const build = await this.$http.get(redirectorUrl);
|
const build = await this.$http.get(redirectorUrl);
|
||||||
return {
|
this.master = {
|
||||||
released: build.body.finished_at,
|
released: build.body.finished_at,
|
||||||
download: build.body.public_install_page_url,
|
download: build.body.public_install_page_url,
|
||||||
build: build.body.build_number,
|
build: build.body.build_number,
|
||||||
|
@ -49,9 +67,13 @@
|
||||||
commitUrl: build.body.commit_view_url,
|
commitUrl: build.body.commit_view_url,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async versions() {
|
async loadMore() {
|
||||||
const response = await this.$http.get('https://api.github.com/repos/wulkanowy/wulkanowy/pulls?state=open');
|
if (this.loading || this.moreLink === null) return;
|
||||||
return (await Promise.all(response.body.map(async (release) => {
|
this.loading = true;
|
||||||
|
try {
|
||||||
|
const response = await this.$http.get(this.moreLink);
|
||||||
|
this.versions.push(
|
||||||
|
...(await Promise.all(response.body.map(async (release) => {
|
||||||
const redirectorUrl = `https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/${release.head.ref}/artifacts/0/info`;
|
const redirectorUrl = `https://bitrise-redirector.herokuapp.com/v0.1/apps/daeff1893f3c8128/builds/${release.head.ref}/artifacts/0/info`;
|
||||||
const build = await this.$http.get(redirectorUrl).catch((error) => error);
|
const build = await this.$http.get(redirectorUrl).catch((error) => error);
|
||||||
return {
|
return {
|
||||||
|
@ -71,7 +93,15 @@
|
||||||
if (moment(a.released).isBefore(b.released)) return 1;
|
if (moment(a.released).isBefore(b.released)) return 1;
|
||||||
if (moment(a.released).isAfter(b.released)) return -1;
|
if (moment(a.released).isAfter(b.released)) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
});
|
}),
|
||||||
|
);
|
||||||
|
const nextLinkRegex = /<([^<>]+)>; ?rel="next"/;
|
||||||
|
const match = nextLinkRegex.exec(response.headers.get('link'));
|
||||||
|
this.moreLink = match === null ? null : match[1];
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
35
src/components/HomeDownloadLoadMoreButton.vue
Normal file
35
src/components/HomeDownloadLoadMoreButton.vue
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<template>
|
||||||
|
<button
|
||||||
|
class="home-download-load-more-button"
|
||||||
|
@click="$emit('click', $event)"
|
||||||
|
>
|
||||||
|
Wczytaj więcej
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'home-download-load-more-button',
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.home-download-load-more-button {
|
||||||
|
width: 100%;
|
||||||
|
border: 1px solid;
|
||||||
|
color: #D32F2F;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 48px;
|
||||||
|
font-size: 20px;
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-top: 24px;
|
||||||
|
transition: background-color 300ms;
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: transparent;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #D32F2F33;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,5 +1,4 @@
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import AsyncComputed from 'vue-async-computed';
|
|
||||||
import VueResource from 'vue-resource';
|
import VueResource from 'vue-resource';
|
||||||
import VueMq from 'vue-mq';
|
import VueMq from 'vue-mq';
|
||||||
import VueAnalytics from 'vue-analytics';
|
import VueAnalytics from 'vue-analytics';
|
||||||
|
@ -7,7 +6,6 @@ import VueAnalytics from 'vue-analytics';
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
import router from './router';
|
import router from './router';
|
||||||
|
|
||||||
Vue.use(AsyncComputed);
|
|
||||||
Vue.use(VueResource);
|
Vue.use(VueResource);
|
||||||
Vue.use(VueMq, {
|
Vue.use(VueMq, {
|
||||||
breakpoints: {
|
breakpoints: {
|
||||||
|
|
Loading…
Reference in a new issue