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

Release 1.0.0 beta.1 #1

Merged
merged 136 commits into from Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
584ea60
Use forEach instead of map
javierbrea Jan 11, 2019
3d30346
Add unit tests
javierbrea Jan 12, 2019
d14a432
Add acceptance tests
javierbrea Jan 12, 2019
b4e685b
Ignore .narval files
javierbrea Jan 12, 2019
0c72443
Add traces to acceptance tests execution
javierbrea Jan 12, 2019
399c477
Increase log level
javierbrea Jan 12, 2019
813f621
Stop execution if application service fails
javierbrea Jan 12, 2019
7575dba
Bind test directory to application container
javierbrea Jan 12, 2019
ce9e1a3
Fix docker hostname
javierbrea Jan 12, 2019
55fec7e
Add mocks server
javierbrea Jan 12, 2019
4da614e
Remove log level in acceptance tests
javierbrea Jan 12, 2019
0d123f7
Add Router. Define architecture structure. Add nested routes poc
javierbrea Jan 13, 2019
2429f1e
Add route helpers unit tests
javierbrea Jan 13, 2019
7719ab2
Add data sources. Load modules from api
javierbrea Jan 13, 2019
772e520
Code style fix
javierbrea Jan 13, 2019
5f83f33
Add sonar exclusions
Jan 14, 2019
d268d89
Exclude spec files from sonar coverage
Jan 14, 2019
fae44e9
Exclude index from coverage
Jan 14, 2019
77037f0
Exclude index from coverage
Jan 14, 2019
e00c581
Update reactive-data-source. Change application structure and define …
Jan 20, 2019
cb1d9b4
Upgrade reactive-data-source library
javierbrea Jan 21, 2019
eb1c1d9
Add sockets poc
javierbrea Jan 21, 2019
5639aad
Update reactive-data-source. Use type to clean collection in socket e…
javierbrea Jan 22, 2019
8b0bad1
Add semantic basic layout
javierbrea Jan 22, 2019
ff91d63
Add template for login. Add simple layout. Folders refactor
javierbrea Jan 23, 2019
b00b160
Update reactive-data-source
javierbrea Jan 23, 2019
79942c8
Avoid inline styles
javierbrea Jan 23, 2019
88ff578
Config dataSources from app. Create first helper
javierbrea Jan 23, 2019
812298c
Create socket class. Init socket from app
javierbrea Jan 23, 2019
7068132
Update reactive-data-source
javierbrea Jan 24, 2019
380cd81
Connect module to services data-source. Module interface
javierbrea Jan 24, 2019
c4dc0e8
Add user and help menu layouts
javierbrea Jan 24, 2019
3072106
Add about menu. Use context for assets base path
javierbrea Jan 25, 2019
852aeb0
Menu sections added
javierbrea Jan 26, 2019
66e1f81
Refactor components structure for better reusability. Fix layout styl…
javierbrea Jan 27, 2019
460ae98
Add back button interaction. Disable back button depending of history…
javierbrea Jan 27, 2019
6b51557
Optimize context definition to avoid re-renders
javierbrea Jan 27, 2019
50bbca1
Add menu interactions. Add hover effects
javierbrea Jan 27, 2019
8a843e1
Hide sidebar on any click
javierbrea Jan 27, 2019
c1e55d7
Move datasources setups to data-sources folder. Receive data-sources …
javierbrea Jan 30, 2019
1b3f839
Remove old socket setup
javierbrea Jan 30, 2019
32118ac
Rename context folder to contexts
javierbrea Jan 30, 2019
9218df6
Accept any type of properties in data-source-connect
javierbrea Jan 30, 2019
80195c4
Add redirect to login
javierbrea Jan 30, 2019
6d8ccaf
Save refresh token in local storage after login
javierbrea Jan 30, 2019
1db105d
Add api key login
javierbrea Jan 30, 2019
9105c7f
Set headers from login module, using dataSources setup helpers. Expos…
javierbrea Jan 31, 2019
34e958f
Split login component
javierbrea Jan 31, 2019
ec2add3
Add login inputs interaction
javierbrea Jan 31, 2019
a1b3400
Delete apiKey on authentication error
javierbrea Jan 31, 2019
e308089
Add logout. Load user avatar from gravatar
javierbrea Jan 31, 2019
83be53a
Use Selector to load user avatar
javierbrea Feb 1, 2019
6f9c90b
Disable login buttons depending of form state. Disable settings menu …
javierbrea Feb 2, 2019
8e555ac
Handle back button in module redux state, not in context
javierbrea Feb 2, 2019
5b3942e
Fix lint. Add prop-types
javierbrea Feb 2, 2019
266ec1f
Fix unit tests
javierbrea Feb 2, 2019
d8bd013
Increase acceptance tests timeout
javierbrea Feb 2, 2019
aa14bf3
Refactor main layout
javierbrea Feb 2, 2019
64befc5
Fix simple layout header width
javierbrea Feb 2, 2019
db9d33b
Fix lint
javierbrea Feb 2, 2019
3f4f028
Add content container. Add content filter and submenu layout
javierbrea Feb 2, 2019
1d3017a
Add responsive to search and submenu in content container
javierbrea Feb 3, 2019
7f6b8ac
Add search and filter interactions
javierbrea Feb 3, 2019
66b143e
Add plugins section
javierbrea Feb 3, 2019
03cd780
Add item info component
javierbrea Feb 5, 2019
ba16395
Add module info and abilities
javierbrea Feb 5, 2019
a1db4cc
Add about section
javierbrea Feb 6, 2019
698ac8a
Add configuration section
javierbrea Feb 6, 2019
1d9c9bc
Add activity section
javierbrea Feb 6, 2019
c3577f0
Add activity section
javierbrea Feb 6, 2019
f268bad
Add users list
javierbrea Feb 7, 2019
efa306d
Add avatars to all users collection. Draw avatars in users table
javierbrea Feb 9, 2019
3ba0bca
Create users list togglable component. Extract representation from mo…
javierbrea Feb 9, 2019
117d2af
Add MemoryStorage to data-source origins. Adding user update form
javierbrea Feb 9, 2019
645786c
Add user form validations
javierbrea Feb 10, 2019
aca7b0a
Add user modification action to user form
javierbrea Feb 10, 2019
c736e6e
Add user creation
javierbrea Feb 10, 2019
b365c46
Validate that email is not repeated
javierbrea Feb 10, 2019
c247980
Use light collection for validations. Remove consoles. Fix email regex
javierbrea Feb 10, 2019
e044412
Fix user validation
javierbrea Feb 10, 2019
12162bb
Add user deletion
javierbrea Feb 12, 2019
a277b63
Add account section
javierbrea Feb 12, 2019
f5b7046
Avoid load of all avatars in users list. Now load only visible users
javierbrea Feb 13, 2019
b307389
Do not logout user when receives a error not related to authentication
javierbrea Feb 13, 2019
cd98b11
Do redirect to login when error is authentication error
javierbrea Feb 13, 2019
3bc530d
Revert deleting state when an error happens deleting
javierbrea Feb 13, 2019
a7c36aa
Avoid loading data of user being deleted in update user view
javierbrea Feb 13, 2019
ed5b6b0
Update reactive-data-source. Add auto configuration to data-layer
javierbrea Feb 15, 2019
c252053
Fix lint
javierbrea Feb 15, 2019
81dec68
Move menu modules to an unique module
javierbrea Feb 16, 2019
2f65195
Move components only used by an specific module inside it
javierbrea Feb 16, 2019
359bff0
Refactor modules to give an standard structure
javierbrea Feb 16, 2019
688361b
Reorganize data-layer
javierbrea Feb 16, 2019
8f0eda2
Add abilities section. Add ability card draft
javierbrea Feb 16, 2019
e7291ab
Add ability information
javierbrea Feb 17, 2019
91c437c
Add module name to ability card
javierbrea Feb 17, 2019
6666ef6
Add mocks. Connect ability-card with ability state data
javierbrea Feb 17, 2019
8358057
Display different states and actions depending of ability type
javierbrea Feb 17, 2019
bb4f3cf
Add ability data validations
javierbrea Feb 18, 2019
a3ee41c
Add ability data validations
javierbrea Feb 19, 2019
102f3d9
Send ability actions
javierbrea Feb 19, 2019
b4f83de
Show ability action loadings and error states. Fix some loading and e…
javierbrea Feb 20, 2019
3bdfa0b
Fix container without background padding
javierbrea Feb 20, 2019
734ae92
Add dashboard. Change list of services
javierbrea Feb 21, 2019
ba97cac
Add breadcrumbs. Add sections icons
javierbrea Feb 23, 2019
e5c5f8c
Add no results cases
javierbrea Feb 23, 2019
58a41ab
Styling details
javierbrea Feb 23, 2019
a095d46
Fix dropdown menus. Now are fully clickable
javierbrea Feb 23, 2019
51c5372
Avoid scroll problems when menu becomes fixed. Fix z-index problems w…
javierbrea Feb 23, 2019
9a5373e
Avoid nested links in ability card
javierbrea Feb 23, 2019
cd54c79
Add ability action validations messages
javierbrea Feb 23, 2019
6d83eef
Deactivate acceptance tests
javierbrea Feb 23, 2019
e6fabf5
Optimize build
javierbrea Feb 23, 2019
8ae48de
Load Semantic from static files. Copy them on build from node_modules…
javierbrea Feb 24, 2019
107434e
Add node util for getting dist absolute path. Change icon for anonymo…
javierbrea Feb 24, 2019
ef7ed43
Add logs infinite scroll pagination
javierbrea Feb 24, 2019
302bcd6
Add pagination to abilities logs
javierbrea Feb 25, 2019
dbbb36c
Fix date-time format in logs. Refresh automatically logs each 10 seconds
javierbrea Feb 25, 2019
b3f6692
Avoid show loadings after first data load in logs
javierbrea Feb 26, 2019
649a6aa
Avoid deleting anonymous user
javierbrea Feb 26, 2019
d378eeb
Avoid deleting anonymous user
javierbrea Feb 26, 2019
2679711
Adding socket auth to client
javierbrea Feb 26, 2019
0bf48bd
Add client socket connection and authentication. Fix paginated list p…
javierbrea Feb 27, 2019
d4d3bcd
Ensure that entire logs are not going to be requested to server
javierbrea Feb 27, 2019
d6e52aa
Load socket io library appending script. Add ability event socket lis…
javierbrea Feb 28, 2019
a3aacd0
Add origins loaded selectors. Try login socket as anonymous user. Lis…
javierbrea Mar 2, 2019
bc14385
Revert port to its original value
javierbrea Mar 2, 2019
6f0522d
Add version to socket.io js file request
javierbrea Mar 2, 2019
0022169
Add documentation
javierbrea Mar 2, 2019
7601640
Remove unused badges
javierbrea Mar 2, 2019
751486b
Merge duplicated css declaration
javierbrea Mar 2, 2019
9c3c9db
Fix sonar smell
javierbrea Mar 2, 2019
b51d5a0
Fix sonar smell
javierbrea Mar 2, 2019
4889baa
Do not execute Sonar on PRs
javierbrea Mar 2, 2019
0173d1f
Remove example from documentation
javierbrea Mar 2, 2019
9c4632b
Handle errors on count logs api
javierbrea Mar 2, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 16 additions & 2 deletions .babelrc
@@ -1,13 +1,27 @@
{
"presets": ["@babel/env", "@babel/preset-react"],
"presets": [
[
"@babel/env",
{
"useBuiltIns": "usage",
"targets": {
"browsers": ["last 2 versions", "safari > 8", "not ie < 11"]
}
}
],
"@babel/preset-react"
],
"plugins": [
"react-hot-loader/babel",
"lodash",
"@babel/plugin-proposal-class-properties",
[
"module-resolver",
{
"root": ["."],
"alias": {
"src": "./src"
"src": "./src",
"reactive-data-source": "./src/libs/reactive-data-source"
}
}
]
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -4,3 +4,5 @@ node_modules
npm-debug.log
/.coverage
/dist
/.narval
webpack-stats.json
38 changes: 38 additions & 0 deletions .jest.config.js
@@ -0,0 +1,38 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html

module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: ["src/**"],
// The directory where Jest should output its coverage files
coverageDirectory: ".coverage",
// An object that configures minimum threshold enforcement for coverage results
coveragePathIgnorePatterns: [
"<rootDir>/src/index.js",
"<rootDir>/src/data-sources/bases"
],

/* coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100
}
}, */
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/mocks/unit/fileMock.js",
"\\.(css|less)$": "<rootDir>/mocks/unit/styleMock.js"
},
setupFiles: [
"<rootDir>/src/app/setup/tests.js"
],
snapshotSerializers: [
"enzyme-to-json/serializer"
]
};
68 changes: 68 additions & 0 deletions .narval.yml
@@ -0,0 +1,68 @@
docker-images:
- name: headless-chrome-image
from: javierbrea/node-headless-chrome:1.0.0
add:
- package.json
- package-lock.json
install: test/commands/install.sh
- name: node-image
from: node:8.11.1
expose:
- 3000
- 3100
add:
- package.json
- package-lock.json
install: test/commands/install.sh
docker-containers:
- name: application-container
build: node-image
bind:
- dist
- test
- name: mocks-container
build: node-image
bind:
- dist
- test
- mocks
- name: test-container
build: headless-chrome-image
bind:
- test
standard:
directories:
- "avoid-standard/**/*.js"
suites:
acceptance:
- name: app
describe: Application acceptance tests
before:
docker:
down-volumes: true
services:
- name: mocks
abort-on-error: true
docker:
container: mocks-container
command: test/commands/start-mocks.sh
local:
command: test/commands/start-mocks.sh
- name: application
abort-on-error: true
docker:
container: application-container
command: test/commands/start-app.sh
wait-on: tcp:mocks-container:3100
local:
command: test/commands/start-app.sh
wait-on: tcp:localhost:3100
test:
specs: test/specs
docker:
container: test-container
wait-on: tcp:application-container:3000
local:
wait-on: tcp:localhost:3000
coverage:
enabled: false
21 changes: 18 additions & 3 deletions .travis.yml
@@ -1,8 +1,22 @@
sudo: required

