Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tpurschke authored Sep 14, 2024
2 parents 1973f6b + e97a7f6 commit ab58aaa
Show file tree
Hide file tree
Showing 101 changed files with 1,415 additions and 1,212 deletions.
16 changes: 16 additions & 0 deletions CODING_GUIDELINES_FRONTEND.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

# Code Guidelines


## General
- Close your tag - Leaving some tags open is simply a bad practice. Only self-closing tags are valid. Normal elements can never have self-closing tags.
- Don't use inline styles(if possible) - When creating your markup, do not use inline styling because it would be very hard to override these styles in case you need to.
- Try not to use "!important" - Using the !important declaration is often considered bad practice because it has side effects that mess with one of CSS's core mechanisms: specificity. In many cases, using it could indicate poor CSS architecture.

## Components
- Organize files and components in a folder structure like this. This makes it easy to find the code related to a page, without having to browse the entire file explorer. Try, as much as possible, to respect the SOLID principles. Mainly by creating autonomous and extensible components: inject the smallest possible service or parameter, manage all the possibilities offered by the component. For example, a data modification page should display the data, check their values and save the data at the end of the process.

## UI
# Responsiveness
- Use the bootstrap grid and it's column classes to have easy and responsive design. [Bootstrap](https://getbootstrap.com/docs/5.3/layout/columns/)
- Decide if you want to develop mobile or desktop design first and test respectively.
3 changes: 3 additions & 0 deletions documentation/revision-history-develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,6 @@ bugfix release:
- workflow: external state handling
- fix config value
- remove uniqueness of owner names

