Skip to content

Commit

Permalink
fix(FEC-13517): Wrong and inconsistent order of plugins (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanTGold and JonathanTGold authored Jan 24, 2024
1 parent 48bc076 commit 30a746f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/components/navigation/plugin-button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {h} from 'preact';
import {ui} from '@playkit-js/kaltura-player-js';
import * as styles from './plugin-button.scss';
import {icons} from '../../icons';
import { pluginName } from "../../../navigation-plugin";

const {Tooltip, Icon} = KalturaPlayer.ui.components;
const {withText, Text} = ui.preacti18n;
Expand Down Expand Up @@ -30,7 +31,7 @@ export const PluginButton = withText(translates)(({isActive, setRef, ...otherPro
className={[ui.style.upperBarIcon, styles.pluginButton, isActive ? styles.active : ''].join(' ')}
data-testid={'navigation_pluginButton'}>
<Icon
id="navigation-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 {NavigationPlugin} from './navigation-plugin';
import { NavigationPlugin, pluginName } from "./navigation-plugin";

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

const pluginName: string = 'navigation';
KalturaPlayer.core.registerPlugin(pluginName, NavigationPlugin);
10 changes: 9 additions & 1 deletion src/navigation-plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {icons} from './components/icons';
import {NavigationConfig, PluginStates, ItemTypes, ItemData, CuePoint, HighlightedMap, CuePointsMap} from './types';
import {QuizTitle} from './components/navigation/navigation-item/QuizTitle';

export const pluginName: string = 'navigation';

const {TimedMetadata} = core;
const {SidePanelModes, SidePanelPositions, ReservedPresetNames} = ui;
const liveCuePointTimeThreshold = 20 * 1000; // 20 seconds threshold
Expand Down Expand Up @@ -370,8 +372,14 @@ export class NavigationPlugin extends KalturaPlayer.core.BasePlugin {
onDeactivate: this._deactivatePlugin
}) as number;

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this._navigationIcon = this.upperBarManager!.add({
label: 'Navigation',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
ariaLabel: 'Navigation',
displayName: 'Navigation',
order: 10,
svgIcon: {path: icons.PLUGIN_ICON, viewBox: `0 0 ${icons.BigSize} ${icons.BigSize}`},
onClick: this._handleClickOnPluginIcon as () => void,
component: () => {
Expand Down

0 comments on commit 30a746f

Please sign in to comment.