Skip to content

Commit

Permalink
Tweak the style for deleted flags table
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzhuojie committed Sep 4, 2020
1 parent 11146d8 commit 32c05a8
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 100 deletions.
153 changes: 73 additions & 80 deletions browser/flagr-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion browser/flagr-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
body {
margin: 0;
padding: 0;
font-family: "Avenir", Helvetica, Arial, sans-serif;
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
Expand Down
50 changes: 31 additions & 19 deletions browser/flagr-ui/src/components/Flags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
label="Updated At (UTC)"
:formatter="datetimeFormatter"
sortable
width="165"
width="180"
></el-table-column>
<el-table-column
prop="enabled"
Expand All @@ -90,7 +90,7 @@
</el-table-column>
</el-table>

<el-collapse @change="fetchDeletedFlags">
<el-collapse class="deleted-flags-table" @change="fetchDeletedFlags">
<el-collapse-item title="Deleted Flags">
<el-table
:data="getDeletedFlags"
Expand All @@ -117,18 +117,21 @@
label="Updated At (UTC)"
:formatter="datetimeFormatter"
sortable
width="165"
width="180"
></el-table-column>
<el-table-column
prop="enabled"
label="Enabled"
sortable
prop="action"
label="Action"
align="center"
fixed="right"
width="100"
>
<template slot-scope="scope">
<el-button @click="restoreFlag(scope.row)" type="success" width="90px">Restore</el-button>
<el-button
@click="restoreFlag(scope.row)"
type="warning"
size="small"
>Restore</el-button>
</template>
</el-table-column>
</el-table>
Expand Down Expand Up @@ -234,15 +237,21 @@ export default {
}, handleErr.bind(this));
},
restoreFlag(row) {
var self = this;
Axios.put(`${API_URL}/flags/${row.id}/restore`).then(response => {
let flag = response.data;
this.$message.success(`Flag updated`);
self.flags.push(flag);
self.deletedFlags = self.deletedFlags.filter(function(el) {
return el.id != flag.id;
});
}, handleErr.bind(this));
this.$confirm('This will recover the deleted flag. Continue?', 'Warning', {
confirmButtonText: 'OK',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
Axios.put(`${API_URL}/flags/${row.id}/restore`).then(response => {
let flag = response.data;
this.$message.success(`Flag updated`);
this.flags.push(flag);
this.deletedFlags = this.deletedFlags.filter(function(el) {
return el.id != flag.id;
});
}, handleErr.bind(this));
});
},
fetchDeletedFlags() {
if (!this.deletedFlagsLoaded) {
Expand Down Expand Up @@ -270,8 +279,11 @@ export default {
.el-button-group .el-button--primary:first-child {
border-right-color: #dcdfe6;
}
}
.el-tag {
margin: 2.5px;
.el-tag {
margin: 2.5px;
}
.deleted-flags-table {
margin-top: 2rem;
}
}
</style>

0 comments on commit 32c05a8

Please sign in to comment.