Skip to content

Commit

Permalink
0.7.0 🐩
Browse files Browse the repository at this point in the history
  • Loading branch information
louis amstutz committed Dec 20, 2018
1 parent 9e368c6 commit 3e26803
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 58 deletions.
30 changes: 3 additions & 27 deletions core.js
@@ -1,28 +1,4 @@
import {
Feedback
} from './esm/es5/build/bruit-core.entry';

export function send(apiKey, agreement, data, dataFn) {

if (!apiKey) {
console.error('[BRUIT] apiKey must be defined !');
return;
}

if (!data) {
data = [];
}

data.push({
id: 'agreement',
label: 'agreement',
value: agreement || false,
type: 'checkbox'
});

var feedback = new Feedback(apiKey);
return feedback.init().then(() =>
feedback.send(data, undefined, dataFn)
);

export {
BruitCore as Bruit
}
from './esm/es5/build/bruit-core.entry';
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@bruit/component",
"version": "0.6.5",
"version": "0.7.0",
"description": "send your feedbacks with bruit.io",
"keywords": [
"bruit",
Expand Down
21 changes: 21 additions & 0 deletions src/components/bruit-core/bruit-core.tsx
Expand Up @@ -185,6 +185,27 @@ export class BruitCore {
});
}

static async send(apiKey, agreement, data, dataFn) {
if (!apiKey) {
console.error('[BRUIT] apiKey must be defined !');
return;
}

if (!data) {
data = [];
}

data.push({
id: 'agreement',
label: 'agreement',
value: agreement || false,
type: 'checkbox'
});

var feedback = new Feedback(apiKey);
return feedback.init().then(() => feedback.send(data, undefined, dataFn));
}

/**
* close the modal and destroy the _currentFeedback
*/
Expand Down
4 changes: 2 additions & 2 deletions src/config/config.ts
@@ -1,3 +1,3 @@
export const ComponentConfig = {
BRUIT_IO_API_URL: 'https://api.bruit.io/feedback'
};
BRUIT_IO_API_URL: "https://api.bruit.io/feedback"
}
30 changes: 3 additions & 27 deletions src/core.js
@@ -1,28 +1,4 @@
import {
Feedback
} from './esm/es5/build/bruit-core.entry';

export function send(apiKey, agreement, data, dataFn) {

if (!apiKey) {
console.error('[BRUIT] apiKey must be defined !');
return;
}

if (!data) {
data = [];
}

data.push({
id: 'agreement',
label: 'agreement',
value: agreement || false,
type: 'checkbox'
});

var feedback = new Feedback(apiKey);
return feedback.init().then(() =>
feedback.send(data, undefined, dataFn)
);

export {
BruitCore as Bruit
}
from './esm/es5/build/bruit-core.entry';
3 changes: 2 additions & 1 deletion stencil.config.ts
Expand Up @@ -19,5 +19,6 @@ export const config: Config = {
{ src: 'core.js', dest: './../core.js' },
{ src: 'appendCore.js', dest: './../appendCore.js' }
],
plugins: [sass()]
plugins: [sass()],
hashFileNames: false
};

0 comments on commit 3e26803

Please sign in to comment.