Skip to content

Commit

Permalink
Merge branch 'develop' v0.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrahan committed Mar 29, 2024
2 parents e016b04 + 6709d5d commit 8da4c92
Show file tree
Hide file tree
Showing 10 changed files with 620 additions and 9 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
## [0.7.8] - 2024-03-29
- Fix an issue with job status indicator (step function workflow) inserting duplicate entries into DynamoDB.
- Fix regression in the mediasearch finder to re-enable hyperlink to PCA call detail page

## [0.7.7] - 2024-03-06
### Added
- Fix #245 TranscriptKendraSearch page fails to build / load after deployment
Expand Down Expand Up @@ -176,7 +181,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial release

[Unreleased]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/compare/v0.7.7...develop
[Unreleased]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/compare/v0.7.8...develop
[0.7.8]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.7.6
[0.7.7]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.7.6
[0.7.6]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.7.6
[0.7.5]: https://github.com/aws-samples/amazon-transcribe-post-call-analytics/releases/tag/v0.7.5
Expand Down
97 changes: 97 additions & 0 deletions patches/mediasearch/ResultFooter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import React from "react";
import * as _ from "lodash";
import Kendra from "aws-sdk/clients/kendra";

import { isNullOrUndefined, truncateString } from "../../utils";
import "../../search.scss";

import Feedback from "./Feedback";
import { Relevance } from "../../constants";

const IgnoreFormats = ["PLAIN_TEXT"];
const MAX_URI_LENGTH = 30;

interface ResultFooterProps {
queryResultItem: Kendra.QueryResultItem;
attributes: any;
startTime: number;
submitFeedback: (
relevance: Relevance,
resultItem: Kendra.QueryResultItem
) => Promise<void>;
}

export default class ResultFooter extends React.Component<
ResultFooterProps,
{}
> {
private submitClickFeedback = () => {
this.props.submitFeedback(Relevance.Click, this.props.queryResultItem);
};

render() {
const { attributes, queryResultItem, submitFeedback, startTime } = this.props;

const fileFormatName = attributes.FileFormat
? attributes.FileFormat.StringValue
: undefined;

let fileFormat;
if (
!isNullOrUndefined(fileFormatName) &&
IgnoreFormats.indexOf(fileFormatName) === -1
) {
fileFormat = (
<div className="display-inline">
{fileFormatName.toUpperCase()}
<div className="file-format-divider-wrapper">
<div className="file-format-divider" />
</div>
</div>
);
}
let sourceLink;
let isYTVideo = 'ytauthor' in attributes;

// BobS: Modified to enable link to PCA Call Analysis, using Uri containied in document attribute
// const uri = queryResultItem.DocumentURI;
let uri;
let label;
const pcaCallAnalysisUri = _.get(attributes, "ANALYSIS_URI.StringValue");
if (pcaCallAnalysisUri) {
uri = pcaCallAnalysisUri;
label = "Open Call Analysis";
} else {
uri = queryResultItem.DocumentURI;
label = uri;
}

if (uri && !_.isEmpty(uri)) {
sourceLink = (
<div className="display-inline action-link">
<a
href={uri}
onClick={this.submitClickFeedback}
target="_blank"
rel="noopener noreferrer"
>
{truncateString(label!, MAX_URI_LENGTH)}
</a>
</div>
);
}

return (
<div className="result-footer">
<div className="footer-left-text">
{fileFormat}
{sourceLink}
</div>
<Feedback
queryResultItem={queryResultItem}
submitFeedback={submitFeedback}
/>
</div>
);
}
}
Loading

0 comments on commit 8da4c92

Please sign in to comment.