Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated grover config #1932

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions app/javascript/src/components/Profile/Organization/Edit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ const OrgEdit = () => {
});
setIsDetailUpdated(true);
}
}, [file]);
}, [file, orgDetails]);

const [currenciesOption, setCurrenciesOption] = useState([]);
const [timezoneOption, setTimezoneOption] = useState([]);
const [timezones, setTimezones] = useState({});
const [isDetailUpdated, setIsDetailUpdated] = useState(false);
/* eslint-disable-next-line */
const [_isDetailUpdated, setIsDetailUpdated] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [countries, setCountries] = useState([]);

Expand Down Expand Up @@ -286,8 +287,8 @@ const OrgEdit = () => {
const changedCountry = {
...companyAddr,
country: selectCountry,
state: {},
city: {},
state: "",
city: "",
};

setupTimezone(
Expand Down Expand Up @@ -419,38 +420,40 @@ const OrgEdit = () => {
formD.append("company[fiscal_year_end]", orgDetails.companyFiscalYear);
formD.append("company[date_format]", orgDetails.companyDateFormat);
formD.append("company[timezone]", orgDetails.companyTimezone);
formD.append(
"company[addresses_attributes[0][id]]",
orgDetails.companyAddr.id
);
if (orgDetails.companyAddr.id) {
formD.append(
"company[addresses_attributes][0][id]",
orgDetails.companyAddr.id
);
}

formD.append(
"company[addresses_attributes[0][address_line_1]]",
"company[addresses_attributes][0][address_line_1]",
orgDetails.companyAddr.addressLine1
);

formD.append(
"company[addresses_attributes[0][address_line_2]]",
"company[addresses_attributes][0][address_line_2]",
orgDetails.companyAddr.addressLine2
);

formD.append(
"company[addresses_attributes[0][state]]",
"company[addresses_attributes][0][state]",
orgDetails.companyAddr.state
);

formD.append(
"company[addresses_attributes[0][city]]",
"company[addresses_attributes][0][city]",
orgDetails.companyAddr.city
);

formD.append(
"company[addresses_attributes[0][country]]",
"company[addresses_attributes][0][country]",
orgDetails.companyAddr.country?.value
);

formD.append(
"company[addresses_attributes[0][pin]]",
"company[addresses_attributes][0][pin]",
orgDetails.companyAddr.zipcode
);

Expand Down Expand Up @@ -486,7 +489,7 @@ const OrgEdit = () => {
<EditHeader
showButtons
cancelAction={handleCancelAction}
isDisableUpdateBtn={isDetailUpdated}
isDisableUpdateBtn={false}
saveAction={handleUpdateOrgDetails}
subTitle=""
title="Organization Settings"
Expand Down
14 changes: 7 additions & 7 deletions app/views/internal_api/v1/partial/_address.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true

json.id address.id
json.address_line_1 address.address_line_1
json.address_line_2 address.address_line_2
json.city address.city
json.state address.state
json.country address.country
json.pin address.pin
json.id address&.id
json.address_line_1 address&.address_line_1
json.address_line_2 address&.address_line_2
json.city address&.city
json.state address&.state
json.country address&.country
json.pin address&.pin
8 changes: 5 additions & 3 deletions config/initializers/grover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
top: "5px",
bottom: "5px"
},
prefer_css_page_size: true,
prefer_css_page_size: false,
emulate_media: "screen",
cache: false,
timeout: 0, # Timeout in ms. A value of `0` means 'no timeout'
timeout: 30000,
wait_until: "domcontentloaded",
launch_args: ["--no-sandbox", "--disable-setuid-sandbox"]
launch_args: ["--no-sandbox", "--disable-setuid-sandbox", "--disable-gpu"],
viewport: { width: 800, height: 600 },
javascript_enabled: false
}

if !(Rails.env.development? || Rails.env.test?)
Expand Down
2 changes: 1 addition & 1 deletion deployment/fly/fly.staging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ primary_region = "ewr"

[processes]
web = "bin/rails fly:server"
worker = "bundle exec rake solid_queue:start"
worker = "bin/rails fly:worker"

[build]
dockerfile = "Dockerfile"
Expand Down
2 changes: 1 addition & 1 deletion lib/pdf/html_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def set_options(user_defined_options)
@options = user_defined_options
else
@options = {
wait_until: ["networkidle0", "load", "domcontentloaded", "networkidle2"]
wait_until: ["load", "domcontentloaded"]
}
end

Expand Down
9 changes: 9 additions & 0 deletions lib/tasks/fly.rake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ namespace :fly do
sh 'bin/rails server -b [::] -p 8080'
end

# Worker step:
# - changes to the filesystem made here are deployed
# - full access to secrets, databases
# - failures here result in VM being stated, shutdown, and rolled back
# to last successful deploy (if any).
task :worker => :swapfile do
sh 'bundle exec rake solid_queue:start'
end

# optional SWAPFILE task:
# - adjust fallocate size as needed
# - performance critical applications should scale memory to the
Expand Down
2 changes: 1 addition & 1 deletion spec/mailers/previews/invoice_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class InvoicePreview < ActionMailer::Preview
def invoice
invoice = Invoice.last
id = invoice.id
invoice_id = invoice.id
recipients = [invoice.client.email, "[email protected]"]
subject = "Invoice (#{invoice.invoice_number}) due on #{invoice.due_date}"
message = "#{invoice.client.company.name} has sent you an invoice (#{invoice.invoice_number}) for $#{invoice.amount.to_i} that's due on #{invoice.due_date}."
Expand Down
Loading