Skip to content

Commit

Permalink
Contact/Contactgroup: Remove usage of color column (#203)
Browse files Browse the repository at this point in the history
resolves #200

blocked by #183
blocked by Icinga/icinga-notifications#218
  • Loading branch information
sukhwinder33445 authored Jun 13, 2024
2 parents 817e282 + c599b22 commit 9faad19
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 24 deletions.
8 changes: 1 addition & 7 deletions application/forms/ContactGroupForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,7 @@ public function addGroup(): int

$this->db->beginTransaction();

$this->db->insert(
'contactgroup',
[
'name' => trim($data['group_name']),
'color' => '#000000'
]
);
$this->db->insert('contactgroup', ['name' => trim($data['group_name'])]);

$groupIdentifier = $this->db->lastInsertId();

Expand Down
4 changes: 1 addition & 3 deletions library/Notifications/Model/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function getColumns(): array
return [
'full_name',
'username',
'color',
'default_channel_id'
];
}
Expand All @@ -35,8 +34,7 @@ public function getColumnDefinitions()
{
return [
'full_name' => t('Full Name'),
'username' => t('Username'),
'color' => t('Color')
'username' => t('Username')
];
}

Expand Down
4 changes: 1 addition & 3 deletions library/Notifications/Model/Contactgroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*
* @param int $id
* @param string $name
* @param string $color
*
* @property Query | Contact $contact
* @property Query | RuleEscalationRecipient $rule_escalation_recipient
Expand All @@ -34,8 +33,7 @@ public function getKeyName(): string
public function getColumns(): array
{
return [
'name',
'color'
'name'
];
}

Expand Down
8 changes: 0 additions & 8 deletions library/Notifications/Web/Form/ContactForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@ protected function assemble()
return true;
})]
]
)->addElement(
'color',
'color',
[
'label' => $this->translate('Color'),
'required' => true
]
)->addElement(
'select',
'default_channel_id',
Expand Down Expand Up @@ -165,7 +158,6 @@ public function populate($values)
'contact' => [
'full_name' => $values->full_name,
'username' => $values->username,
'color' => $values->color,
'default_channel_id' => $values->default_channel_id
]
];
Expand Down
1 change: 0 additions & 1 deletion library/Notifications/Widget/MemberSuggestions.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ protected function assemble(): void
'value' => $contact->full_name,
'data-label' => $contact->full_name,
'data-search' => $contact->id,
'data-color' => $contact->color,
'data-class' => 'contact'
])
)
Expand Down
2 changes: 0 additions & 2 deletions library/Notifications/Widget/RecipientSuggestions.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ protected function assemble()
'value' => $contact->full_name,
'data-label' => $contact->full_name,
'data-search' => 'contact:' . $contact->id,
'data-color' => $contact->color,
'data-class' => 'contact'
])
)
Expand All @@ -137,7 +136,6 @@ protected function assemble()
'value' => $group->name,
'data-label' => $group->name,
'data-search' => 'group:' . $group->id,
'data-color' => $group->color,
'data-class' => 'group'
])
)
Expand Down

0 comments on commit 9faad19

Please sign in to comment.