Skip to content

Commit

Permalink
Fixing bug related to dashboard requests and Preping new version 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomdmoura committed Jan 2, 2018
1 parent e4faa0a commit 22e15fe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ is a Phoenix model make sure you add it to the `schema`, as a `string`, and
to the `changeset/2`:

```elixir
defmodule YourProject.YouModule do
defmodule YourProject.UserStateMachine do
schema "users" do
# ...
field :state, :string
Expand Down
2 changes: 1 addition & 1 deletion lib/machinery.ex
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ defmodule Machinery do
@doc """
Start function that will trigger a supervisor for the Machinery.Transitions, a
GenServer that controls the state transitions and also starts another process,
if the `interface` config is set to `true, for Machinery.Endpoint, a module
if the `interface` config is set to `true`, for Machinery.Endpoint, a module
that uses Phoenix.Endpoint to expose new routes related to Machinery.
"""
def start(_type, _args) do
Expand Down
6 changes: 4 additions & 2 deletions lib/web/static/js/resource_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ const errorTemplate = require('./templates/error_template');
const infoTemplate = require('./templates/info_template');

module.exports = class ResourceLoader {
constructor(list) {
constructor() {
let mountedPath = $("body")[0].dataset.mountedPath
this.loading = false
this.url = `${mountedPath}/api/`
}

getResourcesForState(list, page, callback) {
if(!this.loading){
let state = list.dataset.state
let nextPage = page + 1;
let url = 'machinery/api/'+state+'/resources/'+nextPage
let url = `${this.url}${state}/resources/${nextPage}`

let request = $.get(url, function(response) {
callback(response)
Expand Down
2 changes: 1 addition & 1 deletion lib/web/templates/layout/app.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="stylesheet" href="<%= static_path(@conn, "#{@mount_path}/css/app.css") %>">
</head>

<body>
<body data-mounted-path="<%= @mount_path %>">
<div class="container-fluid">
<div class="row">
<nav class="navbar navbar-expand-md fixed-top topbar">
Expand Down
3 changes: 1 addition & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ defmodule Machinery.Mixfile do
[
maintainers: ["João M. D. Moura"],
licenses: ["Apache 2.0"],
links: %{"GitHub" => "https://github.com/joaomdmoura/machinery"},
files: ["lib", "web", "priv", "mix.exs", "README*", "LICENSE*"]
links: %{"GitHub" => "https://github.com/joaomdmoura/machinery"}
]
end
end

0 comments on commit 22e15fe

Please sign in to comment.