Skip to content

Commit

Permalink
change environment names for equal access lambda function so its more…
Browse files Browse the repository at this point in the history
… clear
  • Loading branch information
panbed committed Nov 25, 2024
1 parent c5f189c commit 06e22c5
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
12 changes: 6 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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=<access_key_id>
# AWS_SECRET_ACCESS_KEY=<secret_access_key>
# AWS_REGION=<region (e.g. us-east-1)>
# AWS_SERVICE=<service (e.g. execute-api)>
# 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=<access_key_id>
# EQUALACCESS_AWS_SECRET_ACCESS_KEY=<secret_access_key>
# EQUALACCESS_AWS_REGION=<region (e.g. us-east-1)>
# EQUALACCESS_AWS_SERVICE=<service (e.g. execute-api)>
# EQUALACCESS_AWS_HOST=abcdefghi.execute-api.us-east-1.amazonaws.com
# EQUALACCESS_CANONICAL_URI=endpoint/generate-accessibility-report


###> symfony/messenger ###
Expand Down
29 changes: 15 additions & 14 deletions assets/js/Components/Forms/UfixitReviewOnly.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<View as="div" margin="small small">
{this.state.metadata.message ? <><Text lineHeight="double">{this.state.metadata.message}</Text><br /><br /></> : <></>}
{/* {this.state.metadata.message ? <><Text lineHeight="double">{this.state.metadata.message}</Text><br /><br /></> : <></>} */}

<Text fontStyle='italic' >{this.props.t('label.review_only')}</Text>
{/* <Text fontStyle='italic' >{this.props.t('label.review_only')}</Text> */}
<Text lineHeight='double'>{this.props.t('label.review_only')}</Text>
</View>
)
}
Expand Down
1 change: 1 addition & 0 deletions assets/js/Services/Ufixit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 5 additions & 5 deletions src/Services/AsyncEqualAccessReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
}

Expand Down
12 changes: 5 additions & 7 deletions src/Services/EqualAccessService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 06e22c5

Please sign in to comment.