Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/2.0.0-RC.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
gallayl committed May 15, 2017
2 parents c355c2d + 5856aa2 commit b70b57f
Show file tree
Hide file tree
Showing 34 changed files with 564 additions and 2,282 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ coverage
documentation
npm-debug.log
debug.log
.vscode
dist
.nyc_output
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug tests",
"runtimeExecutable": "mocha",
"windows": {
"runtimeExecutable": "mocha.cmd"
},
"preLaunchTask": "build",
"runtimeArgs": [
"--debug-brk",
"./dist/test/index.js"
],
"program": "${workspaceRoot}\\test\\index.ts",
"outFiles": [
"${workspaceRoot}\\dist\\**\\*.js"
],
"port": 5858
}
]
}
18 changes: 18 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "npm",
"isShellCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"tasks": [
{
"taskName": "build",
"args": [
"run",
"build"
]
}
]
}
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,35 @@ To install the latest stable version
npm install --save sn-redux
```

Set your Sense/Net portal's url with SetSiteUrl method
Create your sense NET portal Repository to use. You can configure your Store to use this repository, when calling Store.ConfigureStore

```
import { SetSiteUrl } from 'sn-client-js';
```ts
import { Repository } from 'sn-client-js';

SetSiteUrl('https://daily.demo.sensenet.com');
```
let repository = new Repository.SnRepository({
RepositoryUrl: 'http://path-to-your-portal.com',
});

So that you can set the url of your Sense/Net portal that you want to communicate with. To enable your external app to send request against your Sense/Net portal change
your ```Portal.settings```. For further information about cross-origin resource sharing in Sense/Net check [this](http://wiki.sensenet.com/Cross-origin_resource_sharing#Origin_check)
article.
const store = Store.configureStore(
myRootReducer,
myRootEpic, // If not set, the default will be 'Epics.rootEpic'
[middleware1, middleware2], // If not set, only the epicMiddleware will be used
persistedState, // Optional
repository // Optional. If not provided, a Repository with default values will be used
);

Check your Sense/Net portal's web.config and if the ```ODataServiceToken``` is set, use the ```SetServiceToken()``` method to set the same service token on client side.

```
import { SetServiceToken } from 'sn-client-js';

SetServiceToken('myservicetoken');
To enable your external app to send request against your Sense/Net portal change your ```Portal.settings```. For further information about cross-origin resource sharing in Sense/Net check [this](http://wiki.sensenet.com/Cross-origin_resource_sharing#Origin_check) article.

Check your Sense/Net portal's web.config and if the ```ODataServiceToken``` is set, you can pass to your Repository as a config value on client side.

```ts
let repository = new Repository.SnRepository({
RepositoryUrl: 'http://path-to-your-portal.com',
ODataToken: 'MyODataServiceToken'
});
```

## Import
Expand All @@ -94,22 +105,17 @@ store.dispatch(Actions.Delete(123, false));
Building the project, running all the unit tests and the ts linter and get the code coverage report, use:

```
gulp
npm run build
```

## Running tests

To execute all unit tests, use:
To execute all unit tests and generate coverage reports, use:

```
gulp test
npm t
```

## Generatings code coverage report

```
gulp test:coverage
```

## Examples

Expand Down
189 changes: 0 additions & 189 deletions dist/src/Actions.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/src/Actions.js.map

This file was deleted.

Loading

0 comments on commit b70b57f

Please sign in to comment.