Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/busy-shoes-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/console": patch
---

Fix: Copilot feature visibility to sub-level organizations
4 changes: 2 additions & 2 deletions apps/console/src/layouts/dashboard-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ const DashboardLayout: FunctionComponent<RouteComponentProps> = (
className="dashboard-layout"
header={
(<Header
copilotToggle={ isCopilotFeatureEnabled ? {
copilotToggle={ isCopilotFeatureEnabled && !isSubOrganization() ? {
icon: <AISparkleIcon
width={ 20 }
height={ 20 }
Expand Down Expand Up @@ -525,7 +525,7 @@ const DashboardLayout: FunctionComponent<RouteComponentProps> = (
<Switch>{ resolveRoutes() as ReactNode[] }</Switch>
</Suspense>
</ErrorBoundary>
{ isCopilotFeatureEnabled && (
{ isCopilotFeatureEnabled && !isSubOrganization() && (
<ErrorBoundary
onChunkLoadError={ AppUtils.onChunkLoadError }
handleError={ (_error: Error, _errorInfo: React.ErrorInfo) => {
Expand Down
7 changes: 5 additions & 2 deletions apps/console/src/layouts/default-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ const DefaultLayout: FunctionComponent<DefaultLayoutPropsInterface> = ({
const hasGettingStartedViewPermission: boolean = useRequiredScopes(gettingStartedFeatureConfig?.scopes?.feature);

const { isVisible: isCopilotVisible, togglePanel: toggleCopilotPanel } = useCopilotPanel();
const isFirstLevelOrganization: boolean = useSelector(
(state: AppState) => state.organization.isFirstLevelOrganization
);

const [ filteredRoutes, setFilteredRoutes ] = useState<RouteInterface[]>(getDefaultLayoutRoutes());

Expand Down Expand Up @@ -192,7 +195,7 @@ const DefaultLayout: FunctionComponent<DefaultLayoutPropsInterface> = ({
<AppShell
header={
(<Header
copilotToggle={ featureConfig?.copilot?.enabled ? {
copilotToggle={ featureConfig?.copilot?.enabled && isFirstLevelOrganization ? {
icon: <AISparkleIcon
width={ 20 }
height={ 20 }
Expand Down Expand Up @@ -244,7 +247,7 @@ const DefaultLayout: FunctionComponent<DefaultLayoutPropsInterface> = ({
</Suspense>
</ErrorBoundary>
</AppShell>
{ featureConfig?.copilot?.enabled && (
{ featureConfig?.copilot?.enabled && isFirstLevelOrganization && (
<ErrorBoundary
onChunkLoadError={ AppUtils.onChunkLoadError }
handleError={ (_error: Error, _errorInfo: React.ErrorInfo) => {
Expand Down
Loading