@@ -12,8 +12,7 @@ import { GlobalViewsAppliedFiltersRoot, IssuePeekOverview } from "components/iss
12
12
import { SpreadsheetView } from "components/issues/issue-layouts" ;
13
13
import { AllIssueQuickActions } from "components/issues/issue-layouts/quick-action-dropdowns" ;
14
14
import { EmptyState , getEmptyStateImagePath } from "components/empty-state" ;
15
- // ui
16
- import { Spinner } from "@plane/ui" ;
15
+ import { SpreadsheetLayoutLoader } from "components/ui" ;
17
16
// types
18
17
import { TIssue , IIssueDisplayFilterOptions } from "@plane/types" ;
19
18
import { EIssueActions } from "../types" ;
@@ -178,64 +177,60 @@ export const AllIssueLayoutRoot: React.FC = observer(() => {
178
177
179
178
const isEditingAllowed = ! ! currentWorkspaceRole && currentWorkspaceRole >= EUserWorkspaceRoles . MEMBER ;
180
179
181
- return (
182
- < div className = "relative flex h-full w-full flex-col overflow-hidden" >
183
- { ! globalViewId || globalViewId !== dataViewId || loader === "init-loader" || ! issueIds ? (
184
- < div className = "flex h-full w-full items-center justify-center" >
185
- < Spinner />
186
- </ div >
187
- ) : (
188
- < >
189
- < GlobalViewsAppliedFiltersRoot globalViewId = { globalViewId } />
190
-
191
- { ( issueIds ?? { } ) . length == 0 ? (
192
- < EmptyState
193
- image = { emptyStateImage }
194
- title = { ( workspaceProjectIds ?? [ ] ) . length > 0 ? currentViewDetails . title : "No project" }
195
- description = {
196
- ( workspaceProjectIds ?? [ ] ) . length > 0
197
- ? currentViewDetails . description
198
- : "To create issues or manage your work, you need to create a project or be a part of one."
199
- }
200
- size = "sm"
201
- primaryButton = {
202
- ( workspaceProjectIds ?? [ ] ) . length > 0
203
- ? currentView !== "custom-view" && currentView !== "subscribed"
204
- ? {
205
- text : "Create new issue" ,
206
- onClick : ( ) => {
207
- setTrackElement ( "All issues empty state" ) ;
208
- commandPaletteStore . toggleCreateIssueModal ( true , EIssuesStoreType . PROJECT ) ;
209
- } ,
210
- }
211
- : undefined
212
- : {
213
- text : "Start your first project" ,
214
- onClick : ( ) => {
215
- setTrackElement ( "All issues empty state" ) ;
216
- commandPaletteStore . toggleCreateProjectModal ( true ) ;
217
- } ,
218
- }
180
+ if ( loader === "init-loader" || ! globalViewId || globalViewId !== dataViewId || ! issueIds ) {
181
+ return < SpreadsheetLayoutLoader /> ;
182
+ }
183
+
184
+ if ( issueIds . length === 0 ) {
185
+ return (
186
+ < EmptyState
187
+ image = { emptyStateImage }
188
+ title = { ( workspaceProjectIds ?? [ ] ) . length > 0 ? currentViewDetails . title : "No project" }
189
+ description = {
190
+ ( workspaceProjectIds ?? [ ] ) . length > 0
191
+ ? currentViewDetails . description
192
+ : "To create issues or manage your work, you need to create a project or be a part of one."
193
+ }
194
+ size = "sm"
195
+ primaryButton = {
196
+ ( workspaceProjectIds ?? [ ] ) . length > 0
197
+ ? currentView !== "custom-view" && currentView !== "subscribed"
198
+ ? {
199
+ text : "Create new issue" ,
200
+ onClick : ( ) => {
201
+ setTrackElement ( "All issues empty state" ) ;
202
+ commandPaletteStore . toggleCreateIssueModal ( true , EIssuesStoreType . PROJECT ) ;
203
+ } ,
204
+ }
205
+ : undefined
206
+ : {
207
+ text : "Start your first project" ,
208
+ onClick : ( ) => {
209
+ setTrackElement ( "All issues empty state" ) ;
210
+ commandPaletteStore . toggleCreateProjectModal ( true ) ;
211
+ } ,
219
212
}
220
- disabled = { ! isEditingAllowed }
221
- />
222
- ) : (
223
- < div className = "relative h-full w-full overflow-auto" >
224
- < SpreadsheetView
225
- displayProperties = { issueFilters ?. displayProperties ?? { } }
226
- displayFilters = { issueFilters ?. displayFilters ?? { } }
227
- handleDisplayFilterUpdate = { handleDisplayFiltersUpdate }
228
- issueIds = { issueIds }
229
- quickActions = { renderQuickActions }
230
- handleIssues = { handleIssues }
231
- canEditProperties = { canEditProperties }
232
- viewId = { globalViewId }
233
- />
234
- </ div >
235
- ) }
236
- </ >
237
- ) }
213
+ }
214
+ disabled = { ! isEditingAllowed }
215
+ />
216
+ ) ;
217
+ }
238
218
219
+ return (
220
+ < div className = "relative flex h-full w-full flex-col overflow-hidden" >
221
+ < GlobalViewsAppliedFiltersRoot globalViewId = { globalViewId } />
222
+ < div className = "relative h-full w-full overflow-auto" >
223
+ < SpreadsheetView
224
+ displayProperties = { issueFilters ?. displayProperties ?? { } }
225
+ displayFilters = { issueFilters ?. displayFilters ?? { } }
226
+ handleDisplayFilterUpdate = { handleDisplayFiltersUpdate }
227
+ issueIds = { issueIds }
228
+ quickActions = { renderQuickActions }
229
+ handleIssues = { handleIssues }
230
+ canEditProperties = { canEditProperties }
231
+ viewId = { globalViewId }
232
+ />
233
+ </ div >
239
234
{ /* peek overview */ }
240
235
< IssuePeekOverview />
241
236
</ div >
0 commit comments