Skip to content

Commit

Permalink
Merge branch 'main' into lifecycle-write
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnei committed Feb 27, 2025
2 parents cd4becf + ef7ca9c commit e876307
Show file tree
Hide file tree
Showing 33 changed files with 182 additions and 215 deletions.
4 changes: 2 additions & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const Header = () => {
}
target="_blank" rel="noreferrer"
>
<span className="fa fa-play-circle" />
<i className="fa fa-play-circle" />
</a>
</Tooltip>
</div>
Expand All @@ -189,7 +189,7 @@ const Header = () => {
<div className="nav-dd">
<Tooltip title={t("STUDIO")}>
<a href={studioURL} target="_blank" rel="noreferrer">
<span className="fa fa-video-camera" />
<i className="fa fa-video-camera" />
</a>
</Tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const TitleSlidePage = <T extends RequiredFormProps>({
{t("CONFIGURATION.THEMES.DETAILS.TITLE.DESCRIPTION")}
</p>
</div>
{/*todo: Notification*/}
<div className="obj">
<header>{t("CONFIGURATION.THEMES.DETAILS.TITLE.ACTIVE")}</header>
<div className="obj-container content-list padded">
Expand Down
1 change: 0 additions & 1 deletion src/components/events/partials/EventActionCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ const EventActionCell = ({
)}

{/* Delete an event */}
{/*TODO: needs to be checked if event is published */}
<ActionCellDelete
editAccessRole={"ROLE_UI_EVENTS_DELETE"}
tooltipText={"EVENTS.EVENTS.TABLE.TOOLTIP.DELETE"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const EventDetailsCommentsTab = ({
const isSavingCommentReply = useAppSelector(state => getIsSavingCommentReply(state));

useEffect(() => {
dispatch(fetchComments(eventId)).then((r: any) => console.info(r));
dispatch(fetchComments(eventId));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ const NewAccessPage = <T extends RequiredFormProps>({
</tr>
)}

{/*Todo: show only if user has role ROLE_UI_SERIES_DETAILS_ACL_EDIT */}
{hasAccess(editAccessRole, user) && (
<tr>
{/*Add additional policy row*/}
Expand Down
2 changes: 1 addition & 1 deletion src/components/events/partials/wizards/NewEventWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ const getInitialValues = (
if (!!uploadAssetOptions) {
initialValues.uploadAssetsTrack = [];
// Sort by displayOrder
uploadAssetOptions = uploadAssetOptions.slice().sort((a: any, b: any) => a.displayOrder - b.displayOrder)
uploadAssetOptions = uploadAssetOptions.slice().sort((a, b) => a.displayOrder - b.displayOrder)
// initial value of upload asset needs to be null, because object (file) is saved there
for (const option of uploadAssetOptions) {
if (option.type === "track") {
Expand Down
6 changes: 3 additions & 3 deletions src/components/shared/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ const Table = ({

useEffect(() => {
// Function for handling clicks outside of an open dropdown menu
const handleClickOutside = (e: any) => {
const handleClickOutside = (e: MouseEvent) => {
if (
e && containerPageSize.current && !containerPageSize.current.contains(e.target)
e && containerPageSize.current && !containerPageSize.current.contains(e.target as Node)
) {
setShowPageSizes(false);
}
Expand Down Expand Up @@ -395,7 +395,7 @@ const getDirectAccessiblePages = (pages: Page[], pagination: Pagination) => {
};

// Apply a column template and render corresponding components
const ColumnTemplate = ({ row, column, templateMap }: {row: Row, column: TableColumn, templateMap: any}) => {
const ColumnTemplate = ({ row, column, templateMap }: {row: Row, column: TableColumn, templateMap: TemplateMap}) => {
if (!column.template) {
return <></>;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/users/partials/UsersActionsCell.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useRef } from "react";
import { useTranslation } from "react-i18next";
import { UserResult, deleteUser } from "../../../slices/userSlice";
import { User, deleteUser } from "../../../slices/userSlice";
import { useAppDispatch } from "../../../store";
import { fetchUserDetails } from "../../../slices/userDetailsSlice";
import { Modal, ModalHandle } from "../../shared/modals/Modal";
Expand All @@ -14,7 +14,7 @@ import { IconButton } from "../../shared/IconButton";
const UsersActionCell = ({
row,
}: {
row: UserResult
row: User
}) => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
Expand Down
4 changes: 2 additions & 2 deletions src/components/users/partials/UsersRolesCell.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { UserResult } from "../../../slices/userSlice";
import { User } from "../../../slices/userSlice";

/**
* This component renders the roles cells of users in the table view
*/
const UsersRolesCell = ({
row
}: {
row: UserResult
row: User
}) => {
const { t } = useTranslation();

Expand Down
2 changes: 1 addition & 1 deletion src/configs/modalConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const initialFormValuesNewSeries: {

breadcrumbs: TobiraPage[],
selectedPage?: TobiraPage,
[key: string]: any, // Metadata fields that are getting added later
[key: string]: unknown, // Metadata fields that are getting added later
} = {
acls: [
{
Expand Down
19 changes: 5 additions & 14 deletions src/configs/sourceConfig.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { MetadataField } from "../slices/eventSlice";

/* additional metadata that user should provide for new events
* UPLOAD, SCHEDULE_SINGLE, SCHEDULE_MULTIPLE signal in which case the additional metadata is required/should be provided
* A metadata field has following keys:
Expand All @@ -7,22 +9,12 @@
* - type: indicates the type of metadata field (see metadata field provided by backend)
* - readOnly: flag indicating if metadata field can be changed
* - required: flag indicating if metadata field is required
* - tabindex: tabindex of the metadata field
*/
type Metadata = {
id: string,
label: string,
value: any,
type: string,
readOnly: boolean,
required: boolean,
tabindex: number,
}

type SourceType = {
UPLOAD?: { metadata: Metadata[] },
SCHEDULE_SINGLE?: { metadata: Metadata[] },
SCHEDULE_MULTIPLE?: { metadata: Metadata[] },
UPLOAD?: { metadata: MetadataField[] },
SCHEDULE_SINGLE?: { metadata: MetadataField[] },
SCHEDULE_MULTIPLE?: { metadata: MetadataField[] },
}

export const sourceMetadata: SourceType = {
Expand All @@ -35,7 +27,6 @@ export const sourceMetadata: SourceType = {
type: "date",
readOnly: false,
required: false,
tabindex: 7,
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { getCurrentLanguageInformation } from "./utils/utils";

// todo: comment persistent stuff in, only out commented because for debugging purposes
// Commenting persistent stuff out can help with debugging
const persistor = persistStore(store);

const theme = createTheme({
Expand Down
6 changes: 3 additions & 3 deletions src/slices/aclDetailsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const initialState: AclDetailsState = {
};

// fetch details about a certain acl from server
export const fetchAclDetails = createAppAsyncThunk('aclDetails/fetchAclDetails', async (aclId: number) => {
export const fetchAclDetails = createAppAsyncThunk('aclDetails/fetchAclDetails', async (aclId: AclDetailsState["id"]) => {
const res = await axios.get(`/admin-ng/acl/${aclId}`);

let aclDetails = res.data;
Expand All @@ -44,8 +44,8 @@ export const fetchAclDetails = createAppAsyncThunk('aclDetails/fetchAclDetails',
let transformedAcls: TransformedAcl[] = [];

// transform policies for further use
// TODO: Investigate why we do this and write down the reason here
// (or simplify the code if we don't actually need to transform)
// We do this in order to prepare the information for the acl tab in the details modals,
// because we render the information differently from how it is usually structured in an ACL
for (let i = 0; acl.ace.length > i; i++) {
if (transformedAcls.find((rule) => rule.role === acl.ace[i].role)) {
for (let j = 0; transformedAcls.length > j; j++) {
Expand Down
Loading

0 comments on commit e876307

Please sign in to comment.