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 #348

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/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