Skip to content

Commit

Permalink
Merge branch 'subsetter_front_clean' into develop_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Nov 28, 2023
2 parents dc23f87 + ef244c2 commit f261939
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/frontend/src/components/AlertPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
</template>

<script setup>
import { defineProps } from 'vue';
const props = defineProps({ text: { type: String, default: "" }, title: { default: "Alert" } })
</script>

Expand Down
1 change: 0 additions & 1 deletion app/frontend/src/components/SnackBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</template>

<script setup>
import { defineProps } from 'vue';
const props = defineProps({ message: { type: String, default: "" }, show: { default: true }, timeout: { type: Number, default: 2000 } })
</script>
Expand Down
18 changes: 16 additions & 2 deletions app/frontend/src/components/SubmitButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ const modelsStore = useModelsStore();
function submit() {
const model = modelsStore.selectedModel
const hucsArray = Map.selected_hucs
submitHucs(hucsArray, model.shortName)
if (model.input === "hucs") {
const hucsArray = Map.selected_hucs
submitHucs(hucsArray, model.shortName)
} else {
const bbox = Map.bbox
submitBbox(bbox, model.shortName)
}
}
async function submitHucs(selected_hucs, model) {
selected_hucs = selected_hucs.map(a => a.hucid);
Expand All @@ -27,4 +32,13 @@ async function submitHucs(selected_hucs, model) {
const parJson = await fetchWrapper.post(`${ENDPOINTS.submit}/${model}?hucs=${hucs}`)
alert(`Submitted ${parJson.workflow_name} workflow. Workflow_id: ${parJson.workflow_id}`)
}
async function submitBbox(bbox, model) {
const [xmin, ymin, xmax, ymax] = bbox
const params = `y_south=${ymin}&y_north=${ymax}&x_west=${xmin}&x_east=${xmax}`
alert(`Submitting bbox: ${bbox} for ${model} subsetting`)
const parJson = await fetchWrapper.post(`${ENDPOINTS.submit}/${model}?${params}`)
alert(`Submitted ${parJson.workflow_name} workflow. Workflow_id: ${parJson.workflow_id}`)
}
</script>
3 changes: 2 additions & 1 deletion app/frontend/src/components/UserLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ function onLogOut() {
</script>

<style lang="scss" scoped>
::v-deep .v-card__text img {
/* ::v-deep .v-card__text img {
max-width: 12rem;
}
*/
</style>

0 comments on commit f261939

Please sign in to comment.