Skip to content

Commit

Permalink
fix(FEC-13517): Wrong and inconsistent order of plugins (#74)
Browse files Browse the repository at this point in the history
Description of the Changes
fix: Wrong and inconsistent order of plugins

fix: Plugins buttons sometimes display with the wrong icon

solves: FEC-13517 FEC-13517

Related Prs
kaltura/playkit-js-ui-managers#51
kaltura/playkit-js-transcript#175
kaltura/playkit-js-share#38
kaltura/playkit-js-playlist#53
kaltura/playkit-js-related#61
kaltura/playkit-js-navigation#348
kaltura/playkit-js-info#90
kaltura/playkit-js-downloads#39
kaltura/playkit-js-qna#334

---------

Co-authored-by: JonathanTGold <jonathan.gold@[email protected]>
  • Loading branch information
JonathanTGold and JonathanTGold authored Jan 24, 2024
1 parent 8225e10 commit a3a6bf8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
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

0 comments on commit a3a6bf8

Please sign in to comment.