Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FEC-13517): Wrong and inconsistent order of plugins #74

Merged
merged 3 commits into from
Jan 24, 2024
Merged
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
3 changes: 2 additions & 1 deletion src/components/plugin-button/plugin-button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {h} from 'preact';
import {icons} from '../icons';
import {ui} from '@playkit-js/kaltura-player-js';
import { pluginName } from "../../moderation-plugin";

const {Tooltip, Icon} = KalturaPlayer.ui.components;
const {withText, Text} = KalturaPlayer.ui.preacti18n;
Expand All @@ -19,7 +20,7 @@ export const PluginButton = withText(translates)(({label, setRef}: PluginButtonP
<Tooltip label={label} type="bottom">
<button type="button" aria-label={label} className={ui.style.upperBarIcon} data-testid="moderationPluginButton" ref={setRef}>
<Icon
id="moderation-plugin-button"
id={pluginName}
height={icons.BigSize}
width={icons.BigSize}
viewBox={`0 0 ${icons.BigSize} ${icons.BigSize}`}
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {ModerationPlugin} from './moderation-plugin';
import { ModerationPlugin, pluginName } from "./moderation-plugin";

declare var __VERSION__: string;
declare var __NAME__: string;
Expand All @@ -9,6 +9,5 @@ const NAME = __NAME__;
export {ModerationPlugin as Plugin};
export {VERSION, NAME};

const pluginName: string = 'playkit-js-moderation';

KalturaPlayer.core.registerPlugin(pluginName, ModerationPlugin);
10 changes: 9 additions & 1 deletion src/moderation-plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {ReportLoader, KalturaModerationFlag} from './providers';
import {ErrorIcon} from './components/icons/error-icon';
import {SuccessIcon} from './components/icons/success-icon';
import {ModerationEvent} from './event';

export const pluginName: string = 'playkit-js-moderation';
// @ts-ignore
import {FakeEvent} from '@playkit-js/playkit-js';

Expand Down Expand Up @@ -193,8 +195,14 @@ export class ModerationPlugin extends KalturaPlayer.core.BasePlugin {
return;
}
this.player.ready().then(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this._pluginIcon = this.upperBarManager!.add({
label: 'Moderation',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
displayName: 'Moderation',
ariaLabel: 'Moderation',
order: 90,
component: () => <PluginButton setRef={this._setPluginButtonRef} />,
svgIcon: {path: icons.PLUGIN_ICON, viewBox: `0 0 ${icons.BigSize} ${icons.BigSize}`},
onClick: this._toggleOverlay
Expand Down