Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"moment-duration-format": "^2.3.2",
"moment-timezone": "^0.5.33",
"mui-color-input": "^9.0.0",
"openstack-uicore-foundation": "5.0.40",
"openstack-uicore-foundation": "5.0.43",
"p-limit": "^6.1.0",
"path-browserify": "^1.0.1",
"postcss-loader": "^6.2.1",
Expand Down
4 changes: 2 additions & 2 deletions src/actions/__tests__/dropbox-sync-actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import flushPromises from "flush-promises";
import {
getRequest,
putRequest,
postRequest
postRequest,
snackbarErrorHandler
} from "openstack-uicore-foundation/lib/utils/actions";
import { snackbarErrorHandler } from "../base-actions";
import * as DropboxSyncActions from "../dropbox-sync-actions";
import * as methods from "../../utils/methods";
import * as MediaUploadActions from "../media-upload-actions";
Expand Down
4 changes: 2 additions & 2 deletions src/actions/dropbox-sync-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import {
stopLoading,
startLoading,
showSuccessMessage,
authErrorHandler
authErrorHandler,
snackbarErrorHandler
} from "openstack-uicore-foundation/lib/utils/actions";
import { snackbarErrorHandler } from "./base-actions";
import { getAccessTokenSafely, range } from "../utils/methods";
import { MAX_PER_PAGE, TEN, TWO } from "../utils/constants";

