Skip to content

Commit 8da4c92

Browse files
committed
Merge branch 'develop' v0.7.8
2 parents e016b04 + 6709d5d commit 8da4c92

File tree

10 files changed

+620
-9
lines changed

10 files changed

+620
-9
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Added
10+
## [0.7.8] - 2024-03-29
11+
- Fix an issue with job status indicator (step function workflow) inserting duplicate entries into DynamoDB.
12+
- Fix regression in the mediasearch finder to re-enable hyperlink to PCA call detail page
13+
914
## [0.7.7] - 2024-03-06
1015
### Added
1116
- Fix #245 TranscriptKendraSearch page fails to build / load after deployment
@@ -176,7 +181,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
176181
### Added
177182
- Initial release
178183

179-
[Unreleased]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/compare/v0.7.7...develop
184+
[Unreleased]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/compare/v0.7.8...develop
185+
[0.7.8]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.7.6
180186
[0.7.7]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.7.6
181187
[0.7.6]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.7.6
182188
[0.7.5]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.7.5

patches/mediasearch/ResultFooter.tsx

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
import React from "react";
2+
import * as _ from "lodash";
3+
import Kendra from "aws-sdk/clients/kendra";
4+
5+
import { isNullOrUndefined, truncateString } from "../../utils";
6+
import "../../search.scss";
7+
8+
import Feedback from "./Feedback";
9+
import { Relevance } from "../../constants";
10+
11+
const IgnoreFormats = ["PLAIN_TEXT"];
12+
const MAX_URI_LENGTH = 30;
13+
14+
interface ResultFooterProps {
15+
queryResultItem: Kendra.QueryResultItem;
16+
attributes: any;
17+
startTime: number;
18+
submitFeedback: (
19+
relevance: Relevance,
20+
resultItem: Kendra.QueryResultItem
21+
) => Promise<void>;
22+
}
23+
24+
export default class ResultFooter extends React.Component<
25+
ResultFooterProps,
26+
{}
27+
> {
28+
private submitClickFeedback = () => {
29+
this.props.submitFeedback(Relevance.Click, this.props.queryResultItem);
30+
};
31+
32+
render() {
33+
const { attributes, queryResultItem, submitFeedback, startTime } = this.props;
34+
35+
const fileFormatName = attributes.FileFormat
36+
? attributes.FileFormat.StringValue
37+
: undefined;
38+
39+
let fileFormat;
40+
if (
41+
!isNullOrUndefined(fileFormatName) &&
42+
IgnoreFormats.indexOf(fileFormatName) === -1
43+
) {
44+
fileFormat = (
45+
<div className="display-inline">
46+
{fileFormatName.toUpperCase()}
47+
<div className="file-format-divider-wrapper">
48+
<div className="file-format-divider" />
49+
</div>
50+
</div>
51+
);
52+
}
53+
let sourceLink;
54+
let isYTVideo = 'ytauthor' in attributes;
55+
56+
// BobS: Modified to enable link to PCA Call Analysis, using Uri containied in document attribute
57+
// const uri = queryResultItem.DocumentURI;
58+
let uri;
59+
let label;
60+
const pcaCallAnalysisUri = _.get(attributes, "ANALYSIS_URI.StringValue");
61+
if (pcaCallAnalysisUri) {
62+
uri = pcaCallAnalysisUri;
63+
label = "Open Call Analysis";
64+
} else {
65+
uri = queryResultItem.DocumentURI;
66+
label = uri;
67+
}
68+
69+
if (uri && !_.isEmpty(uri)) {
70+
sourceLink = (
71+
<div className="display-inline action-link">
72+
<a
73+
href={uri}
74+
onClick={this.submitClickFeedback}
75+
target="_blank"
76+
rel="noopener noreferrer"
77+
>
78+
{truncateString(label!, MAX_URI_LENGTH)}
79+
</a>
80+
</div>
81+
);
82+
}
83+
84+
return (
85+
<div className="result-footer">
86+
<div className="footer-left-text">
87+
{fileFormat}
88+
{sourceLink}
89+
</div>
90+
<Feedback
91+
queryResultItem={queryResultItem}
92+
submitFeedback={submitFeedback}
93+
/>
94+
</div>
95+
);
96+
}
97+
}

0 commit comments

Comments
 (0)