Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Release: drmaxgit/drmax-lib-js-common-widget (stage->master) DRMAX-4953 #13

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3a7af0b
Added: project init KOSIK-901
Klasna Mar 22, 2019
a3375f6
Fixed: parameters KOSIK-901
Klasna Mar 22, 2019
8746b9f
Merge pull request #1 from drmaxgit/feature/KOSIK-901
Klasna Mar 22, 2019
48ef881
Merge pull request #2 from drmaxgit/feature/KOSIK-901
Klasna Mar 22, 2019
e067cc1
Fixed: export default
Klasna Mar 22, 2019
6d4e48f
Added: logging KOSIK-901
Klasna Mar 25, 2019
5270aae
Fixed: package.json KOSIK-901
Klasna Mar 25, 2019
89318c9
Added: log on success KOSIK-901
Klasna Mar 25, 2019
15497a8
Fixed: main
Klasna Mar 26, 2019
58dc991
Fixed: code review, widget type in log, babel fix KOSIK-901
Klasna Mar 28, 2019
4bdf487
Removed: static KOSIK-901
Klasna Mar 28, 2019
37ab02b
Fixed: code review changes KOSIK-901
Klasna Mar 29, 2019
564879e
Fixed: datalayer KOSIK-901
Klasna Mar 29, 2019
24db977
Changed: static function KOSIK-901
Klasna Mar 29, 2019
fcedc08
Merge pull request #3 from drmaxgit/feature/KOSIK-901_logging
Klasna Mar 29, 2019
f636e2c
Fixed: wrapper class KOSIK-901
Klasna Mar 29, 2019
e1294bb
Fixed: logging KOSIK-901
Klasna Mar 29, 2019
0a0c42e
Merge pull request #4 from drmaxgit/feature/KOSIK-901_logging_fix
Klasna Mar 31, 2019
278bfbf
Fixed: variable position KOSIK-901
Klasna Apr 1, 2019
474b3d1
Fixed: init logni if needed KOSIK-901
Klasna Apr 1, 2019
3b9cfe1
Fixed: definition KOSIK-901
Klasna Apr 1, 2019
4998f67
Added: constans for logni, apotheka url, placeholder image url KOSIK-901
Klasna Apr 5, 2019
eab556c
Added: constants for eshop, checkout KOSIK-901
Klasna Apr 5, 2019
116702e
Fixed: eshop url KOSIK-901
Klasna Apr 5, 2019
07e6535
Added: default constants KOSIK-901
Klasna Apr 8, 2019
a5b9174
Fixed: getMeta import KOSIK-901
Klasna Apr 8, 2019
4d1d502
Fixed: constant KOSIK-901
Klasna Apr 8, 2019
7b86b97
Fixed: meta constants KOSIK-901
Klasna Apr 8, 2019
9ba1521
Merge pull request #5 from drmaxgit/feature/KOSIK-901_meta_constants_fix
Klasna Apr 8, 2019
6a7130b
Fixed: get meta constants KOSIK-901
Klasna Apr 9, 2019
d744899
Fixed: new line KOSIK-901
Klasna Apr 9, 2019
04350eb
Merge pull request #6 from drmaxgit/feature/KOSIK-901_get_meta_change
Klasna Apr 9, 2019
40db6c1
Fixed: meta variables naming KOSIK-901
Klasna Apr 11, 2019
0b4a4c2
Merge pull request #7 from drmaxgit/feature/KOSIK-901_meta_variables
Klasna Apr 11, 2019
a6e66a7
Added: megamenu url meta
Klasna Apr 17, 2019
f3815c8
Fixed: root element id
Klasna Apr 23, 2019
e8f0ea7
Added: Apotheka meta tag. DRMAX-4655
Apr 24, 2019
a058c86
Merge pull request #8 from drmaxgit/feature/DRMAX-4655_add_apotheka_m…
marekulicny Apr 24, 2019
994c7af
Fixed: image DRMAX-4667
Klasna Apr 30, 2019
7524d1a
Merge pull request #9 from drmaxgit/feature/DRMAX-4667
Klasna Apr 30, 2019
2b5b04d
Added: Add webstorm to gitignore. DRMAX-4920
May 31, 2019
6aa5eb0
Fixed: Classes should start with capital letter. DRMAX-4920
May 31, 2019
c3ed8e5
Added: Load logni config from window.[setting] variables. DRMAX-4920
May 31, 2019
4fd3395
Added: Info about basic usage of common widget. DRMAX-4920
May 31, 2019
2f3b090
Changed: Switch fallback contants to live environment. DRMAX-4920
Jun 3, 2019
8542e91
Changed: Use master version of logni.js. DRMAX-4920
Jun 3, 2019
36d71c4
Changed: Default version of logni. DRMAX-4920
Jun 3, 2019
cce75dd
Merge pull request #10 from drmaxgit/feature/DRMAX-4920_logni_configu…
marekulicny Jun 4, 2019
f8138c5
Changed: Adjust default parameters. DRMAX-4945
Jun 4, 2019
5f25ac4
Merge pull request #11 from drmaxgit/feature/DRMAX-4945_adjust_constants
marekulicny Jun 4, 2019
847f7e2
Changed: format code, plus added sso, checkout, search, sukl widget D…
erikni Jun 5, 2019
ad0ef89
Merge pull request #12 from drmaxgit/develop
marekulicny Jun 6, 2019
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
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["env", "flow"],
"plugins": ["transform-class-properties"]
}
11 changes: 11 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[ignore]