Expand Down
12 changes: 5 additions & 7 deletions src/components/forms/badge-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ import T from "i18n-react/dist/i18n-react";
import Swal from "sweetalert2";
import moment from "moment-timezone";
import "awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css";
import {
Dropdown,
SimpleLinkList,
Table,
FreeTextSearch,
DateTimePicker
} from "openstack-uicore-foundation/lib/components";
import Dropdown from "openstack-uicore-foundation/lib/components/inputs/dropdown";
import SimpleLinkList from "openstack-uicore-foundation/lib/components/simple-link-list";
import Table from "openstack-uicore-foundation/lib/components/table";
import FreeTextSearch from "openstack-uicore-foundation/lib/components/free-text-search";
import DateTimePicker from "openstack-uicore-foundation/lib/components/inputs/datetimepicker";
import { epochToMomentTimeZone } from "openstack-uicore-foundation/lib/utils/methods";
import { Pagination } from "react-bootstrap";
import { shallowEqual } from "../../utils/methods";
Expand Down
8 changes: 3 additions & 5 deletions src/components/forms/badge-type-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
import React from "react";
import T from "i18n-react/dist/i18n-react";
import "awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css";
import {
Input,
SimpleLinkList
} from "openstack-uicore-foundation/lib/components";
import Input from "openstack-uicore-foundation/lib/components/inputs/text-input";
import SimpleLinkList from "openstack-uicore-foundation/lib/components/simple-link-list";
import {
isEmpty,
scrollToError,
Expand Down Expand Up @@ -47,7 +45,7 @@ class BadgeTypeForm extends React.Component {
this.handleSubmit = this.handleSubmit.bind(this);
}

componentDidUpdate(prevProps, prevState, snapshot) {
componentDidUpdate(prevProps) {
const state = {};
scrollToError(this.props.errors);

Expand Down
10 changes: 4 additions & 6 deletions src/components/forms/event-category-group-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ import {
queryTracks,
queryGroups
} from "openstack-uicore-foundation/lib/utils/query-actions";
import {
Input,
SimpleLinkList,
Dropdown,
DateTimePicker
} from "openstack-uicore-foundation/lib/components";
import Input from "openstack-uicore-foundation/lib/components/inputs/text-input";
import SimpleLinkList from "openstack-uicore-foundation/lib/components/simple-link-list";
import Dropdown from "openstack-uicore-foundation/lib/components/inputs/dropdown";
import DateTimePicker from "openstack-uicore-foundation/lib/components/inputs/datetimepicker";
import TextEditorV3 from "openstack-uicore-foundation/lib/components/inputs/editor-input-v3";
import Swal from "sweetalert2";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/event-comment-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import React from "react";
import T from "i18n-react/dist/i18n-react";
import "awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css";
import { Input } from "openstack-uicore-foundation/lib/components";
import Input from "openstack-uicore-foundation/lib/components/inputs/text-input";
import {
isEmpty,
scrollToError,
Expand Down
10 changes: 4 additions & 6 deletions src/components/forms/room-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
import React from "react";
import T from "i18n-react/dist/i18n-react";
import "awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css";
import {
Input,
SimpleLinkList,
Dropdown,
UploadInput
} from "openstack-uicore-foundation/lib/components";
import Input from "openstack-uicore-foundation/lib/components/inputs/text-input";
import SimpleLinkList from "openstack-uicore-foundation/lib/components/simple-link-list";
import Dropdown from "openstack-uicore-foundation/lib/components/inputs/dropdown";
import UploadInput from "openstack-uicore-foundation/lib/components/inputs/upload-input";
import TextEditorV3 from "openstack-uicore-foundation/lib/components/inputs/editor-input-v3";
import { isEmpty, scrollToError, shallowEqual } from "../../utils/methods";
import HourIntervalInput from "../inputs/date-interval-input";
Expand Down
44 changes: 17 additions & 27 deletions src/components/forms/schedule-settings-form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,18 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
* */

import React from "react";
import T from "i18n-react/dist/i18n-react";
import "awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css";
import {
Dropdown,
Input,
SimpleLinkList
} from "openstack-uicore-foundation/lib/components";
import {
isEmpty,
scrollToError,
shallowEqual,
hasErrors
} from "../../../utils/methods";
import Dropdown from "openstack-uicore-foundation/lib/components/inputs/dropdown";
import Input from "openstack-uicore-foundation/lib/components/inputs/text-input";
import Switch from "react-switch";
import SortableTable from "openstack-uicore-foundation/lib/components/table-sortable";
import { isEmpty, scrollToError, shallowEqual } from "../../../utils/methods";
import EditLabelSlider from "../../inputs/edit-label-slider";
import PreFilterInput from "./pre-filter-input";
import SortableTable from "openstack-uicore-foundation/lib/components/table-sortable";

class ScheduleSettingsForm extends React.Component {
constructor(props) {
Expand All @@ -40,7 +32,7 @@ class ScheduleSettingsForm extends React.Component {
};
}

componentDidUpdate(prevProps, prevState, snapshot) {
componentDidUpdate(prevProps) {
const state = {};
scrollToError(this.props.errors);

Expand Down Expand Up @@ -70,11 +62,11 @@ class ScheduleSettingsForm extends React.Component {

errors[id] = "";
entity[id] = value;
this.setState({ entity: entity, errors: errors });
this.setState({ entity, errors });
};

updateFilterOrder = (filters, filterId, newOrder) => {
console.log(`updateFilterOrder`, filters, filterId, newOrder);
console.log("updateFilterOrder", filters, filterId, newOrder);
};

onSwitchChange = (id, val) => {
Expand Down Expand Up @@ -136,17 +128,15 @@ class ScheduleSettingsForm extends React.Component {
const columns = [
{
columnKey: "type",
render: (filter) => {
return (
<EditLabelSlider
checked={filter.is_enabled}
id={filter.type}
value={filter.label}
onChange={this.onFilterChange}
disabled={!entity.is_enabled}
/>
);
}
render: (filter) => (
<EditLabelSlider
checked={filter.is_enabled}
id={filter.type}
value={filter.label}
onChange={this.onFilterChange}
disabled={!entity.is_enabled}
/>
)
}
];

Expand Down
27 changes: 12 additions & 15 deletions src/components/forms/tag-group-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
* */

import React from "react";
import T from "i18n-react/dist/i18n-react";
import "awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css";
import { queryTags } from "openstack-uicore-foundation/lib/utils/query-actions";
import {
Input,
SimpleLinkList
} from "openstack-uicore-foundation/lib/components";
import Input from "openstack-uicore-foundation/lib/components/inputs/text-input";
import SimpleLinkList from "openstack-uicore-foundation/lib/components/simple-link-list";
import { isEmpty, scrollToError, shallowEqual } from "../../utils/methods";

class TagGroupForm extends React.Component {
Expand All @@ -36,7 +34,7 @@ class TagGroupForm extends React.Component {
this.handleSubmit = this.handleSubmit.bind(this);
}

componentDidUpdate(prevProps, prevState, snapshot) {
componentDidUpdate(prevProps) {
const state = {};
scrollToError(this.props.errors);

Expand All @@ -55,25 +53,25 @@ class TagGroupForm extends React.Component {
}

handleChange(ev) {
let entity = { ...this.state.entity };
let errors = { ...this.state.errors };
let { value, id } = ev.target;
const entity = { ...this.state.entity };
const errors = { ...this.state.errors };
const { value, id } = ev.target;

errors[id] = "";
entity[id] = value;
this.setState({ entity: entity, errors: errors });
this.setState({ entity, errors });
}

handleSubmit(ev) {
let entity = { ...this.state.entity };
const entity = { ...this.state.entity };

ev.preventDefault();

this.props.onSubmit(entity);
}

hasErrors(field) {
let { errors } = this.state;
const { errors } = this.state;
if (field in errors) {
return errors[field];
}
Expand All @@ -91,13 +89,12 @@ class TagGroupForm extends React.Component {

render() {
const { entity } = this.state;
const { currentSummit } = this.props;

let allowedTagsColumns = [
const allowedTagsColumns = [
{ columnKey: "tag", value: T.translate("edit_tag_group.tag") }
];

let allowedTagsOptions = {
const allowedTagsOptions = {
title: T.translate("edit_tag_group.allowed_tags"),
sortCol: "tag",
valueKey: "id",
Expand Down
2 changes: 1 addition & 1 deletion src/components/upload-dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
Typography
} from "@mui/material";
import PropTypes from "prop-types";
import { UploadInputV3 } from "openstack-uicore-foundation/lib/components";
import UploadInputV3 from "openstack-uicore-foundation/lib/components/inputs/upload-input-v3";
import T from "i18n-react/dist/i18n-react";
import CloseIcon from "@mui/icons-material/Close";
import NoteAddIcon from "@mui/icons-material/NoteAdd";
Expand Down
40 changes: 22 additions & 18 deletions src/pages/companies/components/__tests__/company-dialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,29 @@ jest.mock("openstack-uicore-foundation/lib/utils/query-actions", () => ({
})
}));

jest.mock("openstack-uicore-foundation/lib/components", () => ({
UploadInputV3: ({ id, onUploadComplete, onUploadStart, value }) => (
<div
data-testid={`upload-input-${id}`}
data-logo={value?.[0]?.file_path ?? ""}
>
<button
type="button"
data-testid={`trigger-upload-${id}`}
onClick={() => {
onUploadStart?.();
onUploadComplete({ path: "/uploads/", name: `${id}.png` });
}}
jest.mock(
"openstack-uicore-foundation/lib/components/inputs/upload-input-v3",
() => ({
__esModule: true,
default: ({ id, onUploadComplete, onUploadStart, value }) => (
<div
data-testid={`upload-input-${id}`}
data-logo={value?.[0]?.file_path ?? ""}
>
Upload
</button>
</div>
)
}));
<button
type="button"
data-testid={`trigger-upload-${id}`}
onClick={() => {
onUploadStart?.();
onUploadComplete({ path: "/uploads/", name: `${id}.png` });
}}
>
Upload
</button>
</div>
)
})
);

jest.mock(
"openstack-uicore-foundation/lib/components/mui/formik-inputs/textfield",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/companies/components/company-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
Typography
} from "@mui/material";
import CloseIcon from "@mui/icons-material/Close";
import { UploadInputV3 } from "openstack-uicore-foundation/lib/components";
import UploadInputV3 from "openstack-uicore-foundation/lib/components/inputs/upload-input-v3";
import { getCountryList } from "openstack-uicore-foundation/lib/utils/query-actions";
import Table from "openstack-uicore-foundation/lib/components/mui/table";
import MuiFormikTextField from "openstack-uicore-foundation/lib/components/mui/formik-inputs/textfield";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from "@mui/material";
import CloseIcon from "@mui/icons-material/Close";
import AdditionalInputList from "openstack-uicore-foundation/lib/components/mui/formik-inputs/additional-input-list";
import { MuiFormikUpload } from "openstack-uicore-foundation/lib/components";
import MuiFormikUpload from "openstack-uicore-foundation/lib/components/mui/formik-inputs/upload";
import {
ALLOWED_INVENTORY_IMAGE_FORMATS,
MAX_INVENTORY_IMAGE_UPLOAD_SIZE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import T from "i18n-react";
import * as yup from "yup";
import { FormikProvider, useFormik } from "formik";
import { MuiFormikUpload } from "openstack-uicore-foundation/lib/components";
import MuiFormikUpload from "openstack-uicore-foundation/lib/components/mui/formik-inputs/upload";
import AdditionalInputList from "openstack-uicore-foundation/lib/components/mui/formik-inputs/additional-input-list";
import {
addIssAfterDateFieldValidator,
Expand Down
Loading
Loading