Skip to content

Commit

Permalink
feat: ignore restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
ssiyad committed Jul 7, 2023
1 parent 2c35e7b commit ef1c9e5
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions desk/src/pages/desk/team/TeamSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,9 @@
</div>
</template>
</TopBar>
<div class="m-6">
<div class="my-6">
<div class="container">
<div class="space-y-4">
<div class="space-y-2">
<Input label="Ignore restrictions" type="checkbox" />
<div class="text-sm text-gray-700">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat
nulla pariatur
</div>
</div>
<div class="text-lg font-medium">Members</div>
<div v-if="!isEmpty(team.doc?.users)" class="flex flex-wrap gap-2">
<Button
Expand All @@ -55,6 +44,13 @@
</Button>
</div>
<div v-else class="text-base text-gray-900">🙇 Such empty</div>
<Switch
v-model="ignoreRestrictions"
size="md"
label="Bypass restrictions"
description="Members of this team will be able to bypass any team-wise restriction"
class="rounded border p-4"
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -118,6 +114,7 @@ import {
Dialog,
Dropdown,
FormControl,
Switch,
} from "frappe-ui";
import { isEmpty } from "lodash";
import { AGENT_PORTAL_TEAM_LIST, AGENT_PORTAL_TEAM_SINGLE } from "@/router";
Expand Down Expand Up @@ -180,6 +177,17 @@ const title = computed({
team.doc.name = t;
},
});
const ignoreRestrictions = computed({
get() {
return !!team.doc?.ignore_restrictions;
},
set(value: boolean) {
if (!team.doc) return;
team.setValue.submit({
ignore_restrictions: value,
});
},
});
const docOptions = [
{
label: "Rename",
Expand Down

0 comments on commit ef1c9e5

Please sign in to comment.