diff --git a/app/web/src/components/ApprovalFlowModal.vue b/app/web/src/components/ApprovalFlowModal.vue index 47d203e30b..143f5a08f2 100644 --- a/app/web/src/components/ApprovalFlowModal.vue +++ b/app/web/src/components/ApprovalFlowModal.vue @@ -83,6 +83,15 @@ function applyButtonHandler() { } } else { changeSetsStore.REQUEST_CHANGE_SET_APPROVAL(); + + // TODO(nick): we should remove this in favor of only the WsEvent fetching. It appears that + // requesting the approval itself is insufficient for getting the latest approval status at + // the time of writing and the reason appears to be that the change set is "open" by the + // time the inset modal opens. Fortunately, this will work since we are the requester. + if (changeSet.value) { + changeSetsStore.FETCH_APPROVAL_STATUS(changeSet.value.id); + } + closeModalHandler(); } } diff --git a/app/web/src/components/InsetApprovalModal.vue b/app/web/src/components/InsetApprovalModal.vue index 2e92d26b4d..42a946e0b9 100644 --- a/app/web/src/components/InsetApprovalModal.vue +++ b/app/web/src/components/InsetApprovalModal.vue @@ -3,12 +3,12 @@ v-if="mode !== 'error'" :class=" clsx( - 'w-1/2 flex flex-col gap-sm p-sm shadow-2xl', + 'lg:w-1/2 flex flex-col gap-sm p-sm shadow-2xl max-h-full overflow-hidden', themeClasses('bg-shade-0 border', 'bg-neutral-900'), ) " > -
+
{{ changeSetName }} @@ -75,7 +75,7 @@
-
+
-
+
(); -type ReqType = "SchemaVariant" | "View"; interface Requirement { key: string; - type: ReqType; label: string; votes: Vote[]; satisfied: boolean; @@ -249,8 +249,6 @@ interface Vote { const requirementGroups = computed(() => { const groups: Requirement[] = []; props.approvalData?.requirements.forEach((r) => { - if (!["CategorySchema", "View"].includes(r.entityKind)) return; - const userIds = Object.values(r.approverGroups) .flat() .concat(r.approverIndividuals); @@ -268,14 +266,30 @@ const requirementGroups = computed(() => { if (submitted) vote.status = submitted.status; votes.push(vote); }); - const label = - r.entityKind === "CategorySchema" - ? "Asset Changes" - : viewStore.viewsById[r.entityId]?.name ?? "a View"; - const key = r.entityKind === "CategorySchema" ? r.entityKind : r.entityId; + + let label = r.entityKind; + if (r.entityKind === "ApprovalRequirementDefinition") { + label = "Approval Requirement change"; + } else if (r.entityKind === "Schema") { + const variantForSchema = assetStore.schemaVariants.find( + (thing) => thing.schemaId === r.entityId, + ); + label = variantForSchema?.schemaName + ? `Asset named ${variantForSchema?.schemaName}` + : "an Asset"; + } else if (r.entityKind === "SchemaVariant") { + let name = assetStore.variantFromListById[r.entityId]?.displayName; + if (!name) { + name = assetStore.variantFromListById[r.entityId]?.schemaName; + } + label = name ? `Asset named ${name}` : "Asset (name not found)"; + } else if (r.entityKind === "View") { + const name = viewStore.viewsById[r.entityId]?.name; + label = name ? `View named ${name}` : "View (name not found)"; + } + groups.push({ - key, - type: r.entityId as ReqType, + key: r.entityId, label, votes, satisfied: r.isSatisfied, diff --git a/app/web/src/store/feature_flags.store.ts b/app/web/src/store/feature_flags.store.ts index d1cd327da0..31863f8d6e 100644 --- a/app/web/src/store/feature_flags.store.ts +++ b/app/web/src/store/feature_flags.store.ts @@ -88,6 +88,7 @@ export function useFeatureFlagsStore() { // You can override feature flags while working on a feature by setting them to true/false here // for example: // this.FEATURE_FLAG_NAME = false; + this.WORKSPACE_FINE_GRAINED_ACCESS_CONTROL = true; }, }), )();