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

fix: show record errors when testing messages #154

Merged
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
2 changes: 1 addition & 1 deletion canary/ClientApp/src/components/misc/info/Property.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class Property extends Component {
error={error}
/>
);
} else if (type === 'StringArr') {
} else if (type === 'StringArr' || type === 'List`1') {
return (
<StringArrType
key={`${this.props.name}${JSON.stringify(value)}`} // Key ensures re-render if value changes
Expand Down
15 changes: 12 additions & 3 deletions canary/ClientApp/src/components/tests/Connectathon.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,18 @@ export class Connectathon extends Component {
});
}

downloadAsFile(contents) {
downloadAsFile(contents, type = 'html') {
var ext = 'html';
var encoding = 'text/html;charset=utf-8';

if (type === 'json') {
ext = 'json';
encoding = 'application/json;charset=utf-8';
}

var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(contents));
element.setAttribute('download', `canary-report-${this.connectathonRecordName(this.props.params.id).toLowerCase()}-${new Date().getTime()}.html`);
element.setAttribute('href', `data:${encoding},` + encodeURIComponent(contents));
element.setAttribute('download', `canary-report-${this.connectathonRecordName(this.props.params.id).toLowerCase()}-${new Date().getTime()}.${ext}`);
element.click();
}

Expand Down Expand Up @@ -144,6 +152,7 @@ export class Connectathon extends Component {
</Statistic.Group>
<Grid centered columns={1} className="p-t-30 p-b-15">
<Button icon labelPosition='left' primary onClick={() => this.downloadAsFile(report(this.state.test, this.connectathonRecordName(this.props.params.id)))}><Icon name='download' />Generate Downloadable Report</Button>
<Button icon labelPosition='left' primary onClick={() => this.downloadAsFile(JSON.stringify(this.state.test["results"]), 'json')}><Icon name='download' />Download Test Result Data</Button>
</Grid>
<div className="p-b-20" />
<Form size="large">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,18 @@ export class MessageConnectathonProducing extends Component {
});
}

downloadAsFile(contents) {
downloadAsFile(contents, type = 'html') {
var ext = 'html';
var encoding = 'text/html;charset=utf-8';

if (type === 'json') {
ext = 'json';
encoding = 'application/json;charset=utf-8';
}

var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(contents));
element.setAttribute('download', `canary-report-${this.connectathonRecordName(this.props.params.id).toLowerCase()}-${new Date().getTime()}.html`);
element.setAttribute('href', `data:${encoding},` + encodeURIComponent(contents));
element.setAttribute('download', `canary-report-${this.connectathonRecordName(this.props.params.id).toLowerCase()}-${new Date().getTime()}.${ext}`);
element.click();
}

Expand Down Expand Up @@ -203,6 +211,7 @@ export class MessageConnectathonProducing extends Component {
</Statistic.Group>
<Grid centered columns={1} className="p-t-30 p-b-15">
<Button icon labelPosition='left' primary onClick={() => this.downloadAsFile(report(this.state.test, this.connectathonRecordName(this.props.params.id)))}><Icon name='download' />Generate Downloadable Report</Button>
<Button icon labelPosition='left' primary onClick={() => this.downloadAsFile(JSON.stringify(this.state.test["results"]), 'json')}><Icon name='download' />Download Test Result Data</Button>
</Grid>
<div className="p-b-20" />
<Form size="large">
Expand Down
2 changes: 1 addition & 1 deletion canary/Models/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Message
{ "MessageId", "The Message Identifier" },
{ "MessageType", "The NCHS Message Type" },
{ "MessageSource", "The Jurisdiction Message Source" },
{ "MessageDestination", "The NCHS Message Endpoint" },
{ "MessageDestinations", "The NCHS Message Endpoints" },
{ "CertificateNumber", "Death Certificate Number (DeathRecord Identifier)" },
{ "StateAuxiliaryIdentifier", "Auxiliary State File Number (DeathRecord BundleIdentifier)" },
{ "NCHSIdentifier", "The NCHS compound identifier for the supplied DeathRecord" },
Expand Down
Loading