jobshop 0.0.131 → 0.0.157

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +16 -9
  4. data/app/controllers/concerns/jobshop/authentication_handler.rb +15 -0
  5. data/app/controllers/concerns/jobshop/authorization_handler.rb +29 -0
  6. data/app/controllers/jobshop/application_controller.rb +5 -32
  7. data/app/controllers/jobshop/organizations/lookups_controller.rb +18 -0
  8. data/app/controllers/jobshop/places_controller.rb +1 -1
  9. data/app/controllers/jobshop/{welcome/registrations_controller.rb → registrations_controller.rb} +2 -7
  10. data/app/controllers/jobshop/session_activations_controller.rb +1 -1
  11. data/app/controllers/jobshop/sessions_controller.rb +15 -1
  12. data/app/controllers/jobshop/users_controller.rb +9 -0
  13. data/app/mailers/jobshop/application_mailer.rb +2 -2
  14. data/app/models/jobshop/ability.rb +7 -0
  15. data/app/models/jobshop/collection.rb +22 -0
  16. data/app/models/jobshop/company.rb +22 -0
  17. data/app/models/jobshop/dashboard.rb +1 -1
  18. data/app/models/jobshop/inspection/boolean_criterion.rb +44 -0
  19. data/app/models/jobshop/inspection/criterion.rb +22 -0
  20. data/app/models/jobshop/inspection/deviation_criterion.rb +112 -0
  21. data/app/models/jobshop/inspection/limit_criterion.rb +114 -0
  22. data/app/models/jobshop/inspection/report.rb +41 -0
  23. data/app/models/jobshop/inspection/result.rb +42 -0
  24. data/app/models/jobshop/inspection/tuple.rb +13 -0
  25. data/app/models/jobshop/inspection.rb +13 -0
  26. data/app/models/jobshop/order.rb +41 -0
  27. data/app/models/jobshop/order_line.rb +13 -0
  28. data/app/models/jobshop/organization.rb +34 -0
  29. data/app/models/jobshop/place.rb +6 -4
  30. data/app/models/jobshop/product.rb +23 -0
  31. data/app/models/jobshop/registration.rb +14 -10
  32. data/app/models/jobshop/role.rb +24 -0
  33. data/app/models/jobshop/role_ability.rb +7 -0
  34. data/app/models/jobshop/role_assignment.rb +7 -0
  35. data/app/models/jobshop/routing_process.rb +20 -0
  36. data/app/models/jobshop/routing_step.rb +11 -0
  37. data/app/models/jobshop/thing.rb +30 -4
  38. data/app/models/jobshop/user.rb +23 -25
  39. data/app/serializers/jobshop/test_user_serializer.rb +10 -0
  40. data/app/services/jobshop/authentication_service.rb +20 -0
  41. data/app/services/jobshop/authorization_service.rb +30 -0
  42. data/app/services/jobshop/jwt_service.rb +17 -0
  43. data/config/routes.rb +2 -43
  44. data/db/migrate/20170311194758_initialize_jobshop.rb +1 -106
  45. data/db/migrate/20171216021339_create_organizations.rb +20 -0
  46. data/db/migrate/20171216021717_create_users.rb +30 -0
  47. data/db/migrate/20171216021853_create_companies.rb +25 -0
  48. data/db/migrate/20171216022020_create_places.rb +22 -0
  49. data/db/migrate/20171216022135_create_products.rb +27 -0
  50. data/db/migrate/20171216022605_create_orders.rb +53 -0
  51. data/db/migrate/20171216023018_create_roles.rb +52 -0
  52. data/db/migrate/20171216023022_create_sessions.rb +21 -0
  53. data/db/migrate/20171216035357_create_things.rb +44 -0
  54. data/db/migrate/20171219022118_create_routing_processes.rb +57 -0
  55. data/db/migrate/20180107203241_create_inspection.rb +159 -0
  56. data/{app/assets/stylesheets/jobshop/welcome.scss → db/seeds.rb} +0 -0
  57. data/lib/generators/jobshop/app/app_generator.rb +36 -3
  58. data/lib/generators/jobshop/app/templates/config/database.yml.tt +19 -0
  59. data/lib/generators/jobshop/config/templates/config/initializers/jobshop.rb.tt +0 -2
  60. data/lib/generators/jobshop/dummy/dummy_generator.rb +3 -14
  61. data/lib/jobshop/cli/spinner.rb +21 -0
  62. data/lib/jobshop/cli.rb +44 -24
  63. data/lib/jobshop/configuration.rb +24 -0
  64. data/lib/jobshop/dummy_app.rb +155 -0
  65. data/lib/jobshop/engine.rb +30 -31
  66. data/lib/jobshop/helpers/migration.rb +55 -0
  67. data/lib/jobshop/version.rb +2 -2
  68. data/lib/jobshop.rb +7 -21
  69. data/lib/tasks/jobshop_tasks.rake +7 -24
  70. metadata +113 -150
  71. data/app/assets/config/jobshop_manifest.js +0 -2
  72. data/app/assets/images/jobshop/logo.svg +0 -50
  73. data/app/assets/javascripts/jobshop/application.js +0 -34
  74. data/app/assets/stylesheets/jobshop/application.scss +0 -57
  75. data/app/assets/stylesheets/jobshop/breakpoints.scss +0 -47
  76. data/app/assets/stylesheets/jobshop/dialog.scss +0 -43
  77. data/app/controllers/concerns/registration_token_validation.rb +0 -41
  78. data/app/controllers/jobshop/teams/lookups_controller.rb +0 -20
  79. data/app/controllers/jobshop/teams_controller.rb +0 -6
  80. data/app/controllers/jobshop/welcome/places_controller.rb +0 -42
  81. data/app/controllers/jobshop/welcome/things_controller.rb +0 -42
  82. data/app/controllers/jobshop/welcome_controller.rb +0 -11
  83. data/app/helpers/jobshop/application_helper.rb +0 -14
  84. data/app/mailers/jobshop/teams_mailer.rb +0 -10
  85. data/app/models/jobshop/team.rb +0 -36
  86. data/app/policies/jobshop/application_policy.rb +0 -55
  87. data/app/views/devise/confirmations/new.html.haml +0 -10
  88. data/app/views/devise/mailer/confirmation_instructions.html.haml +0 -4
  89. data/app/views/devise/mailer/password_change.html.haml +0 -3
  90. data/app/views/devise/mailer/reset_password_instructions.html.haml +0 -6
  91. data/app/views/devise/mailer/unlock_instructions.html.haml +0 -5
  92. data/app/views/devise/passwords/edit.html.haml +0 -19
  93. data/app/views/devise/passwords/new.html.haml +0 -10
  94. data/app/views/devise/registrations/edit.html.haml +0 -31
  95. data/app/views/devise/registrations/new.html.haml +0 -21
  96. data/app/views/devise/sessions/new.html.haml +0 -15
  97. data/app/views/devise/shared/_links.html.haml +0 -19
  98. data/app/views/devise/unlocks/new.html.haml +0 -10
  99. data/app/views/jobshop/dashboards/show.html.haml +0 -140
  100. data/app/views/jobshop/places/show.html.haml +0 -12
  101. data/app/views/jobshop/session_activations/destroy.js.erb +0 -1
  102. data/app/views/jobshop/shared/_authenticated_header.html.haml +0 -8
  103. data/app/views/jobshop/shared/_unauthenticated_header.html.haml +0 -10
  104. data/app/views/jobshop/teams/lookups/show.html.haml +0 -14
  105. data/app/views/jobshop/teams_mailer/found_teams.html.haml +0 -11
  106. data/app/views/jobshop/teams_mailer/found_teams.text.erb +0 -8
  107. data/app/views/jobshop/welcome/index.html.haml +0 -21
  108. data/app/views/jobshop/welcome/places/new.html.haml +0 -22
  109. data/app/views/jobshop/welcome/registrations/new.html.haml +0 -32
  110. data/app/views/jobshop/welcome/things/new.html.haml +0 -24
  111. data/app/views/layouts/jobshop/application.html.haml +0 -15
  112. data/app/views/layouts/jobshop/unauthenticated.html.haml +0 -6
  113. data/config/initializers/assets.rb +0 -11
  114. data/config/initializers/devise.rb +0 -282
  115. data/config/initializers/field_with_errors.rb +0 -3
  116. data/config/initializers/simple_form.rb +0 -157
  117. data/config/locales/devise.en.yml +0 -62
  118. data/config/locales/simple_form.en.yml +0 -31
  119. data/db/migrate/keep +0 -0
  120. data/lib/generators/jobshop/team/USAGE +0 -7
  121. data/lib/generators/jobshop/team/team_generator.rb +0 -60
  122. data/lib/jobshop/failure_app.rb +0 -11
