Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G2P-1726: Added ERN and Program columns #230

Merged
merged 4 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions g2p_entitlement_differential/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +274,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: gray; } /* line numbers */
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +300,7 @@
span.pre {
white-space: pre }

span.problematic, pre.problematic {
span.problematic {
color: red }

span.section-subtitle {
Expand Down
7 changes: 3 additions & 4 deletions g2p_entitlement_voucher/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +274,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: gray; } /* line numbers */
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +300,7 @@
span.pre {
white-space: pre }

span.problematic, pre.problematic {
span.problematic {
color: red }

span.section-subtitle {
Expand Down
7 changes: 3 additions & 4 deletions g2p_payment_files/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +274,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: gray; } /* line numbers */
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +300,7 @@
span.pre {
white-space: pre }

span.problematic, pre.problematic {
span.problematic {
color: red }

span.section-subtitle {
Expand Down
18 changes: 15 additions & 3 deletions g2p_program_registrant_info/static/src/js/g2p_additional_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ export class G2PAdditionalInfoWidget extends TextField {
const val = this.props.record.data.program_registrant_info;

if (val) {
if ((!(val.charAt(0) === "{") && !(val.charAt(val.length - 1) === "}")) || !val) {
if (typeof val === "string") {
if (!(val.charAt(0) === "{" && val.charAt(val.length - 1) === "}")) {
this.state.noValue = true;
} else {
this.state.noValue = false;
}
} else if (typeof val === "object") {
this.state.noValue = false;
} else {
this.state.noValue = true;
}
} else {
Expand Down Expand Up @@ -77,7 +85,11 @@ export class G2PAdditionalInfoWidget extends TextField {
}

flattenJson(object) {
const jsonObject = JSON.parse(object);
// Const jsonObject = JSON.parse(object);
let jsonObject = object;
if (typeof object === "string") {
jsonObject = JSON.parse(object);
}
for (const key in jsonObject) {
if (!jsonObject[key]) continue;
if (
Expand All @@ -97,7 +109,7 @@ export class G2PAdditionalInfoWidget extends TextField {
}
jsonObject[key] = markup(documentFiles);
} else if (typeof jsonObject[key] === "object") {
jsonObject[key] = JSON.stringify(jsonObject[key]);
jsonObject[key] = this.flattenJson(jsonObject[key]);
}
}
return jsonObject;
Expand Down
3 changes: 3 additions & 0 deletions g2p_programs/views/registrant_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
<field name="name" />
<field name="ern" />
<field name="code" />
<field name="program_id" />
<field name="cycle_id" />
<field name="valid_from" />
<field name="valid_until" />
Expand Down Expand Up @@ -121,7 +122,9 @@ Part of OpenG2P. See LICENSE file for full copyright and licensing details.
class="btn-success"
/>
<field name="name" />
<field name="ern" />
<field name="code" />
<field name="program_id" />
<field name="cycle_id" />
<field name="valid_from" />
<field name="valid_until" />
Expand Down
Loading