File tree Expand file tree Collapse file tree
src/routes/(console)/organization-[organization] Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8080 }
8181
8282 $ : projectCreationDisabled =
83- (isCloud && getServiceLimit (' projects' ) <= data .allProjectsCount ) ||
83+ (isCloud && getServiceLimit (' projects' ) <= data .projects . total ) ||
8484 (isCloud && $readOnly && ! GRACE_PERIOD_OVERRIDE ) ||
8585 ! $canWriteProjects ;
8686
87+ $ : reachedProjectLimit = isCloud && getServiceLimit (' projects' ) <= data .projects .total ;
88+ $ : projectsLimit = getServiceLimit (' projects' );
89+
8790 $ : $registerCommands ([
8891 {
8992 label: ' Create project' ,
129132 <SearchQuery bind:this ={searchQuery } placeholder =" Search by name or ID" />
130133
131134 {#if $canWriteProjects }
132- <Button
133- on:click ={handleCreateProject }
134- event =" create_project"
135- disabled ={projectCreationDisabled }>
136- <Icon icon ={IconPlus } slot =" start" size =" s" />
137- Create project
138- </Button >
135+ {#if projectCreationDisabled && reachedProjectLimit }
136+ <Tooltip placement =" bottom" >
137+ <div >
138+ <Button event =" create_project" disabled >
139+ <Icon icon ={IconPlus } slot =" start" size =" s" />
140+ Create project
141+ </Button >
142+ </div >
143+ <span slot =" tooltip" >
144+ You have reached your limit of {projectsLimit } projects.
145+ </span >
146+ </Tooltip >
147+ {:else }
148+ <Button
149+ on:click ={handleCreateProject }
150+ event =" create_project"
151+ disabled ={projectCreationDisabled }>
152+ <Icon icon ={IconPlus } slot =" start" size =" s" />
153+ Create project
154+ </Button >
155+ {/if }
139156 {/if }
140157 </Layout .Stack >
141158
You can’t perform that action at this time.
0 commit comments