@@ -1,157 +0,0 @@
1
- # Use this setup block to configure all options available in SimpleForm.
2
- SimpleForm.setup do |config|
3
- # Wrappers are used by the form builder to generate a
4
- # complete input. You can remove any component from the
5
- # wrapper, change the order or even add your own to the
6
- # stack. The options given below are used to wrap the
7
- # whole input.
8
-
9
- config.wrappers :string,
10
- class: %w(mdl-textfield mdl-js-textfield),
11
- error_class: "is-invalid" do |b|
12
-
13
- b.use :html5
14
- b.use :input, class: "mdl-textfield__input"
15
- b.use :label, class: "mdl-textfield__label"
16
- b.use :error, wrap_with: { tag: :span, class: "mdl-textfield__error" }
17
- end
18
-
19
- config.wrappers :default, class: :input,
20
- hint_class: :field_with_hint,
21
- error_class: "is-invalid" do |b|
22
-
23
- b.use :html5
24
- b.use :placeholder
25
- b.optional :maxlength
26
- b.use :pattern
27
- b.optional :min_max
28
- b.optional :readonly
29
- b.use :label_input
30
- b.use :hint, wrap_with: { tag: :span, class: :hint }
31
- b.use :error, wrap_with: { tag: :span, class: :error }
32
- end
33
-
34
- # The default wrapper to be used by the FormBuilder.
35
- config.default_wrapper = :default
36
-
37
- # Define the way to render check boxes / radio buttons with labels.
38
- # Defaults to :nested for bootstrap config.
39
- # inline: input + label
40
- # nested: label > input
41
- config.boolean_style = :nested
42
-
43
- # Default class for buttons
44
- config.button_class = [
45
- "mdl-button",
46
- "mdl-js-button",
47
- "mdl-button--raised",
48
- "mdl-button--primary"
49
- ]
50
-
51
- # Method used to tidy up errors. Specify any Rails Array method.
52
- # :first lists the first message for each field.
53
- # Use :to_sentence to list all errors for each field.
54
- config.error_method = :to_sentence
55
-
56
- # Default tag used for error notification helper.
57
- config.error_notification_tag = :div
58
-
59
- # CSS class to add for error notification helper.
60
- config.error_notification_class = "error_notification"
61
-
62
- # ID to add for error notification helper.
63
- # config.error_notification_id = nil
64
-
65
- # Series of attempts to detect a default label method for collection.
66
- # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
67
-
68
- # Series of attempts to detect a default value method for collection.
69
- # config.collection_value_methods = [ :id, :to_s ]
70
-
71
- # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
72
- # config.collection_wrapper_tag = nil
73
-
74
- # You can define the class to use on all collection wrappers. Defaulting to none.
75
- # config.collection_wrapper_class = nil
76
-
77
- # You can wrap each item in a collection of radio/check boxes with a tag,
78
- # defaulting to :span.
79
- # config.item_wrapper_tag = :span
80
-
81
- # You can define a class to use in all item wrappers. Defaulting to none.
82
- # config.item_wrapper_class = nil
83
-
84
- # How the label text should be generated altogether with the required text.
85
- # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
86
-
87
- # You can define the class to use on all labels. Default is nil.
88
- # config.label_class = nil
89
-
90
- # You can define the default class to be used on forms. Can be overriden
91
- # with `html: { :class }`. Defaulting to none.
92
- # config.default_form_class = nil
93
-
94
- # You can define which elements should obtain additional classes
95
- # config.generate_additional_classes_for = [:wrapper, :label, :input]
96
-
97
- # Whether attributes are required by default (or not). Default is true.
98
- # config.required_by_default = true
99
-
100
- # Tell browsers whether to use the native HTML5 validations (novalidate form option).
101
- # These validations are enabled in SimpleForm's internal config but disabled by default
102
- # in this configuration, which is recommended due to some quirks from different browsers.
103
- # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
104
- # change this configuration to true.
105
- # config.browser_validations = true
106
-
107
- # Collection of methods to detect if a file type was given.
108
- # config.file_methods = [ :mounted_as, :file?, :public_filename ]
109
-
110
- # Custom mappings for input types. This should be a hash containing a regexp
111
- # to match as key, and the input type that will be used when the field name
112
- # matches the regexp as value.
113
- # config.input_mappings = { /count/ => :integer }
114
-
115
- # Custom wrappers for input types. This should be a hash containing an input
116
- # type as key and the wrapper that will be used for all inputs with specified type.
117
- # config.wrapper_mappings = { string: :prepend }
118
- config.wrapper_mappings = {
119
- email: :string,
120
- password: :string,
121
- string: :string
122
- }
123
-
124
- # Namespaces where SimpleForm should look for custom input classes that
125
- # override default inputs.
126
- # config.custom_inputs_namespaces << "CustomInputs"
127
-
128
- # Default priority for time_zone inputs.
129
- # config.time_zone_priority = nil
130
-
131
- # Default priority for country inputs.
132
- # config.country_priority = nil
133
-
134
- # When false, do not use translations for labels.
135
- # config.translate_labels = true
136
-
137
- # Automatically discover new inputs in Rails' autoload path.
138
- # config.inputs_discovery = true
139
-
140
- # Cache SimpleForm inputs discovery
141
- # config.cache_discovery = !Rails.env.development?
142
-
143
- # Default class for inputs
144
- # config.input_class = nil
145
-
146
- # Define the default class of the input wrapper of the boolean input.
147
- config.boolean_label_class = %w(mdl-checkbox
148
- mdl-js-checkbox
149
- mdl-js-ripple-effect)
150
-
151
- # Defines if the default input wrapper class should be included in radio
152
- # collection wrappers.
153
- # config.include_default_input_wrapper_class = true
154
-
155
- # Defines which i18n scope will be used in Simple Form.
156
- # config.i18n_scope = 'simple_form'
157
- end
@@ -1,62 +0,0 @@
1
- # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
-
3
- en:
4
- devise:
5
- confirmations:
6
- confirmed: "Your email address has been successfully confirmed."
7
- send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
- send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
- failure:
10
- already_authenticated: "You are already signed in."
11
- inactive: "Your account is not activated yet."
12
- invalid: "Invalid %{authentication_keys} or password."
13
- locked: "Your account is locked."
14
- last_attempt: "You have one more attempt before your account is locked."
15
- not_found_in_database: "Invalid %{authentication_keys} or password."
16
- timeout: "Your session expired. Please sign in again to continue."
17
- unauthenticated: "You need to sign in or sign up before continuing."
18
- unconfirmed: "You have to confirm your email address before continuing."
19
- mailer:
20
- confirmation_instructions:
21
- subject: "Confirmation instructions"
22
- reset_password_instructions:
23
- subject: "Reset password instructions"
24
- unlock_instructions:
25
- subject: "Unlock instructions"
26
- password_change:
27
- subject: "Password Changed"
28
- omniauth_callbacks:
29
- failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
30
- success: "Successfully authenticated from %{kind} account."
31
- passwords:
32
- no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
33
- send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
34
- send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
35
- updated: "Your password has been changed successfully. You are now signed in."
36
- updated_not_active: "Your password has been changed successfully."
37
- registrations:
38
- destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
39
- signed_up: "Welcome! You have signed up successfully."
40
- signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
41
- signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
42
- signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
43
- update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
44
- updated: "Your account has been updated successfully."
45
- sessions:
46
- signed_in: "Signed in successfully."
47
- signed_out: "Signed out successfully."
48
- already_signed_out: "Signed out successfully."
49
- unlocks:
50
- send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
51
- send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
52
- unlocked: "Your account has been unlocked successfully. Please sign in to continue."
53
- errors:
54
- messages:
55
- already_confirmed: "was already confirmed, please try signing in"
56
- confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
57
- expired: "has expired, please request a new one"
58
- not_found: "not found"
59
- not_locked: "was not locked"
60
- not_saved:
61
- one: "1 error prohibited this %{resource} from being saved:"
62
- other: "%{count} errors prohibited this %{resource} from being saved:"
@@ -1,31 +0,0 @@
1
- en:
2
- simple_form:
3
- "yes": 'Yes'
4
- "no": 'No'
5
- required:
6
- text: 'required'
7
- mark: ''
8
- # You can uncomment the line below if you need to overwrite the whole required html.
9
- # When using html, text and mark won't be used.
10
- # html: '<abbr title="required">*</abbr>'
11
- error_notification:
12
- default_message: "Please review the problems below:"
13
- # Examples
14
- # labels:
15
- # defaults:
16
- # password: 'Password'
17
- # user:
18
- # new:
19
- # email: 'E-mail to sign in.'
20
- # edit:
21
- # email: 'E-mail.'
22
- # hints:
23
- # defaults:
24
- # username: 'User name to sign in.'
25
- # password: 'No special characters, please.'
26
- # include_blanks:
27
- # defaults:
28
- # age: 'Rather not say'
29
- # prompts:
30
- # defaults:
31
- # age: 'Select your age'
data/db/migrate/keep DELETED
File without changes
@@ -1,7 +0,0 @@
1
- Description:
2
- Create a new Jobshop team.
3
-
4
- Example:
5
- rails generate team "team name"
6
-
7
- This will generate a new team and print a configuration link on the console.
@@ -1,60 +0,0 @@
1
- module Jobshop
2
- module Generators
3
- class TeamGenerator < Rails::Generators::Base
4
- source_root File.expand_path("../templates", __FILE__)
5
-
6
- desc "Create a jobshop team."
7
-
8
- def require_environment
9
- ENV["RAILS_ENV"] ||= "development"
10
- abort "Please run this command within a Rails app." unless Rails.root
11
-
12
- environment_filename = File.expand_path(
13
- Rails.root + "config/environment.rb")
14
-
15
- require environment_filename
16
- end
17
-
18
- def create_team
19
- @team = ::Jobshop::Team.new
20
- end
21
-
22
- def generate_token
23
- @token = @team.generate_registration_token
24
- end
25
-
26
- def generate_secure_registration_link
27
- link_protocol = Rails.env.development? ? "http" : "https"
28
- link_host = Rails.env.development? ? "localhost:3000" : "YOUR-HOST-NAME"
29
- # TODO: Give environments besides development a decent host and
30
- # protocol. HTTPS isn't mandatory in production but it is very, VERY
31
- # highly recommended.
32
- @secure_url = ::Jobshop::Engine.routes.url_helpers.
33
- new_welcome_registration_url(
34
- protocol: link_protocol,
35
- host: link_host,
36
- registration_token: @token,
37
- team_id: @team.id
38
- )
39
- end
40
-
41
- def print_secure_registration_link
42
- say <<-MESSAGE
43
- ### JOBSHOP - IMPORTANT INFORMATION ############################################
44
-
45
- Your Jobshop team has been initialized.
46
- You may use the following link to complete the setup process.
47
-
48
- #{@secure_url}
49
-
50
- This link is valid for 30 minutes and will expire at:
51
- #{30.minutes.from_now.in_time_zone("Eastern Time (US & Canada)")}
52
-
53
- Thank you for using Jobshop!
54
-
55
- ################################################################################
56
- MESSAGE
57
- end
58
- end
59
- end
60
- end
@@ -1,11 +0,0 @@
1
- module Jobshop
2
- class FailureApp < Devise::FailureApp
3
- def redirect_url
4
- Jobshop::Engine.routes.url_helpers.teams_lookup_url(host: request.host, port: request.port)
5
- end
6
-
7
- def respond
8
- http_auth? ? http_auth : redirect
9
- end
10
- end
11
- end