IKHSAN
ENID Baca dalam Bahasa Indonesia

opendesk

Public
Branch
main
Latest commit
08d9f3328 October 2026

TeamsConfig.vue

Open raw
<template>
  <TeamsList v-if="step === 'team-list'" @update:step="updateStep" />
  <NewTeam v-else-if="step === 'new-team'" @update:step="updateStep" />
  <TeamEdit
    v-else-if="step === 'team-edit'"
    @update:step="updateStep"
    :team-name="teamName"
  />
</template>

<script setup lang="ts">
import { onUnmounted, provide, Ref, ref } from "vue";
import TeamEdit from "./TeamEdit.vue";
import TeamsList from "./TeamsList.vue";
import { createListResource } from "frappe-ui";
import NewTeam from "./NewTeam.vue";
import { TeamListResourceSymbol } from "@/types";

type TeamStep = "team-list" | "team-edit" | "new-team";

const step: Ref<TeamStep> = ref("team-list");
const teamName: Ref<string> = ref("");
function updateStep(newStep: TeamStep, team?: string): void {
  step.value = newStep;
  teamName.value = team;
}
const teamsSearchQuery = ref("");

const teams = createListResource({
  doctype: "OD Team",
  cache: ["Teams"],
  fields: ["name", "disabled"],
  auto: true,
  orderBy: "modified desc",
  start: 0,
  pageLength: 20,
});

provide("teamsSearchQuery", teamsSearchQuery);
provide(TeamListResourceSymbol, teams);

onUnmounted(() => {
  teamsSearchQuery.value = "";
  teams.filters = {};
});
</script>

<style scoped></style>
bytes
1,246
lines
49
Type
vue
Latest commit
28 October 2026