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

Commit

Permalink
Fix version creation, remove obsolete download counters, dep fix (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically authored Feb 25, 2022
1 parent b8b942c commit de0e30d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 30 deletions.
20 changes: 5 additions & 15 deletions pages/_type/_id.vue
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,6 @@
:href="findPrimary(version).url"
class="download"
:title="`Download ${version.name}`"
@click.prevent="
downloadFile(
findPrimary(version).hashes.sha1,
findPrimary(version).url
)
"
>
<DownloadIcon aria-hidden="true" />
</a>
Expand Down Expand Up @@ -419,7 +413,7 @@
</div>
<div class="info">
<div class="key">Project ID</div>
<div class="value">
<div class="value lowercase">
{{ project.id }}
</div>
</div>
Expand Down Expand Up @@ -679,14 +673,6 @@ export default {
return file
},
async downloadFile(hash, url) {
await this.$axios.get(`version_file/${hash}/download`)
const elem = document.createElement('a')
elem.download = hash
elem.href = url
elem.click()
},
async clearMessage() {
this.$nuxt.$loading.start()
Expand Down Expand Up @@ -987,6 +973,10 @@ export default {
.value {
width: 50%;
text-transform: capitalize;
&.lowercase {
text-transform: none;
}
}
.uppercase {
text-transform: uppercase;
Expand Down
26 changes: 17 additions & 9 deletions pages/_type/_id/version.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@
:href="primaryFile.url"
class="action iconified-button brand-button-colors"
:title="`Download ${primaryFile.filename}`"
@click.prevent="
$parent.downloadFile(primaryFile.hashes.sha1, primaryFile.url)
"
>
<DownloadIcon aria-hidden="true" />
Download
Expand Down Expand Up @@ -353,6 +350,9 @@
Version {{ dependency.version.version_number }} is
{{ dependency.dependency_type }}
</p>
<p v-else>
{{ dependency.dependency_type }}
</p>
</nuxt-link>
<div class="bottom">
<button
Expand Down Expand Up @@ -417,10 +417,10 @@
Primary
</div>
<a
:href="file.url"
class="action iconified-button"
:title="`Download ${file.filename}`"
tabindex="0"
@click.prevent="$parent.downloadFile(file.hashes.sha1, file.url)"
>
<DownloadIcon aria-hidden="true" />
Download
Expand Down Expand Up @@ -822,12 +822,16 @@ export default {
})
).data
this.$emit('update:project', this.versions.concat([data]))
const newProject = JSON.parse(JSON.stringify(this.project))
newProject.versions = newProject.versions.concat([data])
await this.$emit('update:project', newProject)
await this.$emit('update:versions', this.versions.concat([data]))
await this.$router.push(
`/${this.project.project_type}/${
this.project.slug ? this.project.slug : data.project_id
}/version/${encodeURIComponent(data.version_number)}`
this.project.slug ? this.project.slug : this.project.project_id
}/version/${encodeURIComponent(this.version.version_number)}`
)
} catch (err) {
this.$notify({
Expand Down Expand Up @@ -942,12 +946,16 @@ section {
.dependencies {
display: flex;
flex-wrap: wrap;
column-gap: 2rem;
row-gap: 1rem;
.dependency {
align-items: center;
display: flex;
flex-basis: 33.333333%;
margin-bottom: 0.5rem;
@media screen and (min-width: 800px) {
flex-basis: 30%;
}
.icon {
width: 3rem;
Expand Down
6 changes: 0 additions & 6 deletions pages/_type/_id/versions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
:href="$parent.findPrimary(version).url"
class="download-button"
:title="`Download ${version.name}`"
@click.prevent="
$parent.downloadFile(
$parent.findPrimary(version).hashes.sha1,
$parent.findPrimary(version).url
)
"
>
<DownloadIcon aria-hidden="true" />
</a>
Expand Down

0 comments on commit de0e30d

Please sign in to comment.