Skip to content

Commit

Permalink
Merge pull request #1013 from Klantinteractie-Servicesysteem/pc-730-v…
Browse files Browse the repository at this point in the history
…ac-beheerfunctionaliteit-kunnen-verbergen

VAC beheerfunctionaliteit kunnen verbergen
  • Loading branch information
nijmra authored Jan 16, 2025
2 parents f12cc81 + 5683b28 commit 79511c0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
7 changes: 7 additions & 0 deletions Kiss.Bff/Intern/Environment/EnvironmentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ public IActionResult GetUseKlantIneracties()
return Ok(new { useKlantInteracties = bool.Parse(useKlantInteracties) });
}

[HttpGet("use-vacs")]
public IActionResult GetUseVacs()
{
return bool.TryParse(_configuration["USE_VACS"] ?? "false", out var useVacs) ?
(IActionResult) Ok(new { useVacs }) : Ok(new { useVacs = false });
}

[HttpGet("versienummer")]
public IActionResult GetVersienummer()
{
Expand Down
17 changes: 13 additions & 4 deletions src/views/Beheer/BeheerLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
>
<router-link to="/Beheer/Kanalen">Kanalen</router-link>
<router-link to="/Beheer/formulieren-contactverzoek-afdeling">
Formulieren contactverzoek afdelingen
Contactverzoekformulieren afdelingen
</router-link>
<router-link to="/Beheer/formulieren-contactverzoek-groep">
Formulieren contactverzoek groepen
Contactverzoekformulieren groepen
</router-link>

<router-link to="/Beheer/vacs"> Vacs </router-link>
<router-link v-if="useVacs" to="/Beheer/vacs">Vacs</router-link>
</nav>

<main>
Expand All @@ -29,6 +29,8 @@
import { watchEffect } from "vue";
import { useRouter } from "vue-router";
import { useCurrentUser } from "@/features/login";
import { useLoader } from "@/services/use-loader";
import { fetchLoggedIn } from "@/services";
const user = useCurrentUser();
const router = useRouter();
Expand All @@ -38,11 +40,18 @@ watchEffect(() => {
router.push("/");
}
});
const { data: useVacs } = useLoader(() =>
fetchLoggedIn("/api/environment/use-vacs")
.then((r) => r.json())
.then(({ useVacs }) => useVacs),
);
</script>

<style lang="scss" scoped>
nav {
display: flex;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--spacing-default);
margin-bottom: var(--spacing-large);
}
Expand Down

0 comments on commit 79511c0

Please sign in to comment.