Skip to content

Commit

Permalink
update submission type conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurier committed May 7, 2024
1 parent b268ef3 commit 6088bdc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/dataset/cd.dataset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@

<div class="order-1 order-sm-2">
<v-btn
v-if="!data.repository_identifier"
v-if="data.submission_type !== 'HYDROSHARE'"
class="order-1 order-sm-2 mb-sm-0 mb-4 mt-sm-0 mt-2"
@click="
router.push({
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/components/submissions/cd.submissions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,7 @@

<!-- UPDATE -->
<v-btn
v-if="
item.raw.repoIdentifier &&
item.raw.repository !== 'S3'
"
v-if="item.raw.type === 'HYDROSHARE'"
:id="`sub-${index}-update`"
@click="onUpdate(item.raw)"
:disabled="
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/models/submission.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default class Submission extends Model implements ISubmission {
public date!: number;
public identifier!: string;
public repoIdentifier?: string;
public type?: string;
public repository!: string;
public url!: string;
public id!: string;
Expand Down Expand Up @@ -48,6 +49,7 @@ export default class Submission extends Model implements ISubmission {
date: this.number(0),
identifier: this.attr(""),
repoIdentifier: this.attr(""),
type: this.attr(""),
repository: this.attr(""),
url: this.attr(""),
id: this.attr(""),
Expand All @@ -63,6 +65,7 @@ export default class Submission extends Model implements ISubmission {
identifier: dbSubmission.identifier, // TODO: we should call this something else. It is not the same as the schema's identifier
repository: dbSubmission.repository,
repoIdentifier: dbSubmission.repository_identifier,
type: dbSubmission.type,
url: dbSubmission.url,
id: dbSubmission._id,
};
Expand All @@ -72,11 +75,13 @@ export default class Submission extends Model implements ISubmission {
static getInsertData(apiSubmission: any): ISubmission | Partial<Submission> {
return {
title: apiSubmission.name,
authors: apiSubmission.creator.map((c) => c.name),
authors: apiSubmission.creator.map((c: any) => c.name),
date: new Date(apiSubmission.dateCreated).getTime(),
identifier: Array.isArray(apiSubmission.identifier)
? apiSubmission.identifier[0]
: apiSubmission.identifier,
repoIdentifier: apiSubmission.url,
type: "HYDROSHARE",
url: apiSubmission.url,
id: apiSubmission._id,
};
Expand Down

0 comments on commit 6088bdc

Please sign in to comment.