From 06e22c591e5b70e7df55808b8dd9608c9edd68fe Mon Sep 17 00:00:00 2001 From: panbed Date: Mon, 25 Nov 2024 15:05:55 -0500 Subject: [PATCH] change environment names for equal access lambda function so its more clear --- .env.example | 12 ++++---- .../js/Components/Forms/UfixitReviewOnly.js | 29 ++++++++++--------- assets/js/Services/Ufixit.js | 1 + src/Services/AsyncEqualAccessReport.php | 10 +++---- src/Services/EqualAccessService.php | 12 ++++---- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.env.example b/.env.example index ba45b98c..7a6559e5 100644 --- a/.env.example +++ b/.env.example @@ -48,12 +48,12 @@ ACCESSIBILITY_CHECKER="equalaccess_lambda" # NOTE: When using a lambda function with equal access, # you need to define the following in a separate .env.local: -# AWS_ACCESS_KEY_ID= -# AWS_SECRET_ACCESS_KEY= -# AWS_REGION= -# AWS_SERVICE= -# AWS_HOST=abcdefghi.execute-api.us-east-1.amazonaws.com -# AWS_ENDPOINT=https://abcdefghi.execute-api.us-east-1.amazonaws.com/endpoint/generate-accessibility-report +# EQUALACCESS_AWS_ACCESS_KEY_ID= +# EQUALACCESS_AWS_SECRET_ACCESS_KEY= +# EQUALACCESS_AWS_REGION= +# EQUALACCESS_AWS_SERVICE= +# EQUALACCESS_AWS_HOST=abcdefghi.execute-api.us-east-1.amazonaws.com +# EQUALACCESS_CANONICAL_URI=endpoint/generate-accessibility-report ###> symfony/messenger ### diff --git a/assets/js/Components/Forms/UfixitReviewOnly.js b/assets/js/Components/Forms/UfixitReviewOnly.js index 9d7def52..67bb9ff6 100644 --- a/assets/js/Components/Forms/UfixitReviewOnly.js +++ b/assets/js/Components/Forms/UfixitReviewOnly.js @@ -3,28 +3,29 @@ import { View } from '@instructure/ui-view' import { Text } from '@instructure/ui-text' class UfixitReviewOnly extends React.Component { - constructor(props) { - super(props) + // constructor(props) { + // super(props) - this.state = { - metadata: this.getMetadata(), - } - } + // this.state = { + // metadata: this.getMetadata(), + // } + // } - getMetadata() { - const issue = this.props.activeIssue - const metadata = JSON.parse(issue.metadata) - console.log(metadata) - return metadata - } + // getMetadata() { + // const issue = this.props.activeIssue + // const metadata = JSON.parse(issue.metadata) + // console.log(metadata) + // return metadata + // } render() { return ( - {this.state.metadata.message ? <>{this.state.metadata.message}

: <>} + {/* {this.state.metadata.message ? <>{this.state.metadata.message}

: <>} */} - {this.props.t('label.review_only')} + {/* {this.props.t('label.review_only')} */} + {this.props.t('label.review_only')}
) } diff --git a/assets/js/Services/Ufixit.js b/assets/js/Services/Ufixit.js index fe093648..775bf94d 100644 --- a/assets/js/Services/Ufixit.js +++ b/assets/js/Services/Ufixit.js @@ -35,6 +35,7 @@ const UfixitForms = { img_alt_misuse: AltText, text_contrast_sufficient: ContrastForm, text_block_heading: HeadingStyleForm, + heading_content_exists: HeadingEmptyForm, } export function returnIssueForm(activeIssue) { diff --git a/src/Services/AsyncEqualAccessReport.php b/src/Services/AsyncEqualAccessReport.php index 45ead4f4..fee28c89 100644 --- a/src/Services/AsyncEqualAccessReport.php +++ b/src/Services/AsyncEqualAccessReport.php @@ -34,11 +34,11 @@ public function __construct() { private function loadConfig() { // Load variables for AWS - $this->awsAccessKeyId = $_ENV['AWS_ACCESS_KEY_ID']; - $this->awsSecretAccessKey = $_ENV['AWS_SECRET_ACCESS_KEY']; - $this->awsRegion = $_ENV['AWS_REGION']; - $this->host = $_ENV['AWS_HOST']; - $this->canonicalUri = $_ENV['AWS_CANONICAL_URI']; + $this->awsAccessKeyId = $_ENV['EQUALACCESS_AWS_ACCESS_KEY_ID']; + $this->awsSecretAccessKey = $_ENV['EQUALACCESS_AWS_SECRET_ACCESS_KEY']; + $this->awsRegion = $_ENV['EQUALACCESS_AWS_REGION']; + $this->host = $_ENV['EQUALACCESS_AWS_HOST']; + $this->canonicalUri = $_ENV['EQUALACCESS_AWS_CANONICAL_URI']; $this->endpoint = "https://{$this->host}/{$this->canonicalUri}"; } diff --git a/src/Services/EqualAccessService.php b/src/Services/EqualAccessService.php index 0b6d81fe..47727a1f 100644 --- a/src/Services/EqualAccessService.php +++ b/src/Services/EqualAccessService.php @@ -117,10 +117,8 @@ public function generateReport($json, $document) { // Check for specific rules (mostly about contrast) // so we can add CSS metadata to database - // TODO: nicer error checking? currently it just - // checks if the array elements at index 3 and 4 exist lol, - // also should check if ruleID is a CSS related one, - // since some messageArgs also are just blank + // TODO: check if these elements exist? + // equal access may just always have these available for each rule however $reasonId = $results["reasonId"]; $message = $results["message"]; $messageArgs = $results["messageArgs"]; @@ -155,9 +153,9 @@ public function generateReport($json, $document) { } public function createMetadata($reasonId, $message, $messageArgs) { - // The Equal Access report has a "messageArgs" section - // which has any dynamic content (color contrast ratios, specific text it wants to mark) - // that we can then use on UFIXIT to generate specific messages + // The Equal Access report has a few sections which describe + // what the error is/what type of error/error arguments, which we can use + // on UFIXIT to display messages $metadata = array( "reasonId" => $reasonId,