Fix KAN-3 project template flows
This commit is contained in:
+8
-40
@@ -59,83 +59,51 @@ class Project extends Model
|
||||
|
||||
public function boardColumns(): HasMany
|
||||
{
|
||||
return $this->hasMany(
|
||||
BoardColumn::class,
|
||||
$this->project_template_id === null ? 'project_id' : 'project_template_id',
|
||||
$this->project_template_id === null ? 'id' : 'project_template_id',
|
||||
)
|
||||
return $this->hasMany(BoardColumn::class)
|
||||
->orderBy('position');
|
||||
}
|
||||
|
||||
public function ticketFieldDefinitions(): HasMany
|
||||
{
|
||||
return $this->hasMany(
|
||||
TicketFieldDefinition::class,
|
||||
$this->project_template_id === null ? 'project_id' : 'project_template_id',
|
||||
$this->project_template_id === null ? 'id' : 'project_template_id',
|
||||
)
|
||||
return $this->hasMany(TicketFieldDefinition::class)
|
||||
->orderBy('position');
|
||||
}
|
||||
|
||||
public function ticketPriorities(): HasMany
|
||||
{
|
||||
return $this->hasMany(
|
||||
TicketPriority::class,
|
||||
$this->project_template_id === null ? 'project_id' : 'project_template_id',
|
||||
$this->project_template_id === null ? 'id' : 'project_template_id',
|
||||
)
|
||||
return $this->hasMany(TicketPriority::class)
|
||||
->orderBy('position');
|
||||
}
|
||||
|
||||
public function ticketLinkTypes(): HasMany
|
||||
{
|
||||
return $this->hasMany(
|
||||
TicketLinkType::class,
|
||||
$this->project_template_id === null ? 'project_id' : 'project_template_id',
|
||||
$this->project_template_id === null ? 'id' : 'project_template_id',
|
||||
)
|
||||
return $this->hasMany(TicketLinkType::class)
|
||||
->orderBy('position');
|
||||
}
|
||||
|
||||
public function ticketStatuses(): HasMany
|
||||
{
|
||||
return $this->hasMany(
|
||||
TicketStatus::class,
|
||||
$this->project_template_id === null ? 'project_id' : 'project_template_id',
|
||||
$this->project_template_id === null ? 'id' : 'project_template_id',
|
||||
)
|
||||
return $this->hasMany(TicketStatus::class)
|
||||
->orderBy('board_column_id')
|
||||
->orderBy('position');
|
||||
}
|
||||
|
||||
public function ticketTypes(): HasMany
|
||||
{
|
||||
return $this->hasMany(
|
||||
TicketType::class,
|
||||
$this->project_template_id === null ? 'project_id' : 'project_template_id',
|
||||
$this->project_template_id === null ? 'id' : 'project_template_id',
|
||||
)
|
||||
return $this->hasMany(TicketType::class)
|
||||
->orderBy('position');
|
||||
}
|
||||
|
||||
public function repositoryConnections(): HasMany
|
||||
{
|
||||
return $this->hasMany(
|
||||
RepositoryConnection::class,
|
||||
$this->project_template_id === null ? 'project_id' : 'project_template_id',
|
||||
$this->project_template_id === null ? 'id' : 'project_template_id',
|
||||
)
|
||||
return $this->hasMany(RepositoryConnection::class)
|
||||
->orderBy('provider')
|
||||
->orderBy('repository_full_name');
|
||||
}
|
||||
|
||||
public function notificationActions(): HasMany
|
||||
{
|
||||
return $this->hasMany(
|
||||
NotificationAction::class,
|
||||
$this->project_template_id === null ? 'project_id' : 'project_template_id',
|
||||
$this->project_template_id === null ? 'id' : 'project_template_id',
|
||||
)
|
||||
return $this->hasMany(NotificationAction::class)
|
||||
->orderBy('name')
|
||||
->orderBy('id');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user