Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit de0e30d

Browse files
Fix version creation, remove obsolete download counters, dep fix (#357)
1 parent b8b942c commit de0e30d

File tree

3 files changed

+22
-30
lines changed

3 files changed

+22
-30
lines changed

pages/_type/_id.vue

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,6 @@
332332
:href="findPrimary(version).url"
333333
class="download"
334334
:title="`Download ${version.name}`"
335-
@click.prevent="
336-
downloadFile(
337-
findPrimary(version).hashes.sha1,
338-
findPrimary(version).url
339-
)
340-
"
341335
>
342336
<DownloadIcon aria-hidden="true" />
343337
</a>
@@ -419,7 +413,7 @@
419413
</div>
420414
<div class="info">
421415
<div class="key">Project ID</div>
422-
<div class="value">
416+
<div class="value lowercase">
423417
{{ project.id }}
424418
</div>
425419
</div>
@@ -679,14 +673,6 @@ export default {
679673
680674
return file
681675
},
682-
async downloadFile(hash, url) {
683-
await this.$axios.get(`version_file/${hash}/download`)
684-
685-
const elem = document.createElement('a')
686-
elem.download = hash
687-
elem.href = url
688-
elem.click()
689-
},
690676
async clearMessage() {
691677
this.$nuxt.$loading.start()
692678
@@ -987,6 +973,10 @@ export default {
987973
.value {
988974
width: 50%;
989975
text-transform: capitalize;
976+
977+
&.lowercase {
978+
text-transform: none;
979+
}
990980
}
991981
.uppercase {
992982
text-transform: uppercase;

pages/_type/_id/version.vue

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@
8686
:href="primaryFile.url"
8787
class="action iconified-button brand-button-colors"
8888
:title="`Download ${primaryFile.filename}`"
89-
@click.prevent="
90-
$parent.downloadFile(primaryFile.hashes.sha1, primaryFile.url)
91-
"
9289
>
9390
<DownloadIcon aria-hidden="true" />
9491
Download
@@ -353,6 +350,9 @@
353350
Version {{ dependency.version.version_number }} is
354351
{{ dependency.dependency_type }}
355352
</p>
353+
<p v-else>
354+
{{ dependency.dependency_type }}
355+
</p>
356356
</nuxt-link>
357357
<div class="bottom">
358358
<button
@@ -417,10 +417,10 @@
417417
Primary
418418
</div>
419419
<a
420+
:href="file.url"
420421
class="action iconified-button"
421422
:title="`Download ${file.filename}`"
422423
tabindex="0"
423-
@click.prevent="$parent.downloadFile(file.hashes.sha1, file.url)"
424424
>
425425
<DownloadIcon aria-hidden="true" />
426426
Download
@@ -822,12 +822,16 @@ export default {
822822
})
823823
).data
824824
825-
this.$emit('update:project', this.versions.concat([data]))
825+
const newProject = JSON.parse(JSON.stringify(this.project))
826+
newProject.versions = newProject.versions.concat([data])
827+
828+
await this.$emit('update:project', newProject)
829+
await this.$emit('update:versions', this.versions.concat([data]))
826830
827831
await this.$router.push(
828832
`/${this.project.project_type}/${
829-
this.project.slug ? this.project.slug : data.project_id
830-
}/version/${encodeURIComponent(data.version_number)}`
833+
this.project.slug ? this.project.slug : this.project.project_id
834+
}/version/${encodeURIComponent(this.version.version_number)}`
831835
)
832836
} catch (err) {
833837
this.$notify({
@@ -942,12 +946,16 @@ section {
942946
.dependencies {
943947
display: flex;
944948
flex-wrap: wrap;
949+
column-gap: 2rem;
950+
row-gap: 1rem;
945951
946952
.dependency {
947953
align-items: center;
948954
display: flex;
949-
flex-basis: 33.333333%;
950-
margin-bottom: 0.5rem;
955+
956+
@media screen and (min-width: 800px) {
957+
flex-basis: 30%;
958+
}
951959
952960
.icon {
953961
width: 3rem;

pages/_type/_id/versions.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
:href="$parent.findPrimary(version).url"
2525
class="download-button"
2626
:title="`Download ${version.name}`"
27-
@click.prevent="
28-
$parent.downloadFile(
29-
$parent.findPrimary(version).hashes.sha1,
30-
$parent.findPrimary(version).url
31-
)
32-
"
3327
>
3428
<DownloadIcon aria-hidden="true" />
3529
</a>

0 commit comments

Comments
 (0)