Skip to content

Commit

Permalink
fix(front): hide users filter when auth disabled
Browse files Browse the repository at this point in the history
Hide users disclosure from jobs filters panel when authentication is
disabled because gateway is unable to retrieve the list of users in this
case.

fix #330
  • Loading branch information
rezib committed Aug 20, 2024
1 parent 2675833 commit 23a8609
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support node names without digits in expand/fold logic (#328).
- Update dependencies to fix CVE-2024-39338 (axios) and CVE-2024-6783
(vue-template-compiler).
- Hide users disclosure from jobs filters panel when authentication is
disabled (#330).

## [3.1.0] - 2024-07-03

Expand Down
14 changes: 13 additions & 1 deletion frontend/src/components/jobs/JobsFiltersPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<script setup lang="ts">
import { useRuntimeStore } from '@/stores/runtime'
import { useRuntimeConfiguration } from '@/plugins/runtimeConfiguration'
import PartitionFilterSelector from '@/components/filters/PartitionFilterSelector.vue'
import UserFilterSelector from '@/components/jobs/UserFilterSelector.vue'
import AccountFilterSelector from '@/components/jobs/AccountFilterSelector.vue'
Expand Down Expand Up @@ -44,6 +45,7 @@ const props = defineProps({
})
const runtimeStore = useRuntimeStore()
const runtimeConfiguration = useRuntimeConfiguration()
const state_filters = [
{ value: 'completed', label: 'Completed' },
Expand Down Expand Up @@ -144,7 +146,17 @@ const state_filters = [
</div>
</DisclosurePanel>
</Disclosure>
<Disclosure as="div" class="border-t border-t-gray-200 px-4 py-6" v-slot="{ open }">
<!--
Hide users filters disclosure panel when authentication is disabled. The list of
users are retrieved from authentication backend. When authentication is disabled,
the list of users cannot be retrieved.
-->
<Disclosure
v-if="runtimeConfiguration.authentication"
as="div"
class="border-t border-t-gray-200 px-4 py-6"
v-slot="{ open }"
>
<h3 class="-mx-2 -my-3 flow-root">
<DisclosureButton
class="flex w-full items-center justify-between bg-white px-2 py-3 text-sm text-gray-400"
Expand Down

0 comments on commit 23a8609

Please sign in to comment.