Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:sparrell/SbomPoc-sFractal into t…
Browse files Browse the repository at this point in the history
…racker-docs
  • Loading branch information
sigu committed Nov 18, 2020
2 parents 41bead8 + bca486a commit 2097327
Show file tree
Hide file tree
Showing 11 changed files with 413 additions and 410 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Set up Elixir
uses: actions/setup-elixir@v1
with:
elixir-version: '1.10.4' # Define the elixir version [required]
elixir-version: '1.11.2' # Define the elixir version [required]
otp-version: '22.3' # Define the OTP version [required]
- name: Restore dependencies cache
uses: actions/cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
deploy_to_production:
image: elixir:1.10.3
image: elixir:1.11.2

stage: deploy
before_script:
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
elixir 1.10.4-otp-22
elixir 1.11.2-otp-22
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# heavily borrowed from https://elixirforum.com/t/cannot-find-libtinfo-so-6-when-launching-elixir-app/24101/11?u=sigu
FROM elixir:1.10.4 AS app_builder
FROM elixir:1.11.2 AS app_builder

ARG env=prod

Expand Down
17 changes: 7 additions & 10 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,28 @@ function isJsonString(jsonString) {
}
}

function prettyPrinting() {
var instances = document.getElementsByClassName("json");
for (let instance of instances) {
let content = instance.innerHTML;
function prettyPrinting(element) {
let content = element.innerHTML;
if (isJsonString(content)) {
try {
let obj = JSON.parse(content);
content = JSON.stringify(JSON.parse(obj), undefined, 4);
instance.innerHTML = syntaxHighlight(content);
instance.style.whiteSpace = "pre";
element.innerHTML = syntaxHighlight(content);
element.style.whiteSpace = "pre";
} catch (e) {
return false; // It's not a valid JSON format
false
}
}
}
}

let Hooks = {};

Hooks.PrettyPrint = {
mounted() {
prettyPrinting();
prettyPrinting(this.el);
},
updated() {
prettyPrinting();
prettyPrinting(this.el);
}
};

Expand Down
740 changes: 373 additions & 367 deletions assets/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"nprogress": "^0.2.0"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"babel-loader": "^8.0.0",
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"babel-loader": "^8.2.1",
"copy-webpack-plugin": "^5.1.2",
"css-loader": "^3.4.2",
"mini-css-extract-plugin": "^0.9.0",
Expand Down
3 changes: 1 addition & 2 deletions lib/sbom_poc_web/controllers/user_registration_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ defmodule SbomPocWeb.UserRegistrationController do

alias SbomPoc.Accounts
alias SbomPoc.Accounts.User
alias SbomPocWeb.UserAuth

def new(conn, _params) do
changeset = Accounts.change_user_registration(%User{})
render(conn, "new.html", changeset: changeset)
end

def create(conn, %{"user" => user_params}) do
def create(conn, %{"user" => _user_params}) do
changeset = Accounts.change_user_registration(%User{})
render(conn, "new.html", changeset: changeset)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/sbom_poc_web/live/events_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule SbomPocWeb.EventsLive do
<%= if Enum.empty? @events do %>
<h2> No events yet </h2>
<% else %>
<table phx-hook="PrettyPrint">
<table>
<thead>
<tr>
<th>Time</th>
Expand All @@ -32,7 +32,7 @@ defmodule SbomPocWeb.EventsLive do
<tr>
<td><%= time %></td>
<td><%= details.topic %></td>
<td class="json">
<td phx-hook="PrettyPrint">
<%= raw details.message %>
</td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule SbomPoc.MixProject do
[
app: :sbom_poc,
version: "0.1.0",
elixir: "~> 1.10",
elixir: "~> 1.11.2",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
Expand Down Expand Up @@ -45,11 +45,11 @@ defmodule SbomPoc.MixProject do
{:ecto, ">= 3.4.4 and < 3.4.5"},
{:ecto_sql, ">= 3.4.4 and < 3.4.5"},
{:postgrex, ">= 0.0.0"},
{:phoenix_live_view, "~> 0.13.0"},
{:phoenix_live_view, "~> 0.14.8"},
{:floki, ">= 0.0.0", only: :test},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_dashboard, "~> 0.2.0"},
{:phoenix_live_dashboard, "~> 0.3.6"},
{:telemetry_metrics, "~> 0.4"},
{:telemetry_poller, "~> 0.4"},
{:gettext, "~> 0.11"},
Expand Down
39 changes: 20 additions & 19 deletions mix.lock

Large diffs are not rendered by default.

0 comments on commit 2097327

Please sign in to comment.