diff --git a/ui/src/app/@theme/styles/_overrides.scss b/ui/src/app/@theme/styles/_overrides.scss index 8bef06755..5636b7ee0 100644 --- a/ui/src/app/@theme/styles/_overrides.scss +++ b/ui/src/app/@theme/styles/_overrides.scss @@ -302,6 +302,7 @@ input { font-size: 14px !important; font-weight: 600 !important; transition: background-color 0.3s ease !important; + font-family: 'Montserrat'; } .next-button:hover { background-color: #509afc!important; @@ -320,6 +321,7 @@ input { font-weight: 600 !important; transition: background-color 0.3s ease !important; margin-right: 0 !important; + font-family: 'Montserrat'; } .cancel-back-button:hover { background-color: rgba(255, 255, 255, 0.05) !important; diff --git a/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html b/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html index e3a851290..2a52df198 100644 --- a/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html +++ b/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html @@ -154,8 +154,8 @@

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

YAML -
-

Paste or Upload your {{isJsonMode ? 'Json' : 'Yaml'}} configuration

+
+ Paste or Upload your {{isJsonMode ? 'Json' : 'Yaml'}} configuration
+
+ + + diff --git a/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.scss b/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.scss index 1183e2e06..1f9b5bdda 100644 --- a/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.scss +++ b/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.scss @@ -67,3 +67,20 @@ nb-card { min-height: 367px; max-height: 55vh; } +.upload-button { + color: #3089fc; + background-color: transparent; + border: none; + font-weight: 600; + outline: none; + float: right; + border-radius: 15px; + padding: 6px 12px; + margin-right: 5px; + font-size: 0.875rem; + font-family: 'Montserrat'; + transition: background-color 0.3s ease; +} +.upload-button:hover { + background-color: #171c30 !important; +} diff --git a/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.ts b/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.ts index 3827f5aae..3e2fc2709 100644 --- a/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.ts +++ b/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.ts @@ -121,4 +121,16 @@ export class PolicyInterfaceComponent implements OnInit, AfterViewInit, OnChange this.updateForm(); !!notify && this.editModeChange.emit(this.editMode); } + + onFileSelected(event: any) { + const file: File = event.target.files[0]; + const reader: FileReader = new FileReader(); + + reader.onload = (e: any) => { + const fileContent = e.target.result; + this.code = fileContent; + }; + + reader.readAsText(file); + } }