Merge branch 'hotfix/readonly-banner' into develop
This commit is contained in:
commit
afea2a4432
|
|
@ -26,28 +26,13 @@
|
|||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import gql from 'graphql-tag';
|
||||
<script setup lang="ts">
|
||||
import { graphql } from '@/__generated__';
|
||||
import { LICENSE_ACTIVATION } from '@/router/auth.names';
|
||||
import { useQuery } from '@vue/apollo-composable';
|
||||
import { computed } from 'vue';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
me: {
|
||||
readOnly: false,
|
||||
selectedClass: {
|
||||
readOnly: false,
|
||||
},
|
||||
},
|
||||
licenseActivationLink: {
|
||||
name: LICENSE_ACTIVATION,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
apollo: {
|
||||
me: {
|
||||
query: gql`
|
||||
const query = graphql(`
|
||||
query ReadOnlyQuery {
|
||||
me {
|
||||
readOnly
|
||||
|
|
@ -56,30 +41,34 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
`);
|
||||
|
||||
const { result } = useQuery(query, null, {
|
||||
fetchPolicy: 'cache-only',
|
||||
update({ me }) {
|
||||
if (!me) {
|
||||
return {
|
||||
});
|
||||
|
||||
const me = computed(() => {
|
||||
const me = result.value?.me;
|
||||
return (
|
||||
me || {
|
||||
readOnly: false,
|
||||
selectedClass: {
|
||||
readOnly: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
return me;
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
computed: {
|
||||
readOnlyText() {
|
||||
return this.me.readOnly ? 'Sie besitzen keine aktive Lizenz.' : 'Sie sind in dieser Klasse nicht mehr aktiv.';
|
||||
},
|
||||
isReadOnly() {
|
||||
return this.me.readOnly || this.me.selectedClass?.readOnly;
|
||||
},
|
||||
},
|
||||
const isReadOnly = computed(() => {
|
||||
return me.value.readOnly || me.value.selectedClass?.readOnly;
|
||||
});
|
||||
|
||||
const readOnlyText = computed(() => {
|
||||
return me.value.readOnly ? 'Sie besitzen keine aktive Lizenz.' : 'Sie sind in dieser Klasse nicht mehr aktiv.';
|
||||
});
|
||||
|
||||
const licenseActivationLink = {
|
||||
name: LICENSE_ACTIVATION,
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ const typePolicies = {
|
|||
keyFields: ['slug'],
|
||||
},
|
||||
PrivateUserNode: {
|
||||
keyFields: [], // i should never see anyone else's PrivateUserNode, so this should be a singleton
|
||||
fields: {
|
||||
language: {
|
||||
read() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue