forked from RocketChat/Rocket.Chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMPROVE] Administration UI - React and Fuselage components (RocketCh…
- Loading branch information
Showing
170 changed files
with
4,440 additions
and
1,730 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
import '@storybook/addon-actions/register'; | ||
import '@storybook/addon-knobs/register'; | ||
import '@storybook/addon-links/register'; | ||
import '@storybook/addon-viewport/register'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,49 @@ | ||
import { configure } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { withKnobs }from '@storybook/addon-knobs'; | ||
import { MINIMAL_VIEWPORTS, INITIAL_VIEWPORTS } from '@storybook/addon-viewport/dist/defaults'; | ||
import { addDecorator, addParameters, configure } from '@storybook/react'; | ||
import React from 'react'; | ||
|
||
import { ConnectionStatusProvider } from '../client/components/providers/ConnectionStatusProvider.mock'; | ||
import { TranslationProvider } from '../client/components/providers/TranslationProvider.mock'; | ||
|
||
addParameters({ | ||
viewport: { | ||
viewports: { | ||
...MINIMAL_VIEWPORTS, | ||
...INITIAL_VIEWPORTS, | ||
}, | ||
defaultViewport: 'responsive', | ||
}, | ||
}) | ||
|
||
addDecorator(function RocketChatDecorator(fn) { | ||
const linkElement = document.getElementById('theme-styles') || document.createElement('link'); | ||
if (linkElement.id !== 'theme-styles') { | ||
require('../app/theme/client/main.css'); | ||
require('../app/theme/client/vendor/fontello/css/fontello.css'); | ||
require('../client/RocketChat.font.css'); | ||
linkElement.setAttribute('id', 'theme-styles'); | ||
linkElement.setAttribute('rel', 'stylesheet'); | ||
linkElement.setAttribute('href', 'https://open.rocket.chat/theme.css'); | ||
document.head.appendChild(linkElement); | ||
} | ||
|
||
return <ConnectionStatusProvider connected status='connected' reconnect={action('reconnect')}> | ||
<TranslationProvider> | ||
<style>{` | ||
body { | ||
background-color: white; | ||
} | ||
`}</style> | ||
<div dangerouslySetInnerHTML={{ __html: require('!!raw-loader!../private/public/icons.svg').default }} /> | ||
<div className='global-font-family color-primary-font-color'> | ||
{fn()} | ||
</div> | ||
</TranslationProvider> | ||
</ConnectionStatusProvider>; | ||
}); | ||
|
||
addDecorator(withKnobs); | ||
|
||
configure(require.context('../client', true, /\.stories\.js$/), module); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1 @@ | ||
import { action } from '@storybook/addon-actions'; | ||
import '@rocket.chat/icons/dist/font/RocketChat.minimal.css'; | ||
import React from 'react'; | ||
|
||
import '../app/theme/client/main.css'; | ||
import { ConnectionStatusProvider } from '../client/components/providers/ConnectionStatusProvider.mock'; | ||
import { TranslationProvider } from '../client/components/providers/TranslationProvider.mock'; | ||
|
||
export const rocketChatWrapper = (fn) => | ||
<ConnectionStatusProvider connected status='connected' reconnect={action('reconnect')}> | ||
<TranslationProvider> | ||
<style>{` | ||
body { | ||
background-color: white; | ||
} | ||
.global-font-family { | ||
font-family: | ||
-apple-system, | ||
BlinkMacSystemFont, | ||
'Segoe UI', | ||
Roboto, | ||
Oxygen, | ||
Ubuntu, | ||
Cantarell, | ||
'Helvetica Neue', | ||
'Apple Color Emoji', | ||
'Segoe UI Emoji', | ||
'Segoe UI Symbol', | ||
'Meiryo UI', | ||
Arial, | ||
sans-serif; | ||
} | ||
.color-primary-font-color { | ||
color: #444; | ||
} | ||
`}</style> | ||
<div dangerouslySetInnerHTML={{__html: require('!!raw-loader!../private/public/icons.svg').default}} /> | ||
<div className='global-font-family color-primary-font-color'> | ||
{fn()} | ||
</div> | ||
</TranslationProvider> | ||
</ConnectionStatusProvider>; | ||
export const dummyDate = new Date(2015, 4, 19); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
export const Meteor = { | ||
isClient: true, | ||
isServer: false, | ||
_localStorage: window.localStorage, | ||
absoluteUrl: () => {}, | ||
userId: () => {}, | ||
Streamer: () => {}, | ||
startup: () => {}, | ||
methods: () => {}, | ||
call: () => {}, | ||
}; | ||
|
||
Meteor.absoluteUrl.defaultOptions = {}; | ||
|
||
export const Tracker = { | ||
autorun: () => ({ | ||
stop: () => {}, | ||
}), | ||
nonreactive: (fn) => fn(), | ||
Dependency: () => {}, | ||
}; | ||
|
||
export const Accounts = {}; | ||
|
||
export const Mongo = { | ||
Collection: () => ({ | ||
find: () => ({ | ||
observe: () => {}, | ||
fetch: () => [], | ||
}) | ||
}), | ||
}; | ||
|
||
export const ReactiveVar = () => ({ | ||
get: () => {}, | ||
set: () => {}, | ||
}); | ||
|
||
export const ReactiveDict = () => ({ | ||
get: () => {}, | ||
set: () => {}, | ||
all: () => {}, | ||
}); | ||
|
||
export const Template = () => ({ | ||
onCreated: () => {}, | ||
onRendered: () => {}, | ||
onDestroyed: () => {}, | ||
helpers: () => {}, | ||
events: () => {}, | ||
}); | ||
|
||
Template.registerHelper = () => {}; | ||
Template.__checkName = () => {}; | ||
|
||
export const Blaze = { | ||
Template, | ||
registerHelper: () => {}, | ||
}; | ||
|
||
window.Blaze = Blaze; | ||
|
||
export const check = () => {}; | ||
|
||
export const FlowRouter = { | ||
route: () => {} | ||
}; | ||
|
||
export const BlazeLayout = {}; | ||
|
||
export const Session = { | ||
get: () => {}, | ||
set: () => {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,48 @@ | ||
'use strict'; | ||
|
||
module.exports = async ({ config, mode }) => { | ||
const cssRule = config.module.rules.find(({ test }) => test.test('index.css')); | ||
cssRule.use[1].options.url = (url, resourcePath) => { | ||
if (/^(\.\/)?images\//.test(url)) { | ||
return false; | ||
} | ||
const path = require('path'); | ||
|
||
const webpack = require('webpack'); | ||
|
||
return true; | ||
}; | ||
module.exports = async ({ config }) => { | ||
const cssRule = config.module.rules.find(({ test }) => test.test('index.css')); | ||
|
||
cssRule.use[2].options.plugins = [ | ||
require('postcss-custom-properties')({ preserve: true }), | ||
require('postcss-media-minmax')(), | ||
require('postcss-selector-not')(), | ||
require('postcss-nested')(), | ||
require('autoprefixer')(), | ||
require('postcss-url')({ url: ({ absolutePath, relativePath, url }) => { | ||
const absoluteDir = absolutePath.slice(0, -relativePath.length); | ||
const relativeDir = path.relative(absoluteDir, path.resolve(__dirname, '../public')); | ||
const newPath = path.join(relativeDir, url); | ||
return newPath; | ||
} }), | ||
]; | ||
|
||
return config; | ||
config.module.rules.push({ | ||
test: /\.info$/, | ||
type: 'json', | ||
}); | ||
|
||
config.module.rules.push({ | ||
test: /\.html$/, | ||
use: '@settlin/spacebars-loader', | ||
}); | ||
|
||
config.plugins.push(new webpack.NormalModuleReplacementPlugin( | ||
/^meteor/, | ||
require.resolve('./meteor.js'), | ||
)); | ||
|
||
config.plugins.push(new webpack.NormalModuleReplacementPlugin( | ||
/\.\/server\/index.js/, | ||
require.resolve('./empty.js'), | ||
)); | ||
|
||
config.mode = 'development'; | ||
config.optimization.usedExports = true; | ||
|
||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import './modalTemplates/iframeModal.html'; | ||
import './modalTemplates/iframeModal'; | ||
import './marketplace'; | ||
import './apps'; | ||
import './appInstall.html'; | ||
import './appInstall'; | ||
import './appLogs.html'; | ||
import './appLogs'; | ||
import './appManage'; | ||
import './appWhatIsIt.html'; | ||
import './appWhatIsIt'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,3 @@ | ||
import './admin/modalTemplates/iframeModal.html'; | ||
import './admin/modalTemplates/iframeModal'; | ||
import './admin/marketplace'; | ||
import './admin/apps'; | ||
import './admin/appInstall.html'; | ||
import './admin/appInstall'; | ||
import './admin/appLogs.html'; | ||
import './admin/appLogs'; | ||
import './admin/appManage'; | ||
import './admin/appWhatIsIt.html'; | ||
import './admin/appWhatIsIt'; | ||
import './routes'; | ||
|
||
export { Apps } from './orchestrator'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import './permissions.html'; | ||
import './permissions'; | ||
import './permissionsRole.html'; | ||
import './permissionsRole'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import './cloud'; | ||
import './callback'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.