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

Commit

Permalink
Upgrade prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathaningram committed Dec 19, 2017
1 parent 3e563b1 commit 8d84826
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 128 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ Learn more about [cloud.gov](https://cloud.gov).

### Backend Server

- `Go` (version 1.9)
* `Go` (version 1.9)

### Front end application

- `Node` (version 6.x.x)
- `React` (version ^15.0.0)
- `Babel` (version ^6.x.x)
- `Karma` (version ^1.4.x)
- `Webpack` (version ^1.x.x)
* `Node` (version 6.x.x)
* `React` (version ^15.0.0)
* `Babel` (version ^6.x.x)
* `Karma` (version ^1.4.x)
* `Webpack` (version ^1.x.x)

## Setup Local Environment

Expand Down Expand Up @@ -65,10 +65,10 @@ EOF

### Create a Client with UAAC

- Make sure [UAAC](https://github.com/cloudfoundry/cf-uaac) is installed.
- Target your UAA server. `uaac target <uaa.your-domain.com>`
- Login with your current UAA account. `uaac token client get <your admin account> -s <your uaa admin password>`
- Create client account:
* Make sure [UAAC](https://github.com/cloudfoundry/cf-uaac) is installed.
* Target your UAA server. `uaac target <uaa.your-domain.com>`
* Login with your current UAA account. `uaac token client get <your admin account> -s <your uaa admin password>`
* Create client account:

```bash
uaac client add <your-client-id> \
Expand All @@ -79,21 +79,21 @@ uaac client add <your-client-id> \
-s <your-client-secret>
```

- Unable to create an account still? Troubleshoot [here](https://docs.cloudfoundry.org/adminguide/uaa-user-management.html#creating-admin-users)
* Unable to create an account still? Troubleshoot [here](https://docs.cloudfoundry.org/adminguide/uaa-user-management.html#creating-admin-users)

### CI

This project uses CircleCI.

- You will need to set up the credentials to deploy to the `dashboard-prod` and `dashboard-stage` spaces.
- In both spaces run: `cf create-service cloud-gov-service-account space-deployer dashboard-deployer`.
- You will get the link for that space's credentials by running `cf service dashboard-deployer`.
- You will need to set these [**secret**](https://circleci.com/docs/1.0/environment-variables/#setting-environment-variables-for-all-commands-without-adding-them-to-git) variables in the [CircleCI UI](https://circleci.com/gh/18F/cg-dashboard/edit#env-vars).
- `CF_USERNAME_PROD_SPACE` - The username for the `dashboard-prod` deployer
- `CF_PASSWORD_PROD_SPACE` - The password for the `dashboard-prod` deployer
- `CF_USERNAME_STAGE_SPACE` - The username for the `dashboard-stage` deployer
- `CF_PASSWORD_STAGE_SPACE` - The password for the `dashboard-stage` deployer
- If you fork this project for your own use, you will need to use the CircleCI CLI UI to set the variables. (If you're forking just to make a pull request, there's no need to do this.)
* You will need to set up the credentials to deploy to the `dashboard-prod` and `dashboard-stage` spaces.
* In both spaces run: `cf create-service cloud-gov-service-account space-deployer dashboard-deployer`.
* You will get the link for that space's credentials by running `cf service dashboard-deployer`.
* You will need to set these [**secret**](https://circleci.com/docs/1.0/environment-variables/#setting-environment-variables-for-all-commands-without-adding-them-to-git) variables in the [CircleCI UI](https://circleci.com/gh/18F/cg-dashboard/edit#env-vars).
* `CF_USERNAME_PROD_SPACE` - The username for the `dashboard-prod` deployer
* `CF_PASSWORD_PROD_SPACE` - The password for the `dashboard-prod` deployer
* `CF_USERNAME_STAGE_SPACE` - The username for the `dashboard-stage` deployer
* `CF_PASSWORD_STAGE_SPACE` - The password for the `dashboard-stage` deployer
* If you fork this project for your own use, you will need to use the CircleCI CLI UI to set the variables. (If you're forking just to make a pull request, there's no need to do this.)

### Optional features

Expand Down
15 changes: 5 additions & 10 deletions devtools/docker-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,14 @@ Examples

* Add dependency: `docker-compose run --rm frontend npm install <dep> --save`
* Frontend unit tests: `docker-compose run --rm frontend npm run test-unit`
* Watch frontend unit tests: `docker-compose run --rm frontend npm run
watch-test-unit`
* Frontend functional tests (w/o visual debugging): `docker-compose run --rm
frontend npm run test-functional`
* Watch frontend unit tests: `docker-compose run --rm frontend npm run watch-test-unit`
* Frontend functional tests (w/o visual debugging): `docker-compose run --rm frontend npm run test-functional`

For more possible commands, refer to the package.json.

##### Visual Debugging

Once the `frontend` service is up and running (via `docker-compose up -d
frontend`), you can use the docker-compose `exec` command to attach to the
Once the `frontend` service is up and running (via `docker-compose up -d frontend`), you can use the docker-compose `exec` command to attach to the
existing container. While viewing the container via the HTML VNC Viewer (refer
to the table above), you will see the container's Chrome browser open and
execute the commands.
Expand All @@ -192,8 +189,7 @@ Format: `docker-compose exec frontend bash -c "<COMMAND>"`

Examples:

* Frontend functional tests: `docker-compose exec frontend bash -c "npm run
test-functional"`
* Frontend functional tests: `docker-compose exec frontend bash -c "npm run test-functional"`

##### Updating the node version.

Expand All @@ -208,8 +204,7 @@ Format: `docker-compose run --rm backend <COMMAND>`

Examples:

* Add dependency: `docker-compose run --rm backend dep ensure -add
github.com/some/repo`
* Add dependency: `docker-compose run --rm backend dep ensure -add github.com/some/repo`
* Run `./codecheck.sh`: `docker-compose run --rm backend ./codecheck.sh`

#### UAA One-Offs
Expand Down
3 changes: 1 addition & 2 deletions devtools/manual-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ proper data. If you've never used environment variables before, you can run the
following: `mkdir ~/.env && cp ./env.sample ~/.env/cg-dashboard`

Then edit the file `~/.env/cg-dashboard` and provide the proper values. When you
want to set all the environment variables, just run `source
~/.env/cg-dashboard`. You'll have to do this every time you open a new shell. If
want to set all the environment variables, just run `source ~/.env/cg-dashboard`. You'll have to do this every time you open a new shell. If
you work at 18F, ask a team member to send you the secret credentials.

* `GOPATH`: The absolute path to your code directory, one level up from the root
Expand Down
8 changes: 2 additions & 6 deletions static_src/actions/user_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,7 @@ const userActions = {
} else {
description =
`An email invite was sent to ${email}. Their account ` +
`has been associated to this ${entity}, and their ${
entity
} roles can ` +
`has been associated to this ${entity}, and their ${entity} roles can ` +
"be controlled below.";
}

Expand Down Expand Up @@ -372,9 +370,7 @@ const userActions = {

if (!user) {
const err = new Error("User was not associated");
const message = `The user ${userGuid} was not associated in ${
entityGuid
}.`;
const message = `The user ${userGuid} was not associated in ${entityGuid}.`;
return Promise.resolve(userActions.userInviteCreateError(err, message));
}

Expand Down
4 changes: 1 addition & 3 deletions static_src/stores/service_instance_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ const getFriendlyError = (error, errorMap) => {
return errorMap[errorCode];
}

return `Error #${
code
}. Please contact cloud.gov support for help troubleshooting this issue.`;
return `Error #${code}. Please contact cloud.gov support for help troubleshooting this issue.`;
};

export class ServiceInstanceStore extends BaseStore {
Expand Down
8 changes: 2 additions & 6 deletions static_src/test/unit/actions/app_actions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ describe("appActions", function() {
});

describe("changeCurrentApp()", function() {
it("should dispatch a ui event of type app changed with guid", function(
done
) {
it("should dispatch a ui event of type app changed with guid", function(done) {
const appGuid = "testingAppGuid";
const expectedParams = {
appGuid
Expand Down Expand Up @@ -185,9 +183,7 @@ describe("appActions", function() {
assertAction(spy, appActionTypes.APP_START, expectedParams);
});

it("should call cf api put app with state started to restart the app", function(
done
) {
it("should call cf api put app with state started to restart the app", function(done) {
const spy = sandbox.stub(cfApi, "putApp").returns(Promise.resolve());
sandbox.stub(appActions, "restarted").returns(Promise.resolve());
const expectedGuid = "asdfasd2vdamcdksa";
Expand Down
16 changes: 4 additions & 12 deletions static_src/test/unit/actions/user_actions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,15 @@ describe("userActions", function() {
.returns(Promise.resolve({ guid: "" }));
});

it("calls receivedOrgSpacesToExtractSpaceUsers once when org has one space", function(
done
) {
it("calls receivedOrgSpacesToExtractSpaceUsers once when org has one space", function(done) {
orgSpaces = [orgSpace];
userActions
.receivedOrgSpacesToExtractSpaceUsers(orgSpaces)
.then(done, done.fail);
expect(cfApi.fetchSpaceUserRoles).toHaveBeenCalledOnce();
});

it("calls receivedOrgSpacesToExtractSpaceUsers three times when org has three spaces", function(
done
) {
it("calls receivedOrgSpacesToExtractSpaceUsers three times when org has three spaces", function(done) {
orgSpaces = [orgSpace, orgSpace, orgSpace];
userActions
.receivedOrgSpacesToExtractSpaceUsers(orgSpaces)
Expand Down Expand Up @@ -469,9 +465,7 @@ describe("userActions", function() {
sandbox.stub(UserStore, "get").returns("org_user");
});

it("should dispatch a view event of type create invite notification with false", function(
done
) {
it("should dispatch a view event of type create invite notification with false", function(done) {
description =
"An email invite was sent to [email protected]. Their account has been associated to this space, and their space roles can be controlled below.";
var expected = {
Expand All @@ -485,9 +479,7 @@ describe("userActions", function() {
done();
});

it("should dispatch a view event of type create invite notification with true", function(
done
) {
it("should dispatch a view event of type create invite notification with true", function(done) {
description =
"The cloud.gov account for [email protected] is now associated to this space. Control their space roles below.";
var expected = {
Expand Down
4 changes: 1 addition & 3 deletions static_src/test/unit/stores/base_store.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,7 @@ describe("BaseStore", () => {
});
});

it("should update a single existing entity with the same guid ", function(
done
) {
it("should update a single existing entity with the same guid ", function(done) {
var updateA = {
guid: existingEntityA.guid,
name: "zzz",
Expand Down
Loading

0 comments on commit 8d84826

Please sign in to comment.