Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
wendybujalski committed Jan 29, 2025
1 parent a7c3f46 commit 294af7e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions app/web/src/components/ApprovalFlowModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import ActionsList from "./Actions/ActionsList.vue";
const changeSetsStore = useChangeSetsStore();
const authStore = useAuthStore();
const ffStore = useFeatureFlagsStore();
const featureFlagsStore = useFeatureFlagsStore();
const toast = useToast();
const modalRef = ref<InstanceType<typeof Modal> | null>(null);
Expand All @@ -65,7 +65,7 @@ async function openModalHandler() {
if (changeSet?.value?.name === "HEAD") return;
userIsApprover.value = changeSetsStore.currentUserIsDefaultApprover;
if (ffStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL)
if (featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL)
userIsApprover.value = false;
modalRef.value?.open();
Expand Down
27 changes: 15 additions & 12 deletions app/web/src/components/InsetApprovalModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:class="
clsx(
'w-1/2 flex flex-col gap-sm p-sm shadow-2xl',
themeClasses('bg-neutral-000 border', 'bg-neutral-900'),
themeClasses('bg-shade-0 border', 'bg-neutral-900'),
)
"
>
Expand All @@ -31,7 +31,7 @@
</template>
<template
v-else-if="
!featureFlagStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
!featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
(mode === 'approved' || mode === 'rejected')
"
>
Expand All @@ -56,7 +56,7 @@
</template>
<template
v-else-if="
featureFlagStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
mode === 'approved'
"
>
Expand All @@ -76,13 +76,13 @@
:class="
clsx(
'flex flex-row',
featureFlagStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL
featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL
? 'place-content-evenly'
: 'justify-center',
)
"
>
<template v-if="featureFlagStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL">
<template v-if="featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL">
<div class="flex flex-col text-sm gap-sm">
<div
v-for="group in requirementGroups"
Expand Down Expand Up @@ -129,7 +129,7 @@
</template>
<div class="flex flex-col gap-xs">
<div
v-if="!featureFlagStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL"
v-if="!featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL"
class="text-sm"
>
These actions will be applied to the real world:
Expand All @@ -144,28 +144,31 @@
<div class="flex flex-row gap-sm justify-center mt-sm">
<VButton
label="Withdraw Request"
tone="info"
variant="solid"
tone="warning"
variant="ghost"
icon="x"
@click="withdraw"
/>
<template
v-if="
(featureFlagStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
(featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
userIsApprover) ||
(!featureFlagStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
(!featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
changeSetsStore.currentUserIsDefaultApprover)
"
>
<VButton
:disabled="mode !== 'requested' || iRejected"
label="Reject Request"
tone="destructive"
icon="thumbs-down"
@click="rejectHandler"
/>
<VButton
:disabled="mode !== 'requested' || iApproved"
label="Approve Request"
tone="success"
icon="thumbs-up"
@click="approve"
/>
</template>
Expand Down Expand Up @@ -218,7 +221,7 @@ export type InsetApprovalModalMode =
const authStore = useAuthStore();
const changeSetsStore = useChangeSetsStore();
const featureFlagStore = useFeatureFlagsStore();
const featureFlagsStore = useFeatureFlagsStore();
const viewStore = useViewsStore();
const applyingChangeSet = ref(false);
Expand Down Expand Up @@ -282,7 +285,7 @@ const requirementGroups = computed(() => {
const satisfied = computed(
() =>
featureFlagStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
!props.approvalData?.requirements.some((r) => r.isSatisfied === false),
);
Expand Down
6 changes: 3 additions & 3 deletions app/web/src/components/Workspace/WorkspaceAdminDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ import WorkspaceAdmin from "@/components/AdminDashboard/WorkspaceAdmin.vue";
import PromptEditor from "@/components/AdminDashboard/PromptAdmin.vue";
const adminStore = useAdminStore();
const featureFlagStore = useFeatureFlagsStore();
const featureFlagsStore = useFeatureFlagsStore();
const router = useRouter();
onBeforeMount(async () => {
if (!featureFlagStore.ADMIN_PANEL_ACCESS) {
if (!featureFlagsStore.ADMIN_PANEL_ACCESS) {
await router.push({ name: "workspace-single" });
}
});
Expand All @@ -115,6 +115,6 @@ const killExecution = () => {
const funcRunId = ref<string | null>(null);
const featureFlags = computed(() => {
return featureFlagStore.allFeatureFlags;
return featureFlagsStore.allFeatureFlags;
});
</script>
9 changes: 5 additions & 4 deletions app/web/src/components/layout/navbar/Notifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<button
v-if="
userIsApprover ||
(ffStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL && numberICanApprove > 0)
(featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL &&
numberICanApprove > 0)
"
v-tooltip="{
content: tooltipText,
Expand Down Expand Up @@ -53,19 +54,19 @@ import ApprovalPendingModal from "../../ApprovalPendingModal.vue";
const changeSetsStore = useChangeSetsStore();
const authStore = useAuthStore();
const ffStore = useFeatureFlagsStore();
const featureFlagsStore = useFeatureFlagsStore();
const pendingApprovalModalRef = ref<InstanceType<
typeof ApprovalPendingModal
> | null>(null);
const userIsApprover = computed(() => {
if (ffStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL) return false;
if (featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL) return false;
return changeSetsStore.currentUserIsDefaultApprover;
});
const numberICanApprove = computed(() => {
if (!ffStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL) {
if (!featureFlagsStore.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL) {
return changeSetsStore.changeSetsNeedingApproval.length;
}
let approvable = 0;
Expand Down

0 comments on commit 294af7e

Please sign in to comment.