[include]

[libs]

[lints]

[options]

[strict]
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Classic
node_modules
dist
build

# Webstorm
.idea/
69 changes: 67 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,67 @@
# drmax-lib-js-common-widget
Common widget
# DRMAX Common widget

Base upon which other widgets are built.

It provides:

* mounting template to specified root element
* helper for getting info from meta tags
* LOGni wrapper that prepends specified widget type

## Usage

### Package

In your `package.json`:

```
"devDependencies": {
"drmax-common-widget": "github:drmaxgit/drmax-lib-js-common-widget#develop",
}
```

### Code

Use helper for meta tags:

```
export class MyWidget {
constructor () {
// Get <meta> tag values
const metaTags = CommonWidget.getMetaConstants()
const { myMetaTagValue } = metaTags

// Define template
this.htmlTemplate = `<div>Simple template with my value ${myMetaTagValue}</div>`

// Create widget
this.commonWidget = new CommonWidget('my-widget-root-id', this.htmlTemplate, 'my-widget-type')

// Use LOGni
this.logniWrapper = this.commonWidget.getLogniWrapper()
this.logniWrapper.info('My Widget is READY')
}
}
```

## Usage of LOGni

Place following code in your HTML where widgets will be present:

```
<!-- LOGni -->
<script>
window.logniMask = '__LOGNI_MASK__'
window.logniLogUrl = '__URL_LOGNILOG__'
window.logniStdErr = '__LOGNI_STDERR__'
window.logniRelease = '__VERSION__'
window.logniEnvironment = '__ENV__'
window.logniName = 'drmax-cz'
</script>
```

In case LOGni is not initialized yet, widgets will init LOGni
with this config.

In case when even no config is present, widget will use
hardcoded fallback config (basically develop environment).
19 changes: 19 additions & 0 deletions etc/config/webpack.config-develop.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const merge = require('webpack-merge');
const common = require('./webpack.config.js');
const HTMLWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack')

module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
contentBase: './dist',
hot: true
},
plugins: [
new HTMLWebpackPlugin({
template: 'www/index.html'
}),
new webpack.HotModuleReplacementPlugin(),
]
});
20 changes: 20 additions & 0 deletions etc/config/webpack.config-live.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const merge = require('webpack-merge');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const common = require('./webpack.common.js');
const webpack = require('webpack')

module.exports = merge(common, {
mode: 'production',
plugins: [
new UglifyJSPlugin()
],
devtool: 'source-map',
plugins: [
new UglifyJSPlugin({
sourceMap: true
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
});
21 changes: 21 additions & 0 deletions etc/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const path = require('path');
const webpack = require('webpack');
const HTMLWebpackPlugin = require('html-webpack-plugin');
const uglifyJsPlugin = require('uglifyjs-webpack-plugin');

module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'common-widget.bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader']
}
]
}
};
Loading