# HG changeset patch # User Tom Gottfried # Date 1567779994 -7200 # Node ID a5dccbc5920d6ccb5f348a3e712d92d34918ebbb # Parent b5aa1eb83bb0ffd8092e1fb0e4f5e10c4057beb8# Parent 6a1fef54d49fc377335d7b5ee5f398f9cfdc9cc9 Merge default into geoserver_sql_views diff -r b5aa1eb83bb0 -r a5dccbc5920d client/src/components/importoverview/LogDetail.vue --- a/client/src/components/importoverview/LogDetail.vue Fri Sep 06 11:58:03 2019 +0200 +++ b/client/src/components/importoverview/LogDetail.vue Fri Sep 06 16:26:34 2019 +0200 @@ -102,7 +102,7 @@ return this.kind === "BN" || this.kind === "UBN"; }, isST() { - return this.kind === "ST"; + return this.kind === "STSH"; }, isSEC() { return this.kind === "SEC"; diff -r b5aa1eb83bb0 -r a5dccbc5920d client/src/components/importoverview/StretchDetails.vue --- a/client/src/components/importoverview/StretchDetails.vue Fri Sep 06 11:58:03 2019 +0200 +++ b/client/src/components/importoverview/StretchDetails.vue Fri Sep 06 16:26:34 2019 +0200 @@ -5,30 +5,32 @@ split: showLogs }" > -
- - {{ details.summary.objnam }} ( - {{ details.summary.countries.join(", ") }} ) +
-
-
-
+ {{ + linkText(stretch) + }} +
+
{{ entry }} {{ - details.summary[entry].join(", ") + listCountries(selectedDetails[entry]) }} - {{ details.summary[entry] }} + {{ selectedDetails[entry] }}
@@ -71,10 +73,12 @@ import { displayError } from "@/lib/errors"; import { mapState, mapGetters } from "vuex"; +const NODETAILS = -99; + export default { data() { return { - showDetails: true + showDetails: NODETAILS }; }, props: ["entry"], @@ -83,11 +87,34 @@ }, computed: { ...mapState("imports", ["showAdditional", "showLogs", "details"]), - ...mapGetters("map", ["openLayersMap"]) + ...mapGetters("map", ["openLayersMap"]), + selectedDetails() { + if (this.showDetails === NODETAILS) return []; + return this.details.summary[this.showDetails]; + } }, methods: { - zoomToStretch() { - const { name } = this.details.summary; + listCountries(countries) { + if (!countries) return ""; + return countries.join(", "); + }, + showDetailsFor(index) { + if (index === this.showDetails) { + this.showDetails = NODETAILS; + return; + } + this.showDetails = index; + }, + linkText(stretch) { + const name = stretch.objnam; + const { countries } = stretch; + const countryNames = !countries + ? "" + : `(${this.listCountries(countries)})`; + return `${name} ${countryNames}`; + }, + zoomToStretch(stretch) { + const { name } = stretch; this.openLayersMap() .getLayer("STRETCHES") .setVisible(true); @@ -115,6 +142,7 @@ }); }); } - } + }, + NODETAILS: NODETAILS }; diff -r b5aa1eb83bb0 -r a5dccbc5920d client/src/components/stretches/StretchForm.vue --- a/client/src/components/stretches/StretchForm.vue Fri Sep 06 11:58:03 2019 +0200 +++ b/client/src/components/stretches/StretchForm.vue Fri Sep 06 16:26:34 2019 +0200 @@ -1,194 +1,17 @@ - - diff -r b5aa1eb83bb0 -r a5dccbc5920d client/src/lib/mixins.js --- a/client/src/lib/mixins.js Fri Sep 06 11:58:03 2019 +0200 +++ b/client/src/lib/mixins.js Fri Sep 06 16:26:34 2019 +0200 @@ -483,8 +483,8 @@ width = this.pdf.doc.getTextWidth(text) + 2 * padding; } let textWidth = width - 2 * padding; + let textLines = this.pdf.doc.splitTextToSize(text, textWidth); if (!height) { - let textLines = this.pdf.doc.splitTextToSize(text, textWidth); height = this.getTextHeight(textLines.length) + 2 * padding; } this.addBox( @@ -499,7 +499,7 @@ if (["bottomright", "bottomleft"].indexOf(position) !== -1) { this.addText( position, - { x: offset.x + padding, y: offset.y - padding / 2 }, + { x: offset.x + padding, y: offset.y }, textWidth, fontSize, color, @@ -508,7 +508,10 @@ } else { this.addText( position, - { x: offset.x + padding, y: offset.y + padding * 2 }, + { + x: offset.x + padding, + y: offset.y + height - this.getTextHeight(textLines.length) + }, textWidth, fontSize, color, diff -r b5aa1eb83bb0 -r a5dccbc5920d pkg/geoserver/boot.go --- a/pkg/geoserver/boot.go Fri Sep 06 11:58:03 2019 +0200 +++ b/pkg/geoserver/boot.go Fri Sep 06 16:26:34 2019 +0200 @@ -567,28 +567,26 @@ // Third associate with layer - if create { - req, err := http.NewRequest( - http.MethodPost, - geoURL+"/rest/layers/"+ - url.PathEscape(workspaceName+":"+entry.Name)+ - "/styles?default=true", - toStream(&styleFilename)) - if err != nil { - return err - } - auth(req) - asJSON(req) + req, err = http.NewRequest( + http.MethodPost, + geoURL+"/rest/layers/"+ + url.PathEscape(workspaceName+":"+entry.Name)+ + "/styles?default=true", + toStream(&styleFilename)) + if err != nil { + return err + } + auth(req) + asJSON(req) - resp, err = http.DefaultClient.Do(req) - if err != nil { - return err - } + resp, err = http.DefaultClient.Do(req) + if err != nil { + return err + } - if resp.StatusCode != http.StatusCreated { - return fmt.Errorf("cannot connect style %s with layer (%s)", - entry.Name, http.StatusText(resp.StatusCode)) - } + if resp.StatusCode != http.StatusCreated { + return fmt.Errorf("cannot connect style %s with layer (%s)", + entry.Name, http.StatusText(resp.StatusCode)) } return nil