Skip to content

Commit

Permalink
Merge branch 'main' into CHAL-247/gsa-admin-upload-for-solver
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Lopez committed Feb 24, 2021
2 parents 620d918 + 6f2d6a1 commit 416f3cd
Show file tree
Hide file tree
Showing 90 changed files with 1,269 additions and 392 deletions.
16 changes: 7 additions & 9 deletions .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
#
## Warnings
#
{Credo.Check.Warning.ApplicationConfigInModuleAtribute, []},
{Credo.Check.Warning.ApplicationConfigInModuleAttribute, false},
{Credo.Check.Warning.BoolOperationOnSameValues, []},
{Credo.Check.Warning.ExpensiveEmptyEnumCheck, []},
{Credo.Check.Warning.IExPry, []},
Expand All @@ -138,23 +138,22 @@
{Credo.Check.Warning.UnusedRegexOperation, []},
{Credo.Check.Warning.UnusedStringOperation, []},
{Credo.Check.Warning.UnusedTupleOperation, []},
{Credo.Check.Warning.UnsafeExe, []},
# {Credo.Check.Warning.UnsafeExe, []},
{Credo.Check.Warning.MapGetUnsafePass, []},
{Credo.Check.Warning.UnsafeToAtom, []},

# {Credo.Check.Warning.UnsafeToAtom, []},
#
# Controversial and experimental checks (opt-in, just replace `false` with `[]`)
#
{Credo.Check.Consistency.MultiAliasImportRequireUse, []},
{Credo.Check.Consistency.UnusedVariableNames, false},
{Credo.Check.Design.DuplicatedCode, []},
# {Credo.Check.Design.DuplicatedCode, []},
{Credo.Check.Readability.AliasAs, false},
{Credo.Check.Readability.BlockPipe, []},
# {Credo.Check.Readability.BlockPipe, []},
{Credo.Check.Readability.ImplTrue, []},
{Credo.Check.Readability.MultiAlias, []},
{Credo.Check.Readability.SeparateAliasRequire, []},
{Credo.Check.Readability.SinglePipe, false},
{Credo.Check.Readability.Specs, []},
# {Credo.Check.Readability.Specs, []},
{Credo.Check.Readability.StrictModuleLayout, []},
{Credo.Check.Readability.WithCustomTaggedTuple, []},
{Credo.Check.Refactor.ABCSize, false},
Expand All @@ -179,8 +178,7 @@
#
# CredoEnvVar checks
#
{CredoEnvvar.Check.Warning.EnvironmentVariablesAtCompileTime, []},

# {CredoEnvvar.Check.Warning.EnvironmentVariablesAtCompileTime, []},
#
# CredoNaming checks
#
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ npm-debug.log
/private.pem
/key.pem

# ignore emacs temp files
# ignore temp + backup files
**~
**/**~
**/*~
**/#*#

117 changes: 117 additions & 0 deletions assets/css/app/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ body {
color: #4A5C6B;
}

.main-container .btn-primary {
background-color: #F2994A;
width: 200px;
height: 33px;
border-radius: 4px;
color: black;
border: none;
}