# 8.3.2 - 09.09.2024 DEVELOP
- Added welcome message and settings
2 changes: 1 addition & 1 deletion inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### general settings
product_version: "8.3.1"
product_version: "8.3.2"
ansible_user: "{{ lookup('env', 'USER') }}"
ansible_become_method: sudo
ansible_python_interpreter: /usr/bin/python3
Expand Down
1 change: 1 addition & 0 deletions roles/database/files/sql/creation/fworch-fill-stm.sql
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ insert into config (config_key, config_value, config_user) VALUES ('impChangeNot
insert into config (config_key, config_value, config_user) VALUES ('impChangeNotifyStartAt', '00:00:00', 0);

insert into config (config_key, config_value, config_user) VALUES ('extTicketSystems', '[{"Url":"","TicketTemplate":"{\"ticket\":{\"subject\":\"@@TICKET_SUBJECT@@\",\"priority\":\"@@PRIORITY@@\",\"requester\":\"@@ONBEHALF@@\",\"domain_name\":\"\",\"workflow\":{\"name\":\"@@WORKFLOW_NAME@@\"},\"steps\":{\"step\":[{\"name\":\"Erfassung des Antrags\",\"tasks\":{\"task\":{\"fields\":{\"field\":[@@TASKS@@]}}}}]}}}","TasksTemplate":"{\"@xsi.type\":\"multi_access_request\",\"name\":\"GewünschterZugang\",\"read_only\":false,\"access_request\":{\"order\":\"AR1\",\"verifier_result\":{\"status\":\"notrun\"},\"use_topology\":true,\"targets\":{\"target\":{\"@type\":\"ANY\"}},\"users\":{\"user\":@@USERS@@},\"sources\":{\"source\":@@SOURCES@@},\"destinations\":{\"destination\":@@DESTINATIONS@@},\"services\":{\"service\":@@SERVICES@@},\"action\":\"@@ACTION@@\",\"labels\":\"\"}},{\"@xsi.type\":\"text_area\",\"name\":\"Grund für den Antrag\",\"read_only\":false,\"text\":\"@@REASON@@\"},{\"@xsi.type\":\"drop_down_list\",\"name\":\"Regel Log aktivieren?\",\"selection\":\"@@LOGGING@@\"},{\"@xsi.type\":\"date\",\"name\":\"Regel befristen bis:\"},{\"@xsi.type\":\"text_field\",\"name\":\"Anwendungs-ID\",\"text\":\"@@APPID@@\"},{\"@xsi.type\":\"checkbox\",\"name\":\"Die benötigte Kommunikationsverbindung ist im Kommunikationsprofil nach IT-Sicherheitsstandard hinterlegt\",\"value\":@@COM_DOCUMENTED@@},{\"@xsi.type\":\"drop_down_list\",\"name\":\"Expertenmodus: Exakt wie beantragt implementieren (Designervorschlag ignorieren)\",\"selection\":\"Nein\"}"}]', 0);
insert into config (config_key, config_value, config_user) VALUES ('welcomeMessage', '', 0);

INSERT INTO "report_format" ("report_format_name") VALUES ('json');
INSERT INTO "report_format" ("report_format_name") VALUES ('pdf');
Expand Down
5 changes: 5 additions & 0 deletions roles/database/files/sql/idempotent/fworch-texts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,8 @@ INSERT INTO txt VALUES ('sessionTimeoutNoticePeriod', 'German','Benachrichtigung
INSERT INTO txt VALUES ('sessionTimeoutNoticePeriod', 'English','Warning before session timeout (in minutes)');
INSERT INTO txt VALUES ('uiHostName', 'German', 'Hostname der UI');
INSERT INTO txt VALUES ('uiHostName', 'English', 'UI Hostname');
INSERT INTO txt VALUES ('welcomeMessage', 'German', 'Willkommensnachricht');
INSERT INTO txt VALUES ('welcomeMessage', 'English', 'Welcome Message');
INSERT INTO txt VALUES ('maxMessages', 'German', 'Max Anzahl Nachrichten');
INSERT INTO txt VALUES ('maxMessages', 'English', 'Max number of messages');
INSERT INTO txt VALUES ('messageViewTime', 'German', 'Nachrichten-Anzeigedauer (in Sekunden)');
Expand Down Expand Up @@ -6219,3 +6221,6 @@ INSERT INTO txt VALUES ('H9053', 'English', 'The assigned modeller can reject th
<li>If configured by the administrator (<a href="/help/workflow/actions">Actions</a>), the interface can also be rejected inside the workflow request.</li>
</ul>
');

INSERT INTO txt VALUES ('H9054', 'German', 'Nachricht die auf der Anmeldeseite angezeigt werden soll.');
INSERT INTO txt VALUES ('H9054', 'English', 'Message that is displayed on Login Page.');
1 change: 1 addition & 0 deletions roles/database/files/upgrade/8.3.2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
insert into config (config_key, config_value, config_user) VALUES ('welcomeMessage', '', 0) ON CONFLICT DO NOTHING;
2 changes: 1 addition & 1 deletion roles/importer/files/importer/import-main-loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def stop(self):
if not skipping and mgm_details["deviceType"]["id"] in (9, 11, 17, 22, 23, 24): # only handle CPR8x Manager, fortiManager, Cisco MgmCenter, Palo Panorama, Palo FW, FortiOS REST
logger.debug("import-main-loop: starting import of mgm_id=" + id)
try:
import_result = import_management(mgm_id=id, debug_level_in=debug_level,
import_result = import_management(mgmId=id, debug_level_in=debug_level,
clearManagementData=args.clear, force=args.force, limit=str(api_fetch_limit))
except (FwoApiFailedLockImport, FwLoginFailed):
pass # minor errors for a single mgm, go to next one
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query getTickets($fromState: Int!, $toState: Int!) {
request_ticket(where: {_or: [{_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}, {reqtasks: {_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}}]}, order_by: {id: asc}) {
request_ticket(where: {_or: [{_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}, {reqtasks: {_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}}]}, order_by: {id: desc}) {
...ticketDetails
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
rule_metadata_id
rule_created
rule_first_hit
rule_last_hit
rule_last_modified
rule_last_certified
rule_last_certifier_dn
Expand Down
12 changes: 6 additions & 6 deletions roles/lib/files/FWO.Api.Client/Data/NwObjectElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public string IpString
get { return Cidr.CidrString; }
set { Cidr = new Cidr(value); }
}
public Cidr Cidr { get; set; } = new Cidr();
public Cidr Cidr { get; set; } = new();

[JsonProperty("ip_end"), JsonPropertyName("ip_end")]
public string IpEndString
{
get { return CidrEnd.CidrString; } // ?? Cidr.CidrString; }
set { CidrEnd = new Cidr(value ?? Cidr.CidrString); } // if End value is not set, asume host and set start ip as end ip
}
public Cidr CidrEnd { get; set; } = new Cidr();
public Cidr CidrEnd { get; set; } = new();

[JsonProperty("name"), JsonPropertyName("name")]
public string? Name { get; set; }
Expand Down Expand Up @@ -55,9 +55,9 @@ public NwObjectElement(IPAddressRange ipAddressRange, long taskId)
TaskId = taskId;
}

public RequestReqElement ToReqElement(ElemFieldType field)
public WfReqElement ToReqElement(ElemFieldType field)
{
RequestReqElement element = new RequestReqElement()
WfReqElement element = new()
{
Id = ElemId,
TaskId = TaskId,
Expand All @@ -68,9 +68,9 @@ public RequestReqElement ToReqElement(ElemFieldType field)
return element;
}

public RequestImplElement ToImplElement(ElemFieldType field)
public WfImplElement ToImplElement(ElemFieldType field)
{
RequestImplElement element = new RequestImplElement()
WfImplElement element = new()
{
Id = ElemId,
ImplTaskId = TaskId,
Expand Down
8 changes: 4 additions & 4 deletions roles/lib/files/FWO.Api.Client/Data/NwRuleElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ public class NwRuleElement
public string RuleUid { get; set; } = "";


public RequestReqElement ToReqElement()
public WfReqElement ToReqElement()
{
RequestReqElement element = new RequestReqElement()
WfReqElement element = new()
{
Id = ElemId,
TaskId = TaskId,
Expand All @@ -19,9 +19,9 @@ public RequestReqElement ToReqElement()
return element;
}

public RequestImplElement ToImplElement()
public WfImplElement ToImplElement()
{
RequestImplElement element = new RequestImplElement()
WfImplElement element = new()
{
Id = ElemId,
ImplTaskId = TaskId,
Expand Down
8 changes: 4 additions & 4 deletions roles/lib/files/FWO.Api.Client/Data/NwServiceElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ public class NwServiceElement
public long? ServiceId { get; set; }


public RequestReqElement ToReqElement()
public WfReqElement ToReqElement()
{
RequestReqElement element = new ()
WfReqElement element = new ()
{
Id = ElemId,
TaskId = TaskId,
Expand All @@ -23,9 +23,9 @@ public RequestReqElement ToReqElement()
return element;
}

public RequestImplElement ToImplElement()
public WfImplElement ToImplElement()
{
RequestImplElement element = new ()
WfImplElement element = new ()
{
Id = ElemId,
ImplTaskId = TaskId,
Expand Down
12 changes: 0 additions & 12 deletions roles/lib/files/FWO.Api.Client/Data/RequestApprovalWriter.cs

This file was deleted.

51 changes: 0 additions & 51 deletions roles/lib/files/FWO.Api.Client/Data/RequestReqTaskWriter.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace FWO.Api.Data
{
public class RequestApproval : RequestApprovalBase
public class WfApproval : WfApprovalBase
{
[JsonProperty("id"), JsonPropertyName("id")]
public long Id { get; set; }
Expand All @@ -12,13 +12,13 @@ public class RequestApproval : RequestApprovalBase
public long TaskId { get; set; }

[JsonProperty("comments"), JsonPropertyName("comments")]
public List<RequestCommentDataHelper> Comments { get; set; } = new ();
public List<WfCommentDataHelper> Comments { get; set; } = new ();


public RequestApproval()
public WfApproval()
{ }

public RequestApproval(RequestApproval approval) : base(approval)
public WfApproval(WfApproval approval) : base(approval)
{
Id = approval.Id;
TaskId = approval.TaskId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace FWO.Api.Data
{
public class RequestApprovalBase : RequestStatefulObject
public class WfApprovalBase : WfStatefulObject
{
[JsonProperty("date_opened"), JsonPropertyName("date_opened")]
public DateTime DateOpened { get; set; } = DateTime.Now;
Expand All @@ -30,10 +30,10 @@ public class RequestApprovalBase : RequestStatefulObject
public bool InitialApproval { get; set; } = true;


public RequestApprovalBase()
public WfApprovalBase()
{ }

public RequestApprovalBase(RequestApprovalBase approval) : base(approval)
public WfApprovalBase(WfApprovalBase approval) : base(approval)
{
DateOpened = approval.DateOpened;
ApprovalDate = approval.ApprovalDate;
Expand Down
12 changes: 12 additions & 0 deletions roles/lib/files/FWO.Api.Client/Data/WfApprovalWriter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace FWO.Api.Data
{
public class WfApprovalWriter : WfApprovalBase
{
public WfApprovalWriter()
{ }

public WfApprovalWriter(WfApproval approval) : base(approval)
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@

namespace FWO.Api.Data
{
public class RequestComment : RequestCommentBase
public class WfComment : WfCommentBase
{
[JsonProperty("id"), JsonPropertyName("id")]
public int Id { get; set; }


public RequestComment()
public WfComment()
{ }

public RequestComment(RequestComment comment) : base(comment)
public WfComment(WfComment comment) : base(comment)
{
Id = comment.Id;
}
}

public class RequestCommentDataHelper
public class WfCommentDataHelper
{
[JsonProperty("comment"), JsonPropertyName("comment")]
public RequestComment Comment { get; set; } = new ();
public WfComment Comment { get; set; } = new ();


public RequestCommentDataHelper()
public WfCommentDataHelper()
{}

public RequestCommentDataHelper(RequestComment comment)
public WfCommentDataHelper(WfComment comment)
{
Comment = comment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace FWO.Api.Data
{
public class RequestCommentBase
public class WfCommentBase
{
[JsonProperty("ref_id"), JsonPropertyName("ref_id")]
public long? RefId { get; set; }
Expand All @@ -21,10 +21,10 @@ public class RequestCommentBase
public string CommentText { get; set; } = "";


public RequestCommentBase()
public WfCommentBase()
{ }

public RequestCommentBase(RequestCommentBase comment)
public WfCommentBase(WfCommentBase comment)
{
RefId = comment.RefId;
Scope = comment.Scope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public enum ElemFieldType
rule
}

public class RequestElementBase
public class WfElementBase
{
[JsonProperty("ip"), JsonPropertyName("ip")]
public string? IpString { get; set; }
Expand Down Expand Up @@ -41,10 +41,10 @@ public class RequestElementBase
public string? RuleUid { get; set; }


public RequestElementBase()
public WfElementBase()
{ }

public RequestElementBase(RequestElementBase element)
public WfElementBase(WfElementBase element)
{
IpString = element.IpString;
Port = element.Port;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public enum ExtStates
Rejected
}

public class RequestExtState
public class WfExtState
{
[JsonProperty("id"), JsonPropertyName("id")]
public int? Id { get; set; }
Expand Down
Loading

0 comments on commit ab58aaa

Please sign in to comment.