Skip to content

Commit

Permalink
Revert "(fix) Fix import map overrides panel (openmrs#523)" (openmrs#541
Browse files Browse the repository at this point in the history
)

This reverts commit c69f1d7. Loading the import map overrides script from a CDN violates dev3's CSP policy leading problems loading the app. So for now, we're shelving this approach and looking for a more viable solution.
  • Loading branch information
denniskigen authored and jnsereko committed Oct 5, 2022
1 parent b8a431f commit 622dd75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useRef, useEffect } from "react";
import styles from "./import-map.styles.css";

export default function ImportMap({ toggleOverridden }: ImportMapProps) {
export default function ImportMap(props: ImportMapProps) {
const importMapListRef = useRef<HTMLElement>(null);

useEffect(() => {
Expand All @@ -16,7 +16,7 @@ export default function ImportMap({ toggleOverridden }: ImportMapProps) {
);

function handleImportMapChange(evt) {
toggleOverridden(importMapOverridden());
props.toggleOverridden(importMapOverridden());
}
}, [importMapListRef.current]);

Expand Down
4 changes: 0 additions & 4 deletions packages/shell/esm-app-shell/src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
>
<script type="systemjs-importmap" src="<%= openmrsImportmapUrl %>"></script>
<% } %>
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/import-map-overrides/dist/import-map-overrides.js"
></script>
</head>
<body>
<%= htmlWebpackPlugin.tags.bodyTags %>
Expand Down
1 change: 1 addition & 0 deletions packages/shell/esm-app-shell/src/run.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "import-map-overrides";
import "systemjs/dist/system";
import "systemjs/dist/extras/amd";
import "systemjs/dist/extras/named-exports";
Expand Down

0 comments on commit 622dd75

Please sign in to comment.