.btn-wrapper {
margin-top: 30px;
display: flex;
Expand All @@ -87,6 +96,112 @@ body {

/* timeout modal */

.main-container {
left: 200px;
}

.main-container h1 {
font-family: 'Public Sans';
font-weight: 400;
font-size: 36px;
}

.main-container h2 {
font-family: 'Public Sans';
font-size: 25px;
}

.main-container h3 {
font-family: 'Public Sans';
font-size: 20px;
}

.winner-manage div.card-body {
position: relative;
}

.winner-manage div.card-body .mng-winner-btn {
position: absolute;
bottom: 10px;
left: 45px;
}

.winner-manage .winner-title {
height: 75px;
overflow: auto;
}


.card.winner-manage {
max-width: 300px;
min-height: 250px;
border-radius: 4px;
margin: 20px;
}

.main-container.phase-winners img.winner-img {
width: 100px;
height: 100px;
}

.main-container.phase-winners img.winner-img-thumbnail {
max-height: 200px;
max-width: 200px;
}

.main-container {
margin-left: 20px;
max-width: 900px;
}

.main-container.phase-winners p {
font-size: 16px;
font-family: 'Public Sans';
}

.main-container.phase-winners label {
font-size: 16px;
margin-bottom: 0px;
font-family: 'Public Sans';
}

.main-container hr {
background-color: #333333;
height: 1px;
}

.main-container .winner-options {
padding-top: 25px;
padding-bottom: 25px;
}

.main-container .cancel-winner {
text-decoration-line: underline;
margin-top: 5px;
}

.main-container .individual-winners {
padding-top: 20px;
}

.main-container.phase-winners .mini {
font-size: 12px;
}

.main-container .remove-winner-container {
padding-top: 22px;
}

.main-container .remove-winner {
color: red;
text-decoration-line: underline;
}

.main-container textarea#winner_overview {
max-width: 600px;
height: 200px;
}

.main-sidebar {
z-index: 1021;
}
Expand Down Expand Up @@ -267,6 +382,8 @@ label {
}

.challenge-show-actions {
height: 200px;

.card {
min-height: 10rem;
}
Expand Down
10 changes: 9 additions & 1 deletion assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ require("../css/app/index.scss");

// Import JS
import "./app/index.js";
import "./shared/index.js";
import "./shared/index.js";

import {Socket} from "phoenix";
import LiveSocket from "phoenix_live_view";

let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
const liveSocket = new LiveSocket("/live", Socket, {params: { _csrf_token: csrfToken}});
liveSocket.connect();
window.liveSocket = liveSocket;
5 changes: 3 additions & 2 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"moment-timezone": "^0.5.31",
"node-quill-converter": "^0.3.3",
"node-sass": "^4.13.1",
"phoenix": "1.4.10",
"phoenix_html": "2.13.2",
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html",
"phoenix_live_view": "file:../deps/phoenix_live_view",
"popper.js": "^1.14.7",
"query-string": "^6.13.2",
"quill": "^1.3.7",
Expand Down
17 changes: 8 additions & 9 deletions assets/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10118,15 +10118,14 @@ performance-now@^2.1.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=

[email protected]:
version "1.4.10"
resolved "https://registry.yarnpkg.com/phoenix/-/phoenix-1.4.10.tgz#02ebd5bf57bdbeb3ff43d8de6d44a8af7968991b"
integrity sha512-apWRDNUj3c//fwh7F7ixh90qejE2j9FFw+e0qSDzYKzszByGrrv9uSmsqol/7x2E+r0GbkXKaeH93eXTQbhJ1A==

[email protected]:
version "2.13.2"
resolved "https://registry.yarnpkg.com/phoenix_html/-/phoenix_html-2.13.2.tgz#28a2376b713e9d8dda0aee8710f7c73732ff0157"
integrity sha512-tXrTduDqIisIn0nhZJURLqjaN5aq0nYAwh6wKGQKug6FHEsRmjxWMCVSrPyXo+2ldf7EQLUWdX1ZzlNtyXTsSQ==
"phoenix@file:../deps/phoenix":
version "1.5.7"

"phoenix_html@file:../deps/phoenix_html":
version "2.14.2"

"phoenix_live_view@file:../deps/phoenix_live_view":
version "0.15.4"

picomatch@^2.0.4, picomatch@^2.0.7:
version "2.2.1"
Expand Down
3 changes: 2 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ config :challenge_gov,
config :challenge_gov, Web.Endpoint,
url: [host: "localhost"],
render_errors: [view: Web.ErrorView, accepts: ~w(html json)],
pubsub: [name: ChallengeGov.PubSub, adapter: Phoenix.PubSub.PG2]
pubsub_server: ChallengeGov.PubSub,
live_view: [signing_salt: "SECRET_SALT"]

# Configures Elixir's Logger
config :logger, :console,
Expand Down
25 changes: 25 additions & 0 deletions docs/cloud_gov.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,28 @@ cf ssh challenge-portal-dev

To run IEx commands or others, you'll need elixir and erlang on the path, just run:
`export PATH=/home/vcap/app/.platform_tools/elixir/bin:/home/vcap/app/.platform_tools/erlang/bin:/bin:/usr/bin` when connected via SSH

You can then work from the `app` directory and should be able to perform the mix and iex tasks you need to perform.

## PSQL

You can SSH tunnel through the running container to the PostgreSQL RDS instance so that you can use your local psql and related tools to work with the running database.

You'll need the RDS Host, Database, Username, and Password which you can get from the ENV of the running app in Cloud.gov or via the Cloud.gov administration panel for the application.

```
cf ssh challenge-portal-dev -L 5433:RDS_HOST:5432
```

This forwards on port 5433 so that you can still run postgres locally on 5432 without conflict.

Now in a separate terminal window, you can run, with the right username and database name filled in, using localhost on the 5433 port to leverage the tunnel via SSH.

```
psql -h localhost -p 5433 -U RDS_USERNAME RDS_DB
```

It will prompt for the RDS user password and then you'll have a connected psql session to the database.

Be sure to close the SSH connection when you are finished.

3 changes: 2 additions & 1 deletion lib/challenge_gov.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ defmodule ChallengeGov do
iex> ChallengeGov.config({:system, "HOST"})
"example.com"
"""
@spec config({atom(), String.t() | nil}) :: String.t() | nil
def config({:system, env}), do: System.get_env(env)

@spec config(any()) :: any()
def config(config), do: config
end
Loading

0 comments on commit 416f3cd

Please sign in to comment.