Skip to content

Commit

Permalink
feat(masterdata-cockpit): add propagation information (#1483)
Browse files Browse the repository at this point in the history
Co-authored-by: Andreas Pfau <[email protected]>
  • Loading branch information
hgw77 and andypf authored Dec 18, 2024
1 parent d01a954 commit fe2cd9c
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 27 deletions.
16 changes: 8 additions & 8 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ export const scopes = [
"infra",
"ui",
"version",
"access_profile",
"access-profile",
"audit",
"automation",
"block_storage",
"block-storage",
"cloudops",
"compute",
"dns_service",
"email_service",
"dns-service",
"email-service",
"identity",
"image",
"inquiry",
"keppel",
"key_manager",
"key-manager",
"kubernetes",
"lbaas",
"lookup",
"masterdata_cockpit",
"masterdata-cockpit",
"metrics",
"networking",
"object_storage",
"object-storage",
"reports",
"resources",
"shared_filesystem_storage",
"shared-filesystem-storage",
"tools",
"webconsole",
/^ISSUE-\d+$/, // Regex pattern for ISSUE-<number>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class ProjectMasterdataController < DashboardController
before_action :prepare_params, only: %i[create update]
before_action :inheritance

helper :all

authorization_context 'masterdata_cockpit'
authorization_required

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
module MasterdataCockpit
module ApplicationHelper
def render_propagation_status(propagation_type)
if propagation_type == 1
content = "Propagation-Type: New"
icon_name = "rocket"
else
content = "Propagation-Type: Always"
icon_name = "exchange"
end

link_to(icon(icon_name), "#", class: "help-link",
data: {
"content": content,
"popover-type": "help-hint",
"toggle": "popover"
})
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
Hotline/Ticket Queue/Other
.col-sm-8.details-value
- unless @project_masterdata.additional_information
\-
not set
= @project_masterdata.additional_information
.masterdata-group
%h5.masterdata-heading
Expand All @@ -126,13 +126,16 @@
= icon('info-circle')
.col-sm-2.details-value
- unless @project_masterdata.responsible_primary_contact_id
\-
not set
= @project_masterdata.responsible_primary_contact_id
- if @project_masterdata.responsible_primary_contact_email
.col-sm-1.details-label
.col-sm-4.details-value
.col-sm-5.details-value
- if @project_masterdata.responsible_primary_contact_email
= icon('envelope-o')
= mail_to @project_masterdata.responsible_primary_contact_email
- else
not set
.col-sm-1.details-value
= render_propagation_status(@project_masterdata.responsible_primary_propagation_type)
.row
.col-sm-4.details-label
Run Team (Operator)
Expand All @@ -146,13 +149,16 @@
= icon('info-circle')
.col-sm-2.details-value
- unless @project_masterdata.responsible_operator_id
\-
not set
= @project_masterdata.responsible_operator_id
- if @project_masterdata.responsible_operator_email
.col-sm-1.details-label
.col-sm-4.details-value
.col-sm-5.details-value
- if @project_masterdata.responsible_operator_email
= icon('envelope-o')
= mail_to @project_masterdata.responsible_operator_email
- else
not set
.col-sm-1.details-value
= render_propagation_status(@project_masterdata.responsible_operator_propagation_type)
.row
.col-sm-4.details-label
Inventory Role
Expand All @@ -166,13 +172,16 @@
= icon('info-circle')
.col-sm-2.details-value
- unless @project_masterdata.responsible_inventory_role_id
\-
not set
= @project_masterdata.responsible_inventory_role_id
- if @project_masterdata.responsible_inventory_role_email
.col-sm-1.details-label
.col-sm-4.details-value
.col-sm-5.details-value
- if @project_masterdata.responsible_inventory_role_email
= icon('envelope-o')
= mail_to @project_masterdata.responsible_inventory_role_email
- else
not set
.col-sm-1.details-value
= render_propagation_status(@project_masterdata.responsible_inventory_role_propagation_type)
.row
.col-sm-4.details-label
Infrastructure Coordinator
Expand All @@ -186,13 +195,16 @@
= icon('info-circle')
.col-sm-2.details-value
- unless @project_masterdata.responsible_infrastructure_coordinator_id
\-
not set
= @project_masterdata.responsible_infrastructure_coordinator_id
- if @project_masterdata.responsible_infrastructure_coordinator_email
.col-sm-1.details-label
.col-sm-4.details-value
.col-sm-5.details-value
- if @project_masterdata.responsible_infrastructure_coordinator_email
= icon('envelope-o')
= mail_to @project_masterdata.responsible_infrastructure_coordinator_email
- else
not set
.col-sm-1.details-value
= render_propagation_status(@project_masterdata.responsible_infrastructure_coordinator_propagation_type)
.masterdata-group
%h5.masterdata-heading
Cost Info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
= render_errors(@project_masterdata.errors)

.row
.col-sm-8
.col-sm-9
-# project data, only vissible in masterdata view
-# do not show the project infos in modal dialog (used in project wizard)
- unless modal?
Expand Down Expand Up @@ -34,6 +34,6 @@
= link_to 'Edit', plugin('masterdata_cockpit').project_masterdata_edit_path(), id: 'edit_masterdata_btn', data: {modal: true, toggle: "tooltip", placement: "left"}, class: 'btn btn-primary'
#project_masterdata_details
= render partial: 'masterdata_details'
.col-md-4
.col-md-3
#project_masterdata_additional_infos
= render partial: 'masterdata_additional_infos'

0 comments on commit fe2cd9c

Please sign in to comment.