Skip to content

Commit

Permalink
feat: moves command value to protocol join table
Browse files Browse the repository at this point in the history
  • Loading branch information
aviemet committed Apr 1, 2024
1 parent 936ec50 commit 590fa6f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app/frontend/Components/Dropdowns/ProtocolDropdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

const ProocolDropdown = () => {
return (
<div>ProocolDropdown</div>
)
}

export default ProocolDropdown
3 changes: 2 additions & 1 deletion app/frontend/Pages/Controls/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const emptyControl: Partial<Schema.ControlsFormData> = {
}

const ControlForm = ({ method = 'post', control, ...props }: IControlFormProps) => {
console.log({ control })

return (
<Form<Partial<Schema.ControlsFormData>>
model="control"
Expand All @@ -35,7 +37,6 @@ const ControlForm = ({ method = 'post', control, ...props }: IControlFormProps)
<TextInput name="min_value" label="Min Value" />
<TextInput name="max_value" label="Max Value" />
</> }
<TextInput name="value" label="Value" />
<br />
<Submit>{ control?.id ? 'Update' : 'Create' } Control</Submit>
</Form>
Expand Down
1 change: 1 addition & 0 deletions app/models/protocols_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# id :bigint not null, primary key
# delay :integer
# value :string
# created_at :datetime not null
# updated_at :datetime not null
# command_id :bigint not null
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20240229090637_create_protocols_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ def change
create_table :protocols_commands do |t|
t.references :protocol, null: false, foreign_key: true
t.references :command, null: false, foreign_key: true
t.string :value
t.integer :delay

t.timestamps
Expand Down
1 change: 1 addition & 0 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions spec/factories/protocols_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# id :bigint not null, primary key
# delay :integer
# value :string
# created_at :datetime not null
# updated_at :datetime not null
# command_id :bigint not null
Expand Down
1 change: 1 addition & 0 deletions spec/models/protocols_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# id :bigint not null, primary key
# delay :integer
# value :string
# created_at :datetime not null
# updated_at :datetime not null
# command_id :bigint not null
Expand Down

0 comments on commit 590fa6f

Please sign in to comment.