@extends('layouts.main') @section('title', 'Assign Workspace') @section('styles') @endsection @section('content')

Assign Workspace to {{ $user->name }}

Microsoft Fabric Workspace Assignment (DataPipeline Items Only)
@if($apiConnected) API Connected @else API Not Connected @endif Back to Companies
@if(session('success')) @endif @if(session('error')) @endif @if(session('warning')) @endif @if(session('conflicts')) @endif @if(isset($tokenError)) @endif @if(app()->environment('local'))
Debug Info: User has {{ App\Models\Workspace::where('user_id', $user->id)->count() }} total workspaces, {{ App\Models\Workspace::where('user_id', $user->id)->whereHas('workspaceItems')->count() }} with items
@endif
{{ strtoupper(substr($user->name, 0, 1)) }}
{{ $user->name }}

{{ $user->email }}

Company: {{ $user->company ?? 'Not Set' }}

Note: Only DataPipeline items are displayed for assignment. Other item types (like Notebooks, Reports, etc.) are not shown in this interface.
@csrf
@if(count($availableWorkspaces) > 0) @foreach($availableWorkspaces as $index => $workspace) @php // Check if any items in this workspace are assigned $hasAssignedItems = false; $allItemsAssigned = true; $totalItems = 0; $assignedItemsCount = 0; if (isset($workspace['items']) && count($workspace['items']) > 0) { $totalItems = count($workspace['items']); foreach ($workspace['items'] as $item) { if (isset($item['is_assigned']) && $item['is_assigned']) { $hasAssignedItems = true; $assignedItemsCount++; } else { $allItemsAssigned = false; } } } else { $allItemsAssigned = false; } @endphp
Workspace: {{ $workspace['name'] }} @if($hasAssignedItems) Has Assignments @elseif(isset($workspace['assigned_to_other']) && $workspace['assigned_to_other']) Assigned to Other Company @endif
TYPE:
{{ $workspace['type'] }}
CAPACITY:
{{ $workspace['capacity'] }}

@if(isset($workspace['items']) && count($workspace['items']) > 0) @foreach($workspace['items'] as $item) @endforeach
Item Name Item Type Item ID
{{ $item['displayName'] ?? $item['name'] ?? 'Unnamed Item' }} @if(isset($item['is_assigned']) && $item['is_assigned']) Already Assigned @endif {{ $item['type'] ?? 'Unknown' }} {{ $item['id'] ?? 'N/A' }}
@else
No Items Found

This workspace doesn't contain any items yet.

@endif {{-- Lakehouse Assignment --}}
@if(!empty($workspace['lakehouses'])) @php $lhSelectId = 'lh_select_' . $loop->index; @endphp
@unless(isset($workspace['assigned_to_other']) && $workspace['assigned_to_other']) @endunless
Select a Lakehouse for Copy Jobs and Notebooks in this workspace. Leave as default to use the global Lakehouse. @else

No Lakehouses found in this Fabric workspace. The global default will be used.

@endif
@endforeach @else
@if(isset($tokenError))
Microsoft Fabric Connection Failed

Unable to connect to Microsoft Fabric due to authentication issues.
Please contact your administrator to resolve this issue.

@else
No Workspaces Available

@if($apiConnected) No workspaces are currently available from Microsoft Fabric API. @else Unable to connect to Microsoft Fabric API. Please check the configuration. @endif

@endif
@endif
Workspace Assignment Rules
Assignment Rules:
  • Each workspace can only be assigned to one company
  • Workspaces assigned to other companies are disabled
  • Use "Unassign" to free up workspaces when needed
Status Indicators:
  • AvailableWorkspace can be assigned
  • Assigned to Other CompanyAlready taken
  • Has AssignmentsCurrently yours
@endsection @section('scripts') @endsection