Skip to content
Snippets Groups Projects
Commit 84edf371 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch '820-supply-room-id-and-name-via-graphql' into 'release-3.0'

Resolve "Supply Room ID and Name via Graphql"

See merge request !1202
parents ed6a225c 53c28b54
No related branches found
No related tags found
3 merge requests!1237Release 3.0,!1202Resolve "Supply Room ID and Name via Graphql",!1183Release 3.0
Pipeline #119958 failed
......@@ -9,6 +9,13 @@ and this project adheres to `Semantic Versioning`_.
Unreleased
----------
Added
~~~~~
* GraphQL schema for Rooms
* [Dev] UpdateIndicator Vue Component to display the status of interactive pages
Fixed
~~~~~
......
<template>
<v-tooltip bottom>
<template #activator="{ on, attrs }">
<v-btn
right
icon
v-bind="attrs"
v-on="on"
@click="handleClick"
:loading="status === $options.UPDATING"
>
<v-icon v-if="status !== $options.UPDATING" :color="color">
{{ icon }}
</v-icon>
</v-btn>
</template>
<span>{{ text }}</span>
</v-tooltip>
</template>
<script>
export default {
ERROR: "ERROR", // Something went wrong
SAVED: "SAVED", // Everything alright
UPDATING: "UPDATING", // We are sending something to the server
CHANGES: "CHANGES", // the user changed something, but it has not been saved yet
name: "UpdateIndicator",
emits: ["manual-update"],
props: {
status: {
type: String,
required: true,
},
},
computed: {
text() {
switch (this.status) {
case this.$options.SAVED:
return this.$t("status.saved");
case this.$options.UPDATING:
return this.$t("status.updating");
case this.$options.CHANGES:
return this.$t("status.changes");
default:
return this.$t("status.error");
}
},
color() {
switch (this.status) {
case this.$options.SAVED:
return "success";
case this.$options.CHANGES:
return "secondary";
case this.$options.UPDATING:
return "secondary";
default:
return "error";
}
},
icon() {
switch (this.status) {
case this.$options.SAVED:
return "$success";
case this.$options.CHANGES:
return "mdi-dots-horizontal";
default:
return "$warning";
}
},
isAbleToClick() {
return (
this.status === this.$options.CHANGES ||
this.status === this.$options.ERROR
);
},
},
methods: {
handleClick() {
if (this.isAbleToClick) {
this.$emit("manual-update");
}
},
},
};
</script>
......@@ -224,5 +224,11 @@
},
"graphql": {
"snackbar_error_message": "There was an error retrieving the page data. Please try again."
},
"status": {
"saved": "All changes are saved.",
"updating": "Changes are being synced.",
"changes": "You have unsaved changes.",
"error": "There has been an error while saving the latest changes."
}
}
from graphene_django import DjangoObjectType
from ..models import Room
class RoomType(DjangoObjectType):
class Meta:
model = Room
fields = ("id", "name", "short_name")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment