Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #317 from aws-solutions/jimthario-dev
Browse files Browse the repository at this point in the history
Rework from RequireJS modules to native JavaScript modules #267
  • Loading branch information
morjoan authored Mar 22, 2022
2 parents 1efea7b + 51675d7 commit fbd2c2f
Show file tree
Hide file tree
Showing 122 changed files with 10,460 additions and 9,004 deletions.
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Media Services Application Mapper
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License Version 2.0 (the "License"). You may not use this file except
in compliance with the License. A copy of the License is located at http://www.apache.org/licenses/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion deployment/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail
Expand Down
2 changes: 1 addition & 1 deletion deployment/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
chalice
networkx
boto3
botocore
cfn-lint
chalice
crhelper
defusedxml
fuzzywuzzy
Expand Down
3 changes: 1 addition & 2 deletions source/events/cloudwatch_alarm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
This Lambda is responsible for receiving and storing CloudWatch alarm events.
Expand Down Expand Up @@ -38,7 +38,6 @@ def lambda_handler(event, _):

region_alarm_name = f"{region}:{alarm_name}"
state = alarm.state_value
# namespace = alarm.namespace
state_updated = int(alarm.state_updated_timestamp.timestamp())

subscribers = subscribers_to_alarm(region_alarm_name)
Expand Down
19 changes: 7 additions & 12 deletions source/events/media_events.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
This Lambda is responsible for receiving and storing CloudWatch events
Expand Down Expand Up @@ -47,17 +47,13 @@ def lambda_handler(event, _):
# remove arn that is for userIdentity or inputSecurityGroup
# note: can't remove an item from a list that's being iterated over so doing it this way
for arn in original_arns:
if "user" in arn or "role" in arn or "inputSecurityGroup" in arn:
pass
else:
if not ("user" in arn or "role" in arn or "inputSecurityGroup" in arn):
arns.append(arn)
if arns:
event["resource_arn"] = unquote(arns[0])
# for certain events, the ARN is not labeled as an ARN but instead put in the resources list
if not arns and event["resources"]:
if "vod" not in event["resources"][0]:
event["resource_arn"] = event["resources"][0]

if not arns and event["resources"] and "vod" not in event["resources"][0]:
event["resource_arn"] = event["resources"][0]
# handle alerts
if "Alert" in event["detail-type"]:
# medialive alerts
Expand Down Expand Up @@ -110,12 +106,11 @@ def lambda_handler(event, _):
event["resource_arn"] = response["Arn"]
else:
print("Skipping this event. Origin ID not present in the HarvestJob event." + event["type"])
elif event["source"] == "aws.mediastore":
elif event["source"] == "aws.mediastore" and "MediaStore Object State Change" in event["type"]:
# for object state change the resource is the object, not the container
# so the captured arn needs to be fixed
if "MediaStore Object State Change" in event["type"]:
temp_arn = event["resource_arn"].split('/')
event["resource_arn"] = temp_arn[0] + "/" + temp_arn[1]
temp_arn = event["resource_arn"].split('/')
event["resource_arn"] = temp_arn[0] + "/" + temp_arn[1]

# if item has no resource arn, don't save in DB
if "resource_arn" in event:
Expand Down
26 changes: 26 additions & 0 deletions source/html/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"browser": true,
"es2021": true,
"jquery": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {},
"globals": {
"_": true,
"Cookies": true,
"Fuse": true,
"machina": true,
"moment": true,
"objectHash": true,
"renderjson": true,
"SVG": true,
"Tabulator": true,
"URI": true,
"vis": true
}
}
4 changes: 2 additions & 2 deletions source/html/.jshintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"esversion": 8,
"esversion": 11,
"browser": true,
"loopfunc": false,
"loopfunc": true,
"globals": {
"console": true,
"define": true,
Expand Down
12 changes: 8 additions & 4 deletions source/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@
<link rel="stylesheet" href="/node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css" />
<script src="/node_modules/jquery/dist/jquery.min.js"></script>
<script src="/node_modules/jqueryui/jquery-ui.min.js"></script>
<script src="/node_modules/lodash/lodash.min.js"></script>
<script src="/node_modules/vis/dist/vis.min.js"></script>
<script src="/node_modules/tabulator-tables/dist/js/tabulator.min.js"></script>
<script src="/node_modules/tabulator-tables/dist/js/jquery_wrapper.min.js"></script>
<script src="/node_modules/handlebars/dist/handlebars.min.js"></script>
<script src="/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="/node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
<script src="/node_modules/fuse.js/dist/fuse.js"></script>
<script src="/node_modules/svg.js/dist/svg.min.js"></script>
<script src="/node_modules/renderjson/renderjson.js"></script>
<script src="/node_modules/urijs/src/URI.min.js"></script>
<script src="/node_modules/moment/min/moment.min.js"></script>
<script data-main="js/app" src="/node_modules/requirejs/require.js"></script>
<script src="/node_modules/machina/lib/machina.min.js"></script>
<script src="/node_modules/js-cookie/src/js.cookie.js"></script>
<script src="/node_modules/object-hash/dist/object_hash.js"></script>
<script src="js/app/main.js" type="module"></script>

<style>
.borderless td,
.borderless th {
Expand Down Expand Up @@ -213,9 +217,9 @@
class="btn btn-outline-info mx-1 p-1 pt-2 px-2 hidden-compartment" title="Delete Connection"><i
class="material-icons">remove_circle_outline</i></button>
</span>
<span class="form-inline pl-4 my-2 my-lg-0" onsubmit="return false;">
<span class="form-inline pl-4 my-2 my-lg-0" onsubmit="() => { return false; }">
<input class="form-control mx-1" id="search_input" placeholder="Search Terms" title="Search Terms"
onsubmit="return false;">
onsubmit="() => { return false; }">
<a href="#" class="btn btn-outline-info mx-1 p-1 pt-2 px-2" title="Search Now" id="search-now-button">
<i class="material-icons">search</i>
</a>
Expand Down
18 changes: 0 additions & 18 deletions source/html/js/app.js

This file was deleted.

Loading

0 comments on commit fbd2c2f

Please sign in to comment.