Skip to content

Commit

Permalink
🔀 Merge #429 into deploy/rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Dec 28, 2023
2 parents f83c214 + 694d0f5 commit 760ee4b
Show file tree
Hide file tree
Showing 6 changed files with 509 additions and 7 deletions.
12 changes: 9 additions & 3 deletions components/IscnUploadForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div>
<Card class="p-[32px]" :has-padding="false">
<!-- header -->
<IscnFormHeader :step="step" :total-step="4" />
<IscnFormHeader v-if="mode === 'register'" :step="step" :total-step="4" />
<!-- guide text -->
<Label
:text="$t('UploadForm.guide.selectFile')"
Expand Down Expand Up @@ -134,7 +134,7 @@
</div>
</div>
<div v-else class="flex gap-[8px] justify-end mt-[12px] text-medium-gray">
<Button preset="outline" @click="onSkipUpload"
<Button v-if="mode === 'register'" preset="outline" @click="onSkipUpload"
>{{ $t('UploadForm.button.skip') }}
</Button>
<Button
Expand Down Expand Up @@ -199,7 +199,7 @@
/>
</Dialog>
</Card>
<AttentionsLedger />
<AttentionsLedger v-if="mode === 'register'" />
<Snackbar
v-model="isSizeExceeded"
:text="$t('UploadForm.warning',{ size: Math.round(uploadSizeLimit / (1024*1024)) })"
Expand Down Expand Up @@ -246,9 +246,15 @@ import { getAccountBalance } from '~/utils/cosmos'
const walletModule = namespace('wallet')
type UploadStatus = '' | 'loading' | 'signing' | 'uploading';
const MODE = {
REGISTER: 'register',
EDIT: 'edit',
}
@Component
export default class UploadForm extends Vue {
@Prop(Number) readonly step: number | undefined
@Prop({ default: MODE.REGISTER }) readonly mode: string | undefined
@walletModule.Getter('getSigner') signer!: OfflineSigner | null
@walletModule.Action('initIfNecessary') initIfNecessary!: () => Promise<any>
Expand Down
6 changes: 3 additions & 3 deletions components/SameAsFieldList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default class WalletFieldList extends Vue {
}
get filteredUrlOptions() {
return this.urlOptions.filter(url => url.startsWith('ar://'))
return this.urlOptions?.filter(url => url.startsWith('ar://'))
}
mounted() {
Expand All @@ -129,7 +129,7 @@ export default class WalletFieldList extends Vue {
}))
} else if (this.filteredUrlOptions.length) {
this.sameAsList = this.fileRecords
.filter((file) => this.fileTypeToFind.includes(this.formatFileType(file.fileType)) && file.arweaveId)
?.filter((file) => this.fileTypeToFind.includes(this.formatFileType(file.fileType)) && file.arweaveId)
.map((file, index) => {
const url = this.filteredUrlOptions.find((ar) => ar.includes(file.arweaveId));
const formattedFileType = this.formatFileType(file.fileType);
Expand Down Expand Up @@ -168,7 +168,7 @@ export default class WalletFieldList extends Vue {
deleteEmptyField() {
if (this.sameAsList.length > 1) {
this.sameAsList = this.sameAsList.filter(
this.sameAsList = this.sameAsList?.filter(
(items: any) => items.filename && items.url,
)
}
Expand Down
6 changes: 6 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"iscn.meta.card.preview": "File Preview",
"iscn.meta.card.title": "File Info",
"iscn.meta.content.fingerprints": "Content Fingerprints",
"iscn.meta.content.sameAs": "SameAs",
"iscn.meta.creator.name.placeholder": "Creator Name",
"iscn.meta.creator.name": "Creator Name",
"iscn.meta.creator.url.placeholder": "https://",
Expand Down Expand Up @@ -179,6 +180,10 @@
"IscnCardPage.button.landscape": "Landscape",
"IscnCardPage.button.portrait": "Portrait",
"IscnCardPage.button.print": "Print",
"IscnEditInfo.title": "Edit ISCN Info",
"IscnEditInfo.reUpload": "Re-upload files to update links",
"IscnEditInfo.updating": "Updating ISCN...",
"IscnEditInfo.button.confirm": "Update ISCN",
"IscnRegisterForm.arweave.link": "ar://{arweaveId}",
"IscnRegisterForm.button.back": "Back",
"IscnRegisterForm.button.confirm": "Confirm",
Expand Down Expand Up @@ -209,6 +214,7 @@
"IscnRegisterForm.guide.uploadOnly": "Upload only mode without ISCN",
"IscnRegisterForm.guide.review": "Review and edit metadata",
"IscnRegisterForm.ipfs.link": "ipfs://{hash}",
"IscnRegisterForm.fileSHA256.link": "hash://sha256/{hash}",
"IscnRegisterForm.label.author": "Author",
"IscnRegisterForm.label.stakeholder": "Stakeholders",
"IscnRegisterForm.label.description": "Description",
Expand Down
Loading

0 comments on commit 760ee4b

Please sign in to comment.