Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle flags/segments not found in UI #176

Merged
merged 1 commit into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ proto: ## Build protobufs
assets: ## Build the ui
@echo ">> generating assets"
@cd ./ui; yarn --frozen-lockfile; yarn build; cd ..

.PHONY: pack
pack: ## Pack the assets in the binary
@echo ">> packing assets"
packr -i cmd/flipt

.PHONY: build
Expand All @@ -76,12 +80,12 @@ dev: ## Build and run in development mode
go run ./cmd/$(PROJECT)/. --config ./config/local.yml

.PHONY: snapshot
snapshot: assets ## Build a snapshot version
snapshot: clean assets pack ## Build a snapshot version
@echo ">> building a snapshot version"
@./script/build/snapshot

.PHONY: release
release: assets ## Build and publish a release
release: clean assets pack ## Build and publish a release
@echo ">> building and publishing a release"
@./script/build/release

Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/Flags/Flag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ export default {
? response.data.variants
: [];
})
.catch(error => {
.catch(() => {
this.notifyError("Error loading flag.");
console.error(error);
this.$router.push("/flags");
});
},
deleteFlag() {
Expand Down
19 changes: 12 additions & 7 deletions ui/src/components/Flags/Targeting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,23 @@ export default {
this.segments = response.data.segments;

let key = this.$route.params.key;
Api.get("/flags/" + key).then(response => {
this.flag = response.data;
Api.get("/flags/" + key)
.then(response => {
this.flag = response.data;

Api.get("/flags/" + key + "/rules").then(response => {
this.rules = map(response.data.rules, r => {
return this.processRule(r);
Api.get("/flags/" + key + "/rules").then(response => {
this.rules = map(response.data.rules, r => {
return this.processRule(r);
});
});
})
.catch(() => {
this.notifyError("Error loading flag.");
this.$router.push("/flags");
});
});
})
.catch(error => {
this.notifyError("Error loading data");
this.notifyError("Error loading data.");
console.error(error);
});
},
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/Segments/Segment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,9 @@ export default {
? response.data.constraints
: [];
})
.catch(error => {
.catch(() => {
this.notifyError("Error loading segment.");
console.error(error);
this.$router.push("/segments");
});
},
deleteSegment() {
Expand Down