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

chore: Moved styles inline for components in client package. #3598

Merged
merged 27 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
58547e6
Renamed components, hooks, Onboarding only
GeoffCoxMSFT Jun 29, 2020
d4186ae
Reverting changed from yar build
GeoffCoxMSFT Jun 29, 2020
6bfc1b7
Renamed components, hooks, Onboarding only
GeoffCoxMSFT Jun 29, 2020
f789a8f
Reverting changed from yar build
GeoffCoxMSFT Jun 29, 2020
ea3afe9
Merge branch 'gcox/index-renames' of https://github.com/microsoft/Bot…
GeoffCoxMSFT Jun 29, 2020
26fa86b
Fixing lint issues
GeoffCoxMSFT Jun 29, 2020
073eaf3
test import fixes
GeoffCoxMSFT Jun 29, 2020
53540da
Have to rename to fix case of file name
GeoffCoxMSFT Jun 29, 2020
6b4e064
Fixing case with another commit.
GeoffCoxMSFT Jun 29, 2020
73ad3e8
Renamed components, hooks, Onboarding only
GeoffCoxMSFT Jun 29, 2020
35492c9
Renamed components, hooks, Onboarding only
GeoffCoxMSFT Jun 29, 2020
be9d2f7
Fixing lint issues
GeoffCoxMSFT Jun 29, 2020
93bc86c
test import fixes
GeoffCoxMSFT Jun 29, 2020
0fa5e0d
Have to rename to fix case of file name
GeoffCoxMSFT Jun 29, 2020
fd3fcb5
Fixing case with another commit.
GeoffCoxMSFT Jun 29, 2020
e7ea01f
Merge branch 'gcox/index-renames' of https://github.com/microsoft/Bot…
GeoffCoxMSFT Jun 30, 2020
31f0f72
Fixing imports
GeoffCoxMSFT Jun 30, 2020
17508c9
Merge branch 'master' into gcox/index-renames
GeoffCoxMSFT Jun 30, 2020
033ec52
Merge branch 'master' into gcox/index-renames
GeoffCoxMSFT Jun 30, 2020
fa2f6b6
Merge branch 'master' into gcox/index-renames
GeoffCoxMSFT Jul 1, 2020
45c8828
Index file renames Part 2
GeoffCoxMSFT Jul 1, 2020
ede6628
Merge branch 'master' into gcox/index-renames
GeoffCoxMSFT Jul 2, 2020
455dc3b
Merge branch 'master' into gcox/index-renames
GeoffCoxMSFT Jul 7, 2020
9e323cd
Inlined styles in ts
GeoffCoxMSFT Jul 8, 2020
94afe0f
Fixed test mocks
GeoffCoxMSFT Jul 8, 2020
89f0e86
Merge branch 'master' into gcox/index-renames
GeoffCoxMSFT Jul 8, 2020
a6609ec
Merge branch 'master' into gcox/index-renames
GeoffCoxMSFT Jul 8, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from 'react';
import { fireEvent } from '@bfc/test-utils';

import { renderWithStore } from '../../../testUtils';
import { CreateOptions } from '../../../../src/components/CreationFlow/CreateOptions/CreateOptions';
import { CreateOptions } from '../../../../src/components/CreationFlow/CreateOptions';

