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

added opensearch hermes support #1901

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions hermes-console/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hermes Console</title>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Hermes">
</head>
<body>
<div id="app"></div>
Expand Down
7 changes: 7 additions & 0 deletions hermes-console/public/opensearch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Hermes</ShortName>
<Description>Search Hermes Topics</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">/favicon.ico</Image>
<Url type="text/html" method="get" template="/ui/groups?q={searchTerms}&amp;ref=opensearch"/>
</OpenSearchDescription>
14 changes: 11 additions & 3 deletions hermes-console/src/views/group-topics/GroupTopicsView.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
<script setup lang="ts">
import { computed } from 'vue';
import {computed, watch} from 'vue';

Check failure on line 2 in hermes-console/src/views/group-topics/GroupTopicsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `import·{computed,·watch` with `··import·{·computed,·watch·`

Check failure on line 2 in hermes-console/src/views/group-topics/GroupTopicsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `import·{computed,·watch` with `··import·{·computed,·watch·`
import { isAdmin, isAny } from '@/utils/roles-util';
import { ref } from 'vue';
import { useDialog } from '@/composables/dialog/use-dialog/useDialog';
import { useGroups } from '@/composables/groups/use-groups/useGroups';
import { useI18n } from 'vue-i18n';
import { useRoles } from '@/composables/roles/use-roles/useRoles';
import { useRouter } from 'vue-router';
import {useRoute, useRouter} from 'vue-router';

Check failure on line 9 in hermes-console/src/views/group-topics/GroupTopicsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `import·{useRoute,·useRouter` with `··import·{·useRoute,·useRouter·`

Check failure on line 9 in hermes-console/src/views/group-topics/GroupTopicsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `import·{useRoute,·useRouter` with `··import·{·useRoute,·useRouter·`
import ConfirmationDialog from '@/components/confirmation-dialog/ConfirmationDialog.vue';
import ConsoleAlert from '@/components/console-alert/ConsoleAlert.vue';
import GroupTopicsListing from '@/views/group-topics/group-topics-listing/GroupTopicsListing.vue';
import LoadingSpinner from '@/components/loading-spinner/LoadingSpinner.vue';
import TopicForm from '@/views/topic/topic-form/TopicForm.vue';

const router = useRouter();
const route = useRoute();
const params = router.currentRoute.value.params as Record<string, string>;
const { groupId } = params;
const { t } = useI18n();

const { groups, loading, error, removeGroup } = useGroups();

const filter = ref<string>();
const filter = ref<string>(route.query.q as string || '');

Check failure on line 24 in hermes-console/src/views/group-topics/GroupTopicsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `route.query.q·as·string` with `(route.query.q·as·string)`

Check failure on line 24 in hermes-console/src/views/group-topics/GroupTopicsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `route.query.q·as·string` with `(route.query.q·as·string)`

const roles = useRoles(null, null).roles;

Expand Down Expand Up @@ -75,6 +76,12 @@
href: `/ui/groups/${groupId}`,
},
];

const updateQueryParams = () => {
router.push({ query: { ...route.query, q: filter.value } } );

Check failure on line 81 in hermes-console/src/views/group-topics/GroupTopicsView.vue

View workflow job for this annotation

GitHub Actions / build

Delete `·`

Check failure on line 81 in hermes-console/src/views/group-topics/GroupTopicsView.vue

View workflow job for this annotation

GitHub Actions / build

Delete `·`
};

watch(filter, updateQueryParams);
</script>

<template>
Expand Down Expand Up @@ -161,6 +168,7 @@
density="compact"
v-model="filter"
prepend-inner-icon="mdi-magnify"
type="search"
/>
</v-col>
</v-row>
Expand Down
14 changes: 11 additions & 3 deletions hermes-console/src/views/groups/GroupsView.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import { isAny } from '@/utils/roles-util';
import { ref } from 'vue';
import {ref, watch} from 'vue';

Check failure on line 3 in hermes-console/src/views/groups/GroupsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `ref,·watch` with `·ref,·watch·`

Check failure on line 3 in hermes-console/src/views/groups/GroupsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `ref,·watch` with `·ref,·watch·`
import { useGroups } from '@/composables/groups/use-groups/useGroups';
import { useI18n } from 'vue-i18n';
import { useRoles } from '@/composables/roles/use-roles/useRoles';
import { useRouter } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import ConsoleAlert from '@/components/console-alert/ConsoleAlert.vue';
import GroupForm from '@/views/groups/group-form/GroupForm.vue';
import GroupListing from '@/views/groups/group-listing/GroupListing.vue';
Expand All @@ -13,10 +13,11 @@
const { groups, loading, error, createGroup } = useGroups();
const { t } = useI18n();
const router = useRouter();
const route = useRoute();

const roles = useRoles(null, null)?.roles;

const filter = ref<string>();
const filter = ref<string>(route.query.q as string || '');

Check failure on line 20 in hermes-console/src/views/groups/GroupsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `route.query.q·as·string` with `(route.query.q·as·string)`

Check failure on line 20 in hermes-console/src/views/groups/GroupsView.vue

View workflow job for this annotation

GitHub Actions / build

Replace `route.query.q·as·string` with `(route.query.q·as·string)`
const createGroupDialogOpen = ref(false);
const breadcrumbsItems = [
{
Expand All @@ -35,6 +36,12 @@
router.go(0);
}
};

const updateQueryParams = () => {
router.push({ query: { ...route.query, q: filter.value } } );

Check failure on line 41 in hermes-console/src/views/groups/GroupsView.vue

View workflow job for this annotation

GitHub Actions / build

Delete `·`

Check failure on line 41 in hermes-console/src/views/groups/GroupsView.vue

View workflow job for this annotation

GitHub Actions / build

Delete `·`
};

watch(filter, updateQueryParams);
</script>

<template>
Expand Down Expand Up @@ -82,6 +89,7 @@
density="compact"
v-model="filter"
prepend-inner-icon="mdi-magnify"
type="search"
/>
</v-col>
</v-row>
Expand Down
Loading