diff --git a/.fsw.yml b/.fsw.yml index 3aef8bfb..fbb993db 100644 --- a/.fsw.yml +++ b/.fsw.yml @@ -5,7 +5,7 @@ triggers: - './pkg' - './swagger_gen' - '!**/*_test.go' - cmd: make build && make run + cmd: make build && make run | jq . shell: true delay: 1000ms stop_timeout: 500ms diff --git a/browser/flagr-ui/src/App.vue b/browser/flagr-ui/src/App.vue index bb06652a..e5810bba 100644 --- a/browser/flagr-ui/src/App.vue +++ b/browser/flagr-ui/src/App.vue @@ -22,17 +22,8 @@ @@ -150,6 +141,7 @@ ul { border: 1px solid #ccc; border-radius: 3px; width: 100%; + margin-bottom: 12px; } } diff --git a/browser/flagr-ui/src/components/Flag.vue b/browser/flagr-ui/src/components/Flag.vue index 32f874f1..7aecd74e 100644 --- a/browser/flagr-ui/src/components/Flag.vue +++ b/browser/flagr-ui/src/components/Flag.vue @@ -116,13 +116,14 @@
- Save + Save Flag
- + @@ -130,6 +131,7 @@
- Save + Save Variant @@ -225,7 +227,7 @@
- Save + Save Segment @@ -233,15 +235,17 @@
- + - + - - -

Constraints

+ + +

Constraints (match ALL of them)

-
    -
  1. +
    -
    - {{ constraint.property }} - {{ operatorValueToLabelMap[constraint.operator] }} - - {{ constraint.value }} - -
    -
    - - - -
    -
  2. -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
No constraints for this segment yet
-
-
+ + + v-model="segment.newConstraint.property"> -
-
- + + + -
-
+ + + size="small" + placeholder='Value, e.g. "CA", ["CA", "NY"]' + v-model="segment.newConstraint.value"> -
-
- - Create Constraint - + + + + + + +
- +

Distribution

  • {{ distribution.variantKey }} - {{ distribution.percent }} % + {{ distribution.percent }}%
@@ -356,7 +390,6 @@ import constants from '@/constants' import helpers from '@/helpers/helpers' import Spinner from '@/components/Spinner' import clone from 'lodash.clone' -import { Button, Dialog, Slider, Checkbox, Tag, Breadcrumb, BreadcrumbItem, Switch } from 'element-ui' import {operators} from '@/../config/operators.json' const OPERATOR_VALUE_TO_LABEL_MAP = operators.reduce((acc, el) => { @@ -406,15 +439,7 @@ function processVariant (variant) { export default { name: 'flag', components: { - spinner: Spinner, - 'el-button': Button, - 'el-dialog': Dialog, - 'el-slider': Slider, - 'el-checkbox': Checkbox, - 'el-tag': Tag, - 'el-breadcrumb': Breadcrumb, - 'el-breadcrumb-item': BreadcrumbItem, - 'el-switch': Switch + spinner: Spinner }, data () { return { @@ -580,6 +605,18 @@ export default { this.$message.error(err.body.message) }) }, + putConstraint (segment, constraint) { + const {flagId} = this.$route.params + + this.$http.put( + `${API_URL}/flags/${flagId}/segments/${segment.id}/constraints/${constraint.id}`, + constraint + ).then(() => { + this.$message.success('constraint updated') + }, err => { + this.$message.error(err.body.message) + }) + }, deleteConstraint (segment, constraint) { const {flagId} = this.$route.params @@ -690,16 +727,11 @@ h2 { background-color: #ddd; } } -} - -.segment-constraints { - padding-right: 10px; -} - -.segment-distributions { - padding-left: 10px; - .edit-distribution-button { - margin-top: 5px; + .segment-constraint { + margin-bottom: 12px; + padding: 1px; + background-color: #f6f6f6; + border-radius: 5px; } } @@ -713,7 +745,6 @@ ol.constraints-inner { padding: 3px 0; .el-tag { font-size: 0.7em; - vertical-align: middle; } } } @@ -732,6 +763,10 @@ ol.constraints-inner { margin-top: 10px; } +.edit-distribution-button { + margin-top: 5px; +} + .edit-distribution-choose-variants { padding: 10px 0; } @@ -752,12 +787,6 @@ ol.constraints-inner { margin-bottom: 8px; } -.truncate { - max-width: 200px; - overflow-x: hidden; - text-overflow: ellipsis; -} - .flag-content{ margin-top: 8px; } diff --git a/browser/flagr-ui/src/components/Flags.vue b/browser/flagr-ui/src/components/Flags.vue index 4c7e940c..8791e074 100644 --- a/browser/flagr-ui/src/components/Flags.vue +++ b/browser/flagr-ui/src/components/Flags.vue @@ -52,7 +52,6 @@