describe('<CreateOptions/>', () => {
const handleDismissMock = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fireEvent } from '@bfc/test-utils';

import { renderWithStore } from '../../../testUtils';
import { StorageFolder } from '../../../../src/store/types';
import DefineConversation from '../../../../src/components/CreationFlow/DefineConversation/DefineConversation';
import DefineConversation from '../../../../src/components/CreationFlow/DefineConversation';

describe('<DefineConversation/>', () => {
const onCurrentPathUpdateMock = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from 'react';
import { render, fireEvent } from '@bfc/test-utils';

import { StorageFolder } from '../../../../src/store/types';
import { FileSelector } from '../../../../src/components/CreationFlow/LocationBrowser/FileSelector';
import { FileSelector } from '../../../../src/components/CreationFlow/FileSelector';

describe('<FileSelector/>', () => {
const onFileChosen = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from 'react';
import { fireEvent } from '@bfc/test-utils';

import { StorageFolder } from '../../../../src/store/types';
import { LocationSelectContent } from '../../../../src/components/CreationFlow/LocationBrowser/LocationSelectContent';
import { LocationSelectContent } from '../../../../src/components/CreationFlow/LocationSelectContent';
import { renderWithStore } from '../../../testUtils';
import { CreationFlowStatus } from '../../../../src/constants';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ import { createHistory, createMemorySource, LocationProvider } from '@reach/rout

import { StoreContext } from '../../../src/store';
import CreationFlow from '../../../src/components/CreationFlow/CreationFlow';
import { DialogWrapper } from '../../../src/components/DialogWrapper';
import { CreationFlowStatus } from '../../../src/constants';

jest.mock('../../../src/components/DialogWrapper/DialogWrapper', () => {
return {
DialogWrapper: jest.fn((props) => {
return props.children;
}),
};
});
jest.mock('../../../src/components/DialogWrapper');

describe('<CreationFlow/>', () => {
let storeContext, saveTemplateMock, locationMock, createProjectMock;
Expand All @@ -36,6 +31,10 @@ describe('<CreationFlow/>', () => {
}

beforeEach(() => {
(DialogWrapper as jest.Mock).mockImplementation((props) => {
return props.children;
});

saveTemplateMock = jest.fn();
locationMock = {};
storeContext = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import React from 'react';
import { render } from '@bfc/test-utils';

import { DialogWrapper } from '../../../src/components/DialogWrapper/DialogWrapper';
import { DialogTypes } from '../../../src/components/DialogWrapper/styles';
import { DialogWrapper, DialogTypes } from '../../../src/components/DialogWrapper';

describe('<DialogWrapper />', () => {
const props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import React from 'react';

import { AppUpdater } from '../../src/components/AppUpdater/AppUpdater';
import { AppUpdater } from '../../src/components/AppUpdater';
import { AppUpdaterStatus } from '../../src/constants';
import { renderWithStore } from '../testUtils';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import * as React from 'react';
import { render } from '@bfc/test-utils';

import '../../src/components/Conversation/Conversation';
import '../../src/components/Conversation';

describe('<Conversation/>', () => {
it('should render the conversation', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import * as React from 'react';
import { render } from '@bfc/test-utils';

import { ErrorBoundary } from '../../src/components/ErrorBoundary/ErrorBoundary';
import { ErrorBoundary } from '../../src/components/ErrorBoundary';

const Store = React.createContext({
actions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import * as React from 'react';
import { render } from '@bfc/test-utils';

import { Header } from '../../src/components/Header/Header';
import { Header } from '../../src/components/Header';

describe('<Header />', () => {
it('should render the header', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { fireEvent, render } from '@bfc/test-utils';

import { RecentBotList } from '../../src/pages/home/RecentBotList';
import { ExampleList } from '../../src/pages/home/ExampleList';
import { ToolBar } from '../../src/components/ToolBar/ToolBar';
import { ToolBar } from '../../src/components/ToolBar';
describe('<Home/>', () => {
it('should dispatch onSelectionChanged event when clicked on a link on <RecentBotList>', () => {
const recentProjects = [
Expand Down
10 changes: 6 additions & 4 deletions Composer/packages/client/__tests__/components/skill.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import * as React from 'react';
import { render, fireEvent, getByLabelText, getByTestId } from '@bfc/test-utils';
import { Skill } from '@bfc/shared';

import httpClient from '../../src//utils/httpUtil';
import Skills from '../../src/pages/skills';
import SkillList from '../../src/pages/skills/skill-list';
import CreateSkillModal from '../../src/components/SkillForm/CreateSkillModal/CreateSkillModal';
import CreateSkillModal from '../../src/components/CreateSkillModal';
import { renderWithStore } from '../testUtils';

jest.mock('../../src/components/SkillForm/CreateSkillModal/validateManifestUrl', () => ({
validateManifestUrl: () => {},
}));
jest.mock('../../src//utils/httpUtil');

const items: Skill[] = [
{
Expand Down Expand Up @@ -81,6 +80,9 @@ describe('<SkillForm />', () => {
const onSubmit = jest.fn((formData) => {
expect(formData.manifestUrl).toBe('http://AwesomeSkill');
});

(httpClient.post as jest.Mock).mockResolvedValue(undefined);

const onDismiss = jest.fn(() => {});
const { getByLabelText, getByText } = render(
<CreateSkillModal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import * as React from 'react';
import { fireEvent, render } from '@bfc/test-utils';

import { ToolBar } from '../../src/components/ToolBar/ToolBar';
import { ToolBar } from '../../src/components/ToolBar';

const toolbarItems = (onClick) => [
{
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/client/__tests__/navItem.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import * as React from 'react';
import { render } from '@bfc/test-utils';

import { NavItem } from '../src/components/NavItem/NavItem';
import { NavItem } from '../src/components/NavItem';
import { StoreProvider } from '../src/store';

describe('<Header />', () => {
Expand Down
2 changes: 1 addition & 1 deletion Composer/packages/client/__tests__/notFound.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from 'react';
import { render } from '@bfc/test-utils';

import { BASEPATH } from '../src/constants';
import { NotFound } from '../src/components/NotFound/NotFound';
import { NotFound } from '../src/components/NotFound';

describe('<NotFound />', () => {
it('should render a not found page', async () => {
Expand Down
10 changes: 5 additions & 5 deletions Composer/packages/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import { FocusZone } from 'office-ui-fabric-react/lib/FocusZone';
import { TooltipHost, DirectionalHint } from 'office-ui-fabric-react/lib/Tooltip';
import formatMessage from 'format-message';

import { Header } from './components/Header/Header';
import { NavItem } from './components/NavItem/NavItem';
import { Header } from './components/Header';
import { NavItem } from './components/NavItem';
import { BASEPATH } from './constants';
import Routes from './router';
import { StoreContext } from './store';
import { main, sideBar, content, divider, globalNav, leftNavBottom, rightPanel, dividerTop } from './styles';
import { resolveToBasePath } from './utils/fileUtil';
import { ErrorBoundary } from './components/ErrorBoundary/ErrorBoundary';
import { RequireAuth } from './components/RequireAuth/RequireAuth';
import { ErrorBoundary } from './components/ErrorBoundary';
import { RequireAuth } from './components/RequireAuth';
import onboardingState from './utils/onboardingStorage';
import { isElectron } from './utils/electronUtil';
import { useLinks } from './utils/hooks';
Expand All @@ -27,7 +27,7 @@ initializeIcons(undefined, { disableWarnings: true });

const Onboarding = React.lazy(() => import('./Onboarding/Onboarding'));
const AppUpdater = React.lazy(() =>
import('./components/AppUpdater/AppUpdater').then((module) => ({ default: module.AppUpdater }))
import('./components/AppUpdater').then((module) => ({ default: module.AppUpdater }))
);

// eslint-disable-next-line react/display-name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,57 @@
// Licensed under the MIT License.

/** @jsx jsx */
import { jsx } from '@emotion/core';
import { jsx, css } from '@emotion/core';
import React, { useContext, useEffect, useMemo, useState, useCallback } from 'react';
import { Dialog, DialogFooter, DialogType } from 'office-ui-fabric-react/lib/Dialog';
import { DefaultButton, PrimaryButton } from 'office-ui-fabric-react/lib/Button';
import { DefaultButton, PrimaryButton, IButtonStyles } from 'office-ui-fabric-react/lib/Button';
import { Icon } from 'office-ui-fabric-react/lib/Icon';
import { ProgressIndicator } from 'office-ui-fabric-react/lib/ProgressIndicator';
import { ChoiceGroup } from 'office-ui-fabric-react/lib/ChoiceGroup';
import formatMessage from 'format-message';
import { IDialogContentStyles, IDialogFooterStyles } from 'office-ui-fabric-react/lib/Dialog';
import { NeutralColors, SharedColors } from '@uifabric/fluent-theme';

import { AppUpdaterStatus } from '../constants';
import { StoreContext } from '../store';

// -------------------- Styles -------------------- //

const optionIcon = (checked) => css`
vertical-align: text-bottom;
font-size: 18px;
margin-right: 10px;
color: ${checked ? SharedColors.cyanBlue10 : NeutralColors.black};
`;

const optionRoot = css`
width: 100%;
height: 100%;
`;

const dialogCopy = css`
margin: 0px;
color: #000;
`;

const dialogContent: Partial<IDialogContentStyles> = {
subText: { color: NeutralColors.black },
header: { paddingBottom: '6px' },
};

import { StoreContext } from '../../store';
import { AppUpdaterStatus } from '../../constants';
const dialogFooter: Partial<IDialogFooterStyles> = {
actions: {
marginTop: '46px',
},
};

import { dialogContent, dialogCopy, dialogFooter, optionRoot, optionIcon, updateAvailableDismissBtn } from './styles';
const updateAvailableDismissBtn: Partial<IButtonStyles> = {
root: {
marginRight: '6px;',
},
};

// -------------------- Helpers -------------------- //

const { ipcRenderer } = window;

Expand All @@ -33,6 +71,8 @@ const downloadOptions = {
installAndUpdate: 'installAndUpdate',
};

// -------------------- AppUpdater -------------------- //

export const AppUpdater: React.FC<{}> = () => {
const {
actions: { setAppUpdateError, setAppUpdateProgress, setAppUpdateShowing, setAppUpdateStatus },
Expand Down
41 changes: 0 additions & 41 deletions Composer/packages/client/src/components/AppUpdater/styles.ts

This file was deleted.

33 changes: 33 additions & 0 deletions Composer/packages/client/src/components/Conversation.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

/** @jsx jsx */
import { jsx, css } from '@emotion/core';

// -------------------- Styles -------------------- //

const container = css`
width: 100%;
background-color: #ffffff;
height: 100%;
overflow: auto;
position: relative;
`;

const top = css`
width: 100%;
height: 10px;
background-color: #efeaf5;
`;

// -------------------- Conversation -------------------- //

const Conversation = (props) => {
return (
<div css={container} {...props}>
{props.children}
</div>
);
};

export { Conversation };

This file was deleted.

18 changes: 0 additions & 18 deletions Composer/packages/client/src/components/Conversation/styles.js

This file was deleted.

Loading