Skip to content

Commit

Permalink
R2-2642 Adding comments to JS files
Browse files Browse the repository at this point in the history
  • Loading branch information
aespinoza-quoin committed Oct 19, 2023
1 parent cc8c47f commit 1f712dc
Show file tree
Hide file tree
Showing 2,670 changed files with 5,340 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

const developmentEnv = process.env.NODE_ENV === "development";

module.exports = {
Expand Down
2 changes: 2 additions & 0 deletions .mochaignore.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import requireHacker from "require-hacker";

const extensions = ["css", "gif", "jpg", "svg", "png"];
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

//= require i18n
//= require i18n/translations
2 changes: 2 additions & 0 deletions app/assets/javascripts/translations.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

//= require i18n
//= require i18n/translations
2 changes: 2 additions & 0 deletions app/javascript/app-init.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { setUserToggleOffline } from "./components/connectivity/action-creators";
import { getAppResources, saveNotificationSubscription } from "./components/user/action-creators";
import { getSubscriptionFromDb } from "./libs/service-worker-utils";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-button/component.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { mountedComponent, screen } from "test-utils";

import ActionButton from "./component";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { mountedComponent, screen } from "test-utils";

import DefaultButton from "./component";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

/* eslint-disable import/prefer-default-export */

import { NAME as actionButton } from "../../constants";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as constants from "./constants";

describe("<ActionButton /> - components/default-button/constants", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as index from "./index";

describe("<ActionButton /> - components/default-button/index", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { mountedComponent, screen } from "test-utils";

import IconButton from "./component";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

/* eslint-disable import/prefer-default-export */

import { NAME as actionButton } from "../../constants";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as constants from "./constants";

describe("<ActionButton /> - components/icon-button/constants", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as index from "./index";

describe("<ActionButton /> - components/icon-button/index", () => {
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-button/components/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default as DefaultButton } from "./default-button";
export { default as IconButton } from "./icon-button";
export { default as Link } from "./link";
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as index from "./index";

describe("<ActionButton /> - index", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { mountedComponent, screen } from "test-utils";

import Link from "./component";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

/* eslint-disable import/prefer-default-export */

import { NAME as actionButton } from "../../constants";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as constants from "./constants";

describe("<ActionButton /> - components/icon-button/constants", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as index from "./index";

describe("<ActionButton /> - components/icon-button/index", () => {
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-button/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export const NAME = "ActionButton";
export const ACTION_BUTTON_TYPES = Object.freeze({
default: "default_button",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as constants from "./constants";

describe("<ActionButton /> - constants", () => {
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-button/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
export { ACTION_BUTTON_TYPES } from "./constants";
2 changes: 2 additions & 0 deletions app/javascript/components/action-button/index.unit.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as index from "./index";

describe("<ActionButton /> - components/index", () => {
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-button/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

/* eslint-disable import/prefer-default-export */

import { ACTION_BUTTON_TYPES } from "./constants";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-button/utils.unit.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { DefaultButton, IconButton } from "./components";
import * as helper from "./utils";
import { ACTION_BUTTON_TYPES } from "./constants";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/action-creators.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { SET_DIALOG, SET_DIALOG_PENDING, CLEAR_DIALOG } from "./actions";

export const setDialog = payload => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { SET_DIALOG, SET_DIALOG_PENDING } from "./actions";
import * as actionCreators from "./action-creators";

Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/actions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export const SET_DIALOG = "SET_DIALOG";
export const SET_DIALOG_PENDING = "SET_DIALOG_PENDING";
export const CLEAR_DIALOG = "CLEAR_DIALOG";
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/actions.unit.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as actions from "./actions";

describe("<RecordActions /> - Actions", () => {
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/component.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { mountedComponent, screen } from "test-utils";

import ActionDialog from "./component";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { mountedComponent, screen } from "test-utils";

import TitleWithClose from "./component";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

/* eslint-disable import/prefer-default-export */

export const NAME = "TextWithClose";
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import * as constants from "./constants";

describe("<TextWithClose /> - constants", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import index from "./index";

describe("<TextWithClose /> - index", () => {
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
export { selectDialog, selectDialogPending } from "./selectors";
export { default as reducer } from "./reducer";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/namespace.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export default "dialogs";
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/reducer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { fromJS } from "immutable";

import { Actions } from "../user";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/reducer.unit.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { fromJS } from "immutable";

import reducer from "./reducer";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/selectors.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { fromJS } from "immutable";

export const selectDialog = state => state.getIn(["ui", "dialogs"], fromJS({}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { fromJS } from "immutable";

import { selectDialog, selectDialogPending } from "./selectors";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/action-dialog/use-dialog.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { useCallback } from "react";
import { useDispatch } from "react-redux";
import { fromJS } from "immutable";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/action-creators.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

/* eslint-disable import/prefer-default-export */
import { RECORD_PATH } from "../../config";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { RECORD_PATH } from "../../config";

import * as actionCreators from "./action-creators";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/actions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { namespaceActions } from "../../libs";

import NAMESPACE from "./namespace";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/component.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { mountedComponent, userEvent, screen } from "test-utils";

import { ACCEPTED, REJECTED } from "../../config";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

describe("<ActivityLog />/components/<ActivityItem />", () => {
it.todo("TODO: Add component unit test");
});
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/components/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

/* eslint-disable import/prefer-default-export */
export { default as ActivityItem } from "./activity-item";
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export const COLUMN_NAMES = Object.freeze([
"type",
"record_type",
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
export { default as reducer } from "./reducer";
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/namespace.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export default "activity_logs";
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/reducer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { fromJS } from "immutable";

import { DEFAULT_METADATA } from "../../config";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/reducer.unit.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { fromJS } from "immutable";

import actions from "./actions";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { TYPES } from "../constants";

export default (activity, i18n) => {
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/utils/get-columns.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

/* eslint-disable react/display-name */
import { ActivityItem } from "../components";
import { COLUMN_NAMES } from "../constants";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { CASE, INCIDENT, RECORD_TYPES_PLURAL, TRACING_REQUEST } from "../../../config";

export default record => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { fromJS } from "immutable";

import getRecordPath from "./get-record-path";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/activity-log/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default as getActivityMessage } from "./get-activity-message";
export { default as getColumns } from "./get-columns";
export { default as getRecordPath } from "./get-record-path";
2 changes: 2 additions & 0 deletions app/javascript/components/agency-logo/component.unit.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { fromJS } from "immutable";

import { setupMountedComponent } from "../../test";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/agency-logo/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
2 changes: 2 additions & 0 deletions app/javascript/components/application-routes/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

export { default } from "./component";
2 changes: 2 additions & 0 deletions app/javascript/components/application/action-creators.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { batch } from "react-redux";

import { DB_COLLECTIONS_NAMES } from "../../db";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import sinon from "sinon";
import configureStore from "redux-mock-store";

Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/application/actions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import { namespaceActions } from "../../libs";

import NAMESPACE from "./namespace";
Expand Down
2 changes: 2 additions & 0 deletions app/javascript/components/application/actions.unit.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

import actions from "./actions";

describe("Application - Actions", () => {
Expand Down
Loading

0 comments on commit 1f712dc

Please sign in to comment.