Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-aderr committed Jan 31, 2024
1 parent 42f56ee commit fccd1ed
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 102 deletions.
17 changes: 8 additions & 9 deletions mlte/frontend/nuxt-app/composables/form-methods.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export function successfulSubmission(artifactType: string, artifactName: string) {
alert(
`Your ${artifactType}, ${artifactName}, has been saved successfully.`
)
export function successfulSubmission(
artifactType: string,
artifactName: string,
) {
alert(`Your ${artifactType}, ${artifactName}, has been saved successfully.`);
}

export function cancelFormSubmission(redirect: string) {
Expand All @@ -26,8 +27,6 @@ export function responseErrorAlert() {
);
}

export function conflictErrorAlert(){
alert(
"Name specified for artifact is already in use."
)
}
export function conflictErrorAlert() {
alert("Name specified for artifact is already in use.");
}
3 changes: 2 additions & 1 deletion mlte/frontend/nuxt-app/layouts/base-layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
target="_blank"
rel="noopener noreferrer"
href="https://mlte.readthedocs.io/en/latest/using_mlte/"
>User Guide</a>
>User Guide</a
>
<span>v0.2.2</span>
</div>
</footer>
Expand Down
24 changes: 16 additions & 8 deletions mlte/frontend/nuxt-app/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@
},
}"
>
<UsaButton class="primary-button">
Edit
</UsaButton>
<UsaButton class="primary-button"> Edit </UsaButton>
</NuxtLink>
</td>
</tr>
Expand Down Expand Up @@ -558,7 +556,9 @@ function populateArtifacts(model: string, version: string, artifactList: any) {
if (isValidNegotiation(artifact)) {
negotiationCards.value.push({
id: artifact.header.identifier,
timestamp: new Date(artifact.header.timestamp).toLocaleString("en-US"),
timestamp: new Date(artifact.header.timestamp).toLocaleString(
"en-US",
),
model,
version,
});
Expand All @@ -569,7 +569,9 @@ function populateArtifacts(model: string, version: string, artifactList: any) {
if (isValidReport(artifact)) {
reports.value.push({
id: artifact.header.identifier,
timestamp: new Date(artifact.header.timestamp).toLocaleString("en-US"),
timestamp: new Date(artifact.header.timestamp).toLocaleString(
"en-US",
),
model,
version,
});
Expand All @@ -580,7 +582,9 @@ function populateArtifacts(model: string, version: string, artifactList: any) {
if (isValidSpec(artifact)) {
specifications.value.push({
id: artifact.header.identifier,
timestamp: new Date(artifact.header.timestamp).toLocaleString("en-US"),
timestamp: new Date(artifact.header.timestamp).toLocaleString(
"en-US",
),
model,
version,
});
Expand All @@ -592,7 +596,9 @@ function populateArtifacts(model: string, version: string, artifactList: any) {
validatedSpecs.value.push({
id: artifact.header.identifier,
specid: artifact.body.spec_identifier,
timestamp: new Date(artifact.header.timestamp).toLocaleString("en-US"),
timestamp: new Date(artifact.header.timestamp).toLocaleString(
"en-US",
),
model,
version,
});
Expand All @@ -605,7 +611,9 @@ function populateArtifacts(model: string, version: string, artifactList: any) {
id: artifact.header.identifier.slice(0, -6),
measurement: artifact.body.metadata.measurement_type,
type: artifact.body.value.value_type,
timestamp: new Date(artifact.header.timestamp).toLocaleString("en-US"),
timestamp: new Date(artifact.header.timestamp).toLocaleString(
"en-US",
),
model,
version,
});
Expand Down
50 changes: 24 additions & 26 deletions mlte/frontend/nuxt-app/pages/negotiation-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,7 @@
</UsaSelect>

<div class="input-group" style="margin-top: 1em">
<div
v-for="(label, labelIndex) in dataItem.labels"
:key="labelIndex"
>
<div v-for="(label, labelIndex) in dataItem.labels" :key="labelIndex">
<div class="inline-input-left">
<UsaTextInput v-model="label.description">
<template #label> Label Description </template>
Expand Down Expand Up @@ -435,7 +432,9 @@
</div>

<div style="text-align: right; margin-top: 1em">
<UsaButton class="secondary-button" @click="cancelFormSubmission('/')"> Cancel </UsaButton>
<UsaButton class="secondary-button" @click="cancelFormSubmission('/')">
Cancel
</UsaButton>
<UsaButton class="primary-button" @click="submit()"> Save </UsaButton>
</div>
</NuxtLayout>
Expand Down Expand Up @@ -661,29 +660,28 @@ async function submit() {
version +
"/artifact",
{
retry: 0,
method: "POST",
body: {
artifact,
force: forceSaveParam.value,
parents: false,
},
onRequestError() {
requestErrorAlert();
},
onResponseError({ response }) {
if (response.status === 409){
conflictErrorAlert();
}
else{
responseErrorAlert();
}
retry: 0,
method: "POST",
body: {
artifact,
force: forceSaveParam.value,
parents: false,
},
onRequestError() {
requestErrorAlert();
},
onResponseError({ response }) {
if (response.status === 409) {
conflictErrorAlert();
} else {
responseErrorAlert();
}
},
},
});
successfulSubmission('negotiation card', identifier);
);
successfulSubmission("negotiation card", identifier);
forceSaveParam.value = true;
}
catch(error){
} catch (error) {
console.log("Error in fetch.");
console.log(error);
}
Expand Down
Loading

0 comments on commit fccd1ed

Please sign in to comment.