env:
- DOCKER_COMPOSE_VERSION=1.19.0

language: node_js

node_js:
- "10.15.0"

services:
- docker

before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin

cache:
directories:
- "node_modules"
Expand All @@ -18,7 +32,8 @@ addons:

script:
- npm run lint
# - npm run test
- npm run test-ci
- npm run build
# - npm run coveralls
- sonar-scanner
# - npm run test-acceptance
- npm run coveralls
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sonar-scanner; fi'
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -10,6 +10,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
### Removed

## [1.0.0-alpha.1] - 2019-??-??
## [1.0.0-alpha.1] - 2019-03-02
### Added
- First pre-release
41 changes: 40 additions & 1 deletion README.md
@@ -1,3 +1,42 @@
![Domapic Controller UI][domapic-base-logo-image]

# Domapic Controller UI

> Web user interface for Domapic Controller
Web user interface for Domapic Controller.

[![Build status][travisci-image]][travisci-url] <!-- [![Coverage Status][coveralls-image]][coveralls-url] [![Quality Gate][quality-gate-image]][quality-gate-url] --> [![Last commit][last-commit-image]][last-commit-url] <!-- [![Last release][release-image]][release-url] -->

[![NPM downloads][npm-downloads-image]][npm-downloads-url] [![Website][website-image]][website-url] [![License][license-image]][license-url]

