-
-
-
-
- {{ errorMessage }}
-
+
+
- Render
+ Render form
+ arrow_forward
- Compile
+ Compile schema
+
diff --git a/src/app/form-editor/schema-editor/schema-editor.component.ts b/src/app/form-editor/schema-editor/schema-editor.component.ts
index c7c6637..08e9355 100644
--- a/src/app/form-editor/schema-editor/schema-editor.component.ts
+++ b/src/app/form-editor/schema-editor/schema-editor.component.ts
@@ -124,6 +124,7 @@ export class SchemaEditorComponent implements OnInit, OnDestroy {
.getReferencedFormsSchemasArray()
.subscribe((refFormArray) => (this.referencedForms = refFormArray));
+ this.editor.getEditor().setFontSize(16);
this.editor.getEditor().setOptions({
fontFamily: 'Roboto Mono',
printMargin: false,
@@ -131,7 +132,6 @@ export class SchemaEditorComponent implements OnInit, OnDestroy {
});
this.editor.setTheme('chrome');
this.editor.setMode('json');
- this.editor.getEditor().setFontSize(16);
this.ns.getRawSchema().subscribe((schema) => {
if (!_.isEmpty(schema) && !this.correctSchemaMode) {
@@ -172,7 +172,7 @@ export class SchemaEditorComponent implements OnInit, OnDestroy {
);
} catch (e) {
compiledSchema = e;
- this.errorMessage = 'Invalid JSON schema. ' + e;
+ this.errorMessage = `${e}`;
}
const schema = JSON.parse(JSON.stringify(compiledSchema));
@@ -186,7 +186,7 @@ export class SchemaEditorComponent implements OnInit, OnDestroy {
}
}
- reCompile() {
+ recompileSchema() {
const editedSchema = this.editor.getEditor().getValue();
const rawSchema = _.cloneDeep(editedSchema);
const referencedForms = JSON.parse(rawSchema).referencedForms;
@@ -214,7 +214,7 @@ export class SchemaEditorComponent implements OnInit, OnDestroy {
}
showSnackbar() {
- this.snackbar.open('Copied to clipboard', '', { duration: 1200 });
+ this.snackbar.open('Schema copied to clipboard', '', { duration: 1200 });
}
ngOnDestroy() {}
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts
index f182847..9c75acc 100644
--- a/src/app/login/login.component.ts
+++ b/src/app/login/login.component.ts
@@ -18,9 +18,13 @@ export class LoginComponent implements OnInit {
hasInvalidCredentials = false;
selectedValue: string;
message: string;
- corsError: string;
selectedBaseUrl = '';
- baseUrls: string[] = ['https://ngx.ampath.or.ke/amrs', 'Enter a custom URL'];
+ baseUrls: string[] = [
+ 'Enter a custom URL',
+ 'https://ngx.ampath.or.ke/amrs',
+ 'https://data.kenyahmis.org:8500/openmrs',
+ 'https://dev3.openmrs.org/openmrs'
+ ];
ngOnInit() {}
diff --git a/src/app/view-forms/view-forms.component.css b/src/app/view-forms/view-forms.component.css
index 623f9bf..cb6cb48 100644
--- a/src/app/view-forms/view-forms.component.css
+++ b/src/app/view-forms/view-forms.component.css
@@ -1,8 +1,19 @@
+.addButton > span {
+ display: flex !important;
+ align-items: center !important;
+}
+
+.container-f {
+ margin-top: 4rem;
+}
+
.panel {
background-color: #fff;
box-shadow: 0px 2px 2px #aaa;
border-color: lightgray;
+ font-family: 'Inter', sans-serif;
}
+
.panel-table .panel-body {
padding: 0;
/* background-color:#fff;
@@ -14,8 +25,12 @@
margin: 0;
}
+.panel-table .panel-body .table-bordered > thead > tr {
+ font-weight: 900 !important;
+}
+
.panel-table .panel-body .table-bordered > thead > tr > th:first-of-type {
- text-align: center;
+ text-align: left;
width: 100px;
}
@@ -43,8 +58,11 @@
.panel-primary > .panel-heading {
color: #fff;
- background-color: #3f51b5;
- border-color: #808080;
+ /* background-color: #3f51b5; */
+ background-color: rgb(243 244 246);
+ /* background-color: rgb(229 231 235); */
+ /* border-color: #808080; */
+ border-color: lightgray;
}
/*
@@ -71,18 +89,22 @@
.stylish-input-group .input-group-addon {
background: white !important;
}
+
.stylish-input-group .form-control {
border-right: 0;
box-shadow: 0 0 0;
border-color: #ccc;
}
+
.stylish-input-group button {
border: 0;
background: transparent;
}
+
.material-icons.edit {
color: green;
}
+
.navbar-btn {
margin: 5px 5px 0px 5px;
}
@@ -90,24 +112,29 @@
.btn.btn-circle {
border-radius: 5px;
}
+
.btn-create {
color: #1ac91a;
}
+
/* .navbar-nav.navbar-right .btn:not(.collapsed) {
background-color: rgb(111, 84, 153);
border-color: rgb(111, 84, 153);
color: rgb(255, 255, 255);
} */
+
a:hover {
text-decoration: none;
}
+
.panel-title {
color: black;
}
+
.restoreMsg {
- margin-top: 10px;
- padding-left: 30px;
- padding-right: 30px;
+ display: flex;
+ justify-content: center;
+ margin: 2rem;
}
.menuItem {
@@ -122,23 +149,34 @@ a:hover {
color: white;
font-weight: 600;
}
+
.space {
margin-left: 50px;
}
+
mat-card {
color: #3c763d;
background-color: #dff0d8;
border-color: #d6e9c6;
margin: 5px 5px 5px 50px;
}
+
.fill {
flex: 1 1 auto;
}
+
.dropdown-menu {
color: black;
font-family: 'Roboto';
font-weight: 500;
}
+
.dropdown-menu > li {
margin-left: 5px;
+ display: flex;
+ align-items: center;
+}
+
+.logoutLink:hover {
+ background-color: rgba(243, 244, 246);
}
diff --git a/src/app/view-forms/view-forms.component.html b/src/app/view-forms/view-forms.component.html
index 12be3b3..31f243b 100644
--- a/src/app/view-forms/view-forms.component.html
+++ b/src/app/view-forms/view-forms.component.html
@@ -1,56 +1,153 @@
-
-
-
- Create New
-
-
-
-
-
-
- {{ username }}
-
-
+
+
+
+
+ Create a
+ new form
+
+
+
+
+
+
+
+
+
+
+ {{ fullName }}
+
+
+
+
+
+
+
-
-
-
-
- {{ restoreMessage }}
-
-
-
-
- Restore
-
-
- Discard
-
+
+
+
+ Draft form found
+
+
+ {{ draftForm || 'An untitled form' }} was last edited on
+ {{ dateDraftWasLastOpened | date: 'medium' }}.
+
+
+
+ Restore
+
+
+ Discard
+
+
-
+
+
+
+
+ Loading forms...
+
+
+
+
+
-
+
POC Forms
Component Forms
@@ -59,20 +156,38 @@
diff --git a/src/app/view-forms/view-forms.component.ts b/src/app/view-forms/view-forms.component.ts
index a0230ae..bc1312b 100644
--- a/src/app/view-forms/view-forms.component.ts
+++ b/src/app/view-forms/view-forms.component.ts
@@ -25,14 +25,17 @@ export class ViewFormsComponent implements OnInit {
loggingOut = false;
searchValue = '';
loadingMessage = 'Loading Forms...';
- restoreMessage = '';
draftAvailable = false;
draft: any;
rawDraft: any;
formsWithoutSchemas: any[] = [];
subscription: Subscription;
+ draftForm = '';
username: string;
+ fullName: string;
searchFilter: string;
+ isMenuExpanded = false;
+ dateDraftWasLastOpened: Date;
constructor(
private fetchAllFormsService: FetchAllFormsService,
private router: Router,
@@ -44,6 +47,7 @@ export class ViewFormsComponent implements OnInit {
) {
const user = sessionStorageService.getObject('user');
this.username = user.username;
+ this.fullName = user.person.display;
}
ngOnInit() {
@@ -65,14 +69,10 @@ export class ViewFormsComponent implements OnInit {
if (this.ls.getObject(Constants.TIME_STAMP)) {
timestamp = this.ls.getObject(Constants.TIME_STAMP);
}
- this.restoreMessage = `Form ${
- this.ls.getObject(Constants.FORM_METADATA).name
- } was last worked on at ${new Date(
- parseInt(timestamp, 10)
- ).toLocaleDateString()}
- ${new Date(
- parseInt(timestamp, 10)
- ).toLocaleTimeString()} Would you like to continue working on this?`;
+
+ this.dateDraftWasLastOpened = new Date(parseInt(timestamp, 10));
+
+ this.draftForm = this.ls.getObject(Constants.FORM_METADATA).name;
}
}
@@ -119,6 +119,10 @@ export class ViewFormsComponent implements OnInit {
}
}
+ toggleMenu() {
+ this.isMenuExpanded = !this.isMenuExpanded;
+ }
+
fetchPOCForms() {
this.subscription = this.fetchAllFormsService
.fetchAllPOCForms()
diff --git a/src/assets/inter.woff b/src/assets/inter.woff
new file mode 100644
index 0000000..4fcb4b5
Binary files /dev/null and b/src/assets/inter.woff differ
diff --git a/src/assets/logo.svg b/src/assets/logo.svg
index d297292..186f032 100644
--- a/src/assets/logo.svg
+++ b/src/assets/logo.svg
@@ -1,24 +1 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/assets/roboto-mono.woff b/src/assets/roboto-mono.woff
new file mode 100644
index 0000000..f319fbf
Binary files /dev/null and b/src/assets/roboto-mono.woff differ