show owner info in material release table

This commit is contained in:
Bilal
2020-08-04 13:14:42 +02:00
parent 8214ba9e67
commit a7b7e1ecf9
7 changed files with 42 additions and 16 deletions

View File

@@ -18,6 +18,9 @@
<td>
<%= material_release.name %>
</td>
<td>
<%= contact_info_for(material_release.contact_person) %>
</td>
<td>
<%= notes_preview material_release.notes.order_by_recent %>
</td>

View File

@@ -29,10 +29,10 @@
<th><%= t '.table_headers.approved'%></th>
<th></th>
<th><%= MaterialRelease.human_attribute_name(:name) %></th>
<th><%= t(".table_headers.owner_info") %>
<th><%= t(".table_headers.notes") %></th>
<th><%= t(".table_headers.tags") %></th>
<th><%= t(".table_headers.signed_at") %></th>
<th><%= t(".table_headers.signed_at") %></th>
<th></th>
</tr>
</thead>

View File

@@ -903,6 +903,7 @@ en:
approved: Approved
name: Name
notes: Notes
owner_info: Owner Info
signed_at: Date Signed
tags: Tags
material_release:

View File

@@ -436,6 +436,7 @@ es:
table_headers:
name: Name (ES)
notes: Notes (ES)
owner_info: Owner Info
signed_at: Date Signed (ES)
tags: Tags (ES)
medical_releases:

View File

@@ -9,20 +9,6 @@ SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
--
@@ -1479,6 +1465,7 @@ CREATE TABLE public.settings (
--
CREATE SEQUENCE public.settings_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -1514,6 +1501,7 @@ CREATE TABLE public.taggings (
--
CREATE SEQUENCE public.taggings_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -1544,6 +1532,7 @@ CREATE TABLE public.tags (
--
CREATE SEQUENCE public.tags_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE

View File

@@ -4,10 +4,20 @@ FactoryBot.define do
name "Test Materials"
trait :with_address do
person_address_street1 "St1"
person_address_street2 "St2"
person_address_city "City"
person_address_state "State"
person_address_zip "123"
person_address_country "US"
end
trait :native do
person_first_name "Jane"
person_last_name "Doe"
person_phone "100-555-1001"
person_email "owner@email.com"
signature do
path = Rails.root.join("spec", "fixtures", "files", "signature.png")

View File

@@ -185,6 +185,24 @@ feature "User managing material releases" do
sign_in current_user
end
scenario "index table shows owner info" do
release = create(:material_release, :native, :with_address, project: project)
visit project_material_releases_path(project)
expect(page).to have_content owner_info_table_header
expect(page).to have_content release.person_first_name
expect(page).to have_content release.person_last_name
expect(page).to have_content release.person_phone
expect(page).to have_content release.person_email
expect(page).to have_content release.person_address_street1
expect(page).to have_content release.person_address_city
expect(page).to have_content release.person_address_state
expect(page).to have_content release.person_address_zip
expect(page).to have_content release.person_address_country
end
scenario "creating a release for and adult", js: true do
visit new_project_material_release_path(project)
@@ -813,4 +831,8 @@ feature "User managing material releases" do
def signature_field
'material_release_signature_base64'
end
def owner_info_table_header
t 'material_releases.index.table_headers.owner_info'
end
end