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 @@