## Introduction

This package contains the web user interface for Domapic Controller.

Domapic Controller includes it as a dependency, and it is started automatically among with the Controller API.

## Usage

* `getAbsoluteDistPath` Returns the absolute path of the "dist" folder, which contains all static assets ready to be served.


[domapic-base-logo-image]: http://domapic.com/assets/domapic-logo.png

[coveralls-image]: https://coveralls.io/repos/github/domapic/domapic-controller-ui/badge.svg
[coveralls-url]: https://coveralls.io/github/domapic/domapic-controller-ui
[travisci-image]: https://travis-ci.org/domapic/domapic-controller-ui.svg?branch=master
[travisci-url]: https://travis-ci.org/domapic/domapic-controller-ui
[last-commit-image]: https://img.shields.io/github/last-commit/domapic/domapic-controller-ui.svg
[last-commit-url]: https://github.com/domapic/domapic-controller-ui/commits
[license-image]: https://img.shields.io/npm/l/domapic-controller-ui.svg
[license-url]: https://github.com/domapic/domapic-controller-ui/blob/master/LICENSE
[npm-downloads-image]: https://img.shields.io/npm/dm/domapic-controller-ui.svg
[npm-downloads-url]: https://www.npmjs.com/package/domapic-controller-ui
[npm-dependencies-image]: https://img.shields.io/david/domapic/domapic-controller-ui.svg
[npm-dependencies-url]: https://david-dm.org/domapic/domapic-controller-ui
[quality-gate-image]: https://sonarcloud.io/api/project_badges/measure?project=domapic-controller-ui&metric=alert_status
[quality-gate-url]: https://sonarcloud.io/dashboard?id=domapic-controller-ui
[release-image]: https://img.shields.io/github/release-date/domapic/domapic-controller-ui.svg
[release-url]: https://github.com/domapic/domapic-controller-ui/releases

