Enhance bug reporting from within the app (#16566)

* Fix paths of imports

* Process not-found.vue as ts

To prevent the following error from 'vue-tsc':
  error TS6504: File '/Users/pascal/Development/directus/app/src/modules/insights/routes/not-found.vue.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?

Note: We could also enable 'allowJS' but since this is the only js file
this seems to be a more fitting fix

* Drop hljs language definition for GraphQL (now in core)

* Enhance bug reporting from within the app

* Simplify simplify simplify

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Pascal Jufer
2023-04-11 21:04:26 +02:00
committed by GitHub
parent 15b91dee34
commit f09f440146
5 changed files with 64 additions and 96 deletions

View File

@@ -35,7 +35,7 @@ export default defineComponent({
setup() {
const { t } = useI18n();
const { parsedInfo } = useProjectInfo();
const { parsedInfo: projectInfo } = useProjectInfo();
const navItems = [
{
@@ -76,23 +76,16 @@ export default defineComponent({
];
const externalItems = computed(() => {
const bugReportParams = new URLSearchParams({
template: 'bug_report.yml',
'directus-version': parsedInfo.value?.directus.version ?? '',
'node-version': parsedInfo.value?.node.version ?? '',
'operating-system': `${parsedInfo.value?.os.type ?? ''} ${parsedInfo.value?.os.version ?? ''}`,
});
return [
{
icon: 'bug_report',
name: t('report_bug'),
href: `https://github.com/directus/directus/issues/new?${bugReportParams.toString()}`,
href: 'https://github.com/directus/directus/issues/new?template=bug_report.yml',
},
{
icon: 'new_releases',
name: t('request_feature'),
href: 'https://github.com/directus/directus/discussions/new',
href: 'https://github.com/directus/directus/discussions/new?category=feature-requests',
},
];
});

View File

@@ -19,7 +19,7 @@ type ServerInfo = {
};
};
type UsableProjectInfo = {
export type UsableProjectInfo = {
info: Ref<ServerInfo | undefined>;
parsedInfo: ComputedRef<{
directus: {