Skip to content

Commit

Permalink
[MI-3842]: Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SaurabhSharma-884 committed Dec 15, 2023
1 parent 024e58a commit 99c14ff
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ const App = ({registry, store}:{registry: PluginRegistry, store: Store<GlobalSta
return <></>;
};

export default App;
export default App;
2 changes: 1 addition & 1 deletion webapp/src/containers/Rhs/Rhs.container.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {memo, useCallback, useMemo} from 'react';
import React, {useCallback} from 'react';

import {Spinner} from '@brightscout/mattermost-ui-library';

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/hooks/usePluginApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {ReduxState} from 'types/common/store.d';
import {setApiRequestCompletionState} from 'reducers/apiRequest';
import {msTeamsPluginApi} from 'services';

function usePluginApi() {
function usePluginApi() {
const state = useSelector((reduxState: ReduxState) => reduxState['plugins-com.mattermost.msteams-sync']);
const dispatch = useDispatch();

Expand Down
4 changes: 2 additions & 2 deletions webapp/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {GlobalState} from 'mattermost-redux/types/store';

import reducer from 'reducers';

import EnforceConnectedModal from 'components/enforceConnectedAccountModal';
import EnforceConnectedAccountModal from 'components/enforceConnectedAccountModal';
import MSTeamsAppManifestSetting from 'components/appManifestSetting';
import ListConnectedUsers from 'components/getConnectedUsersSetting';

Expand All @@ -27,7 +27,7 @@ export default class Plugin {
));

// @see https://developers.mattermost.com/extend/plugins/webapp/reference/
this.enforceConnectedAccountId = registry.registerRootComponent(EnforceConnectedModal);
this.enforceConnectedAccountId = registry.registerRootComponent(EnforceConnectedAccountModal);

registry.registerAdminConsoleCustomSetting('appManifestDownload', MSTeamsAppManifestSetting);
registry.registerAdminConsoleCustomSetting('ConnectedUsersReportDownload', ListConnectedUsers);
Expand Down
10 changes: 5 additions & 5 deletions webapp/src/selectors/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {ApiRequestCompletionState, ConnectedState, ReduxState, SnackbarState} from 'types/common/store.d';
import {ApiRequestCompletionState, ConnectedState, PluginReduxState, SnackbarState} from 'types/common/store.d';

export const getApiRequestCompletionState = (state: ReduxState['plugins-com.mattermost.msteams-sync']): ApiRequestCompletionState => state.apiRequestCompletionSlice;
export const getApiRequestCompletionState = (state: PluginReduxState): ApiRequestCompletionState => state.apiRequestCompletionSlice;

export const getConnectedState = (state: ReduxState['plugins-com.mattermost.msteams-sync']): ConnectedState => state.connectedStateSlice;
export const getConnectedState = (state: PluginReduxState): ConnectedState => state.connectedStateSlice;

export const getSnackbarState = (state: ReduxState['plugins-com.mattermost.msteams-sync']): SnackbarState => state.snackbarSlice;
export const getSnackbarState = (state: PluginReduxState): SnackbarState => state.snackbarSlice;

export const getIsRhsLoading = (state: ReduxState['plugins-com.mattermost.msteams-sync']): {isRhsLoading: boolean} => state.rhsLoadingSlice;
export const getIsRhsLoading = (state: PluginReduxState): {isRhsLoading: boolean} => state.rhsLoadingSlice;
2 changes: 1 addition & 1 deletion webapp/src/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
$display-styles: flex, none, block;

// margins, paddings and gaps
$sizes: 0, 4, 6, 8, 10, 12, 16, 18, 24, 20, 30, 32, 40, auto;
$sizes: 0, 4, 6, 8, 10, 12, 16, 18, 24, 20, 30, 32, 40, 62, auto;

// font weights
$font-weights: 300, 400, 500, 600, 700, 800;
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/types/common/store.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {DialogProps} from '@brightscout/mattermost-ui-library';
import {SnackbarColor} from 'components/Snackbar/Snackbar.types';
import {IconName} from 'components';

type PluginState = RootState<{ [x: string]: QueryDefinition<void, BaseQueryFn<string | FetchArgs, unknown, FetchBaseQueryError, {}, FetchBaseQueryMeta>, never, void, 'msTeamsPluginApi'>; }, never, 'msTeamsPluginApi'>
type PluginReduxState = RootState<{ [x: string]: QueryDefinition<void, BaseQueryFn<string | FetchArgs, unknown, FetchBaseQueryError, {}, FetchBaseQueryMeta>, never, void, 'msTeamsPluginApi'>; }, never, 'msTeamsPluginApi'>

interface ReduxState extends GlobalState {
'plugins-com.mattermost.msteams-sync': PluginState
'plugins-com.mattermost.msteams-sync': PluginReduxState
}

type ApiRequestCompletionState = {
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/types/mattermost-webapp/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

interface PluginRegistry {
registerPostTypeComponent(typeName: string, component: React.ElementType)
registerRootComponent(component: React.ElementType)
registerAdminConsoleCustomSetting(key: string, component: React.ElementType)
registerRightHandSidebarComponent(component:null | (React.ReactNode), title: string | JSX.Element)
registerRightHandSidebarComponent(component:null | (() => JSX.Element), title: string | JSX.Element)
registerChannelHeaderButtonAction(icon: JSX.Element | null, action: () => void, dropdownText: string | null, tooltipText: string | null)
registerAppBarComponent(iconUrl: string, action: () => void, tooltipText: string)
registerReducer(reducer)
Expand Down

0 comments on commit 99c14ff

Please sign in to comment.