Skip to content

Commit

Permalink
Merge pull request #1 from domapic/release-1.0.0-beta.1
Browse files Browse the repository at this point in the history
Release 1.0.0 beta.1
  • Loading branch information
javierbrea authored Mar 2, 2019
2 parents 3fdd102 + 9c4632b commit 6fe3d38
Show file tree
Hide file tree
Showing 309 changed files with 18,607 additions and 282 deletions.
18 changes: 16 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const abilityActionSuccess = {
url: "/api/abilities/:id/action",
method: "POST",
response: {
status: 201
}
};

module.exports = {
abilityActionSuccess
};
Loading

0 comments on commit 6fe3d38

Please sign in to comment.