Skip to content

Commit

Permalink
fix(FEC-13517): Wrong and inconsistent order of plugins (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanTGold and JonathanTGold authored Jan 24, 2024
1 parent b63c10e commit 6be5a59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {TranscriptPlugin} from './transcript-plugin';
import { pluginName, TranscriptPlugin } from "./transcript-plugin";

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

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

KalturaPlayer.core.registerPlugin(pluginName, TranscriptPlugin);
12 changes: 10 additions & 2 deletions src/transcript-plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {Transcript} from './components/transcript';
import {getConfigValue, isBoolean, makePlainText, prepareCuePoint} from './utils';
import {TranscriptConfig, PluginStates, HighlightedMap, CuePointData, ItemTypes, CuePoint} from './types';

export const pluginName: string = 'playkit-js-transcript';

const {SidePanelModes, SidePanelPositions, ReservedPresetNames, ReservedPresetAreas} = ui;
const {withText, Text} = KalturaPlayer.ui.preacti18n;
const {get} = ObjectUtils;
Expand Down Expand Up @@ -267,8 +269,14 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
showTranscript: <Text id="transcript.show_plugin">Show Transcript</Text>,
hideTranscript: <Text id="transcript.hide_plugin">Hide Transcript</Text>
};
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
this._transcriptIcon = this.upperBarManager!.add({
label: 'Transcript',
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
displayName: 'Transcript',
ariaLabel: 'Transcript',
order: 30,
svgIcon: {path: icons.PLUGIN_ICON, viewBox: `0 0 ${icons.BigSize} ${icons.BigSize}`},
onClick: this._handleClickOnPluginIcon as () => void,
component: withText(translates)((props: {showTranscript: string; hideTranscript: string}) => {
Expand All @@ -277,7 +285,7 @@ export class TranscriptPlugin extends KalturaPlayer.core.BasePlugin {
return (
<PluginButton
isActive={isActive}
id="transcript-icon"
id={pluginName}
label={label}
icon={icons.PLUGIN_ICON}
dataTestId="transcript_pluginButton"
Expand Down

0 comments on commit 6be5a59

Please sign in to comment.