[website-image]: https://img.shields.io/website-up-down-green-red/http/domapic.com.svg?label=domapic.com
[website-url]: http://domapic.com/
6 changes: 5 additions & 1 deletion config/base/config.js
@@ -1,5 +1,9 @@
const packageInfo = require("../../package.json");

module.exports = {
VERSION: packageInfo.version
VERSION: packageInfo.version,
SEMANTIC_VERSION: packageInfo.devDependencies["semantic-ui-css"],
SOCKET_IO_VERSION: packageInfo.devDependencies["socket.io"],
STATICS_ROUTE: "/",
BASE_ROUTE: "/"
};
6 changes: 5 additions & 1 deletion config/development/config.js
@@ -1 +1,5 @@
module.exports = {};
module.exports = {
BASE_API: "http://localhost:3100/api",
BASE_SOCKET: "http://localhost:3100"
//BASE_API: "https://192.168.1.120:3000/api"
};
2 changes: 1 addition & 1 deletion config/index.js
Expand Up @@ -3,7 +3,7 @@ const baseConfig = require("./base/config");
const parseForWebpackDefinePlugin = envVars => {
const finalConfig = {};

Object.keys(envVars).map(envVarKey => {
Object.keys(envVars).forEach(envVarKey => {
finalConfig[`process.env.${envVarKey}`] = JSON.stringify(envVars[envVarKey]);
});
return finalConfig;
Expand Down
9 changes: 9 additions & 0 deletions index.js
@@ -0,0 +1,9 @@
"use strict";

const path = require("path");

const getAbsoluteDistPath = () => path.resolve(__dirname, "dist");

module.exports = {
getAbsoluteDistPath
}
47 changes: 47 additions & 0 deletions mocks/features/base.js
@@ -0,0 +1,47 @@
const { Feature } = require("../server");

const { getAboutSuccess } = require("./fixtures/about/get");
const { createAccessTokenSuccess } = require("./fixtures/auth/jwt/post");
const {
getModulesSuccess,
getModule1Success,
getModule2Success,
getServicesSuccess,
getServiceSuccess
} = require("./fixtures/services/get");
const { getUser, getUsers } = require("./fixtures/users/get");
const { getUserMe } = require("./fixtures/users/me/get");
const { getConfig } = require("./fixtures/config/get");
const {
getAbilitiesSuccess,
getAbilitySuccess,
getAbility2Success,
getAbilityState
} = require("./fixtures/abilities/get");
const { abilityActionSuccess } = require("./fixtures/abilities/action/post");
const { getLogsSuccess, countLogsSuccess } = require("./fixtures/logs/get");

const base = new Feature([
getAboutSuccess,
createAccessTokenSuccess,
getModulesSuccess,
getModule1Success,
getModule2Success,
getServicesSuccess,
getServiceSuccess,
getUserMe,
getUsers,
getUser,
getConfig,
getAbilitiesSuccess,
getAbilitySuccess,
getAbility2Success,
getLogsSuccess,
getAbilityState,
abilityActionSuccess,
countLogsSuccess
]);

module.exports = {
base
};
9 changes: 9 additions & 0 deletions mocks/features/errors.js
@@ -0,0 +1,9 @@
const { base } = require("./base");

const { getLogsError } = require("./fixtures/logs/get");

const logsError = base.extend([getLogsError]);

module.exports = {
logsError
};
11 changes: 11 additions & 0 deletions mocks/features/fixtures/abilities/action/post.js
@@ -0,0 +1,11 @@
const abilityActionSuccess = {
url: "/api/abilities/:id/action",
method: "POST",
response: {
status: 201
}
};

module.exports = {
abilityActionSuccess
};