garrensmith commented on a change in pull request #947: WIP: Refactor CORS addon
URL: https://github.com/apache/couchdb-fauxton/pull/947#discussion_r131639945
##########
File path: app/addons/cors/components.js
##########
@@ -10,358 +10,26 @@
// License for the specific language governing permissions and limitations
under
// the License.
-import app from "../../app";
-import FauxtonAPI from "../../core/api";
-import React from "react";
-import Stores from "./stores";
-import Resources from "./resources";
-import Actions from "./actions";
-import ReactComponents from "../components/react-components";
-import FauxtonComponents from "../fauxton/components";
-var LoadLines = ReactComponents.LoadLines;
-var ConfirmationModal = FauxtonComponents.ConfirmationModal;
+import CORSContainer from "./components/CORSContainer";
+import OriginInput from "./components/OriginInput";
+import Origins from "./components/Origins";
+import OriginTable from "./components/OriginTable";
+import OriginRow from "./components/OriginRow";
-var corsStore = Stores.corsStore;
-
-
-var validateOrigin = function (origin) {
- if (!Resources.validateCORSDomain(origin)) {
- FauxtonAPI.addNotification({
- msg: 'Please enter a valid domain, starting with http/https.',
- type: 'error',
- clear: true
- });
-
- return false;
- }
-
- return true;
+export default {
+ CORSContainer: CORSContainer,
Review comment:
This can be rewritten as
```
export default {
CORSContainer,
OriginInput,
...
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services