Skip to content

Commit

Permalink
deploy - eslint --fix, fix docker build issue, add some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dcordz committed Nov 3, 2024
1 parent ba52ac7 commit 1eb0d89
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 27 deletions.
18 changes: 5 additions & 13 deletions app/frontend/components/HelpTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,11 @@ interface IProps {
className?: string;
}

const HelpTooltip: React.FC<IProps> = ({
message,
tooltipId,
title,
size,
hideLabel,
placement,
className,
}) => {
const HelpTooltip: React.FC<IProps> = ({ message, tooltipId, title, size, hideLabel, placement, className }) => {
return (
<div>
{!title && (
<div className={`ml-1 mb-1 ${className}`}>
<div className={`ms-1 mb-1 ${className}`}>
<OverlayTrigger
key="top"
placement={placement || "top"}
Expand All @@ -35,14 +27,14 @@ const HelpTooltip: React.FC<IProps> = ({
</Popover>
}
>
<FiHelpCircle fontSize={size ? size : undefined} className="blue" />
<FiHelpCircle fontSize={size} className="blue" />
</OverlayTrigger>
</div>
)}
{title && (
<div className={`row g-0 ${className}`}>
{!hideLabel && <span>{title}</span>}
<div className="ml-1 mb-1">
<div className="ms-1 mb-1">
<OverlayTrigger
key="top"
placement={placement || "top"}
Expand All @@ -53,7 +45,7 @@ const HelpTooltip: React.FC<IProps> = ({
</Popover>
}
>
<FiHelpCircle fontSize={size ? size : undefined} className="blue" />
<FiHelpCircle fontSize={size} className="blue" />
</OverlayTrigger>
</div>
</div>
Expand Down
9 changes: 2 additions & 7 deletions app/frontend/components/forms/SwayFormCheckbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,9 @@ const SwayFormCheckbox: React.FC<IProps> = ({ field, value }) => {
const { handleChange } = useFormikContext();
return (
<>
<Form.Label className="mr-2">{`${field.label} - ${value}`}</Form.Label>
<Form.Label className="me-2">{`${field.label} - ${value}`}</Form.Label>
&nbsp;
<Form.Check
type={"checkbox"}
className="p-2"
name={field.name}
onChange={handleChange}
/>
<Form.Check type={"checkbox"} className="p-2" name={field.name} onChange={handleChange} />
</>
);
};
Expand Down
3 changes: 2 additions & 1 deletion app/frontend/components/user/AddressAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const Autocomplete: React.FC<IProps> = ({ field, error, setLoading }) => {
} = suggestion;

return (
<ListGroup.Item key={place_id} onClick={handleSelect(suggestion)}>
<ListGroup.Item key={place_id} onClick={handleSelect(suggestion)} className="text-start">
<strong>{main_text}</strong> <small>{secondary_text}</small>
</ListGroup.Item>
);
Expand Down Expand Up @@ -165,6 +165,7 @@ const Autocomplete: React.FC<IProps> = ({ field, error, setLoading }) => {
};

const AddressAutocomplete: React.FC<IProps> = (props) => {
logDev("AddressAutocomplete.googleMapsApiKey -", import.meta.env.VITE_GOOGLE_MAPS_API_KEY);
const { isLoaded } = useJsApiLoader({
googleMapsApiKey: import.meta.env.VITE_GOOGLE_MAPS_API_KEY as string,
libraries: GOOGLE_MAPS_LIBRARIES,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as webauthnJson from "@github/webauthn-json";

import { useAxios_NOT_Authenticated_POST_PUT } from "app/frontend/hooks/useAxios";
import { handleError } from "app/frontend/sway_utils";
import { handleError, logDev } from "app/frontend/sway_utils";
import { PublicKeyCredentialRequestOptionsJSON } from "node_modules/@github/webauthn-json/dist/types/basic/json";
import { useCallback, useState } from "react";
import { sway } from "sway";
Expand Down Expand Up @@ -62,6 +62,10 @@ export const useWebAuthnAuthentication = (onAuthenticated: (user: sway.IUser) =>
.then((result) => {
setLoading(false);
if (result) {
logDev(
"useWebAuthnAuthentication.verifyAuthentication.verify - Verified Auth. Calling onAuthenticated with result -",
result,
);
onAuthenticated(result as sway.IUser);
}
return result;
Expand Down
5 changes: 4 additions & 1 deletion app/frontend/pages/Passkey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ const Passkey: React.FC = () => {
logDev("Passkey.tsx");

const onAuthenticated = useCallback((user: sway.IUser) => {
if (!user) return;
if (!user) {
logDev("Passkey.onAuthenticated - No user returned.");
return;
}

if (user.isRegistrationComplete) {
router.visit(ROUTES.legislators);
Expand Down
2 changes: 1 addition & 1 deletion docker/dockerfiles/production.alpine.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUBY_VERSION=3.3.2
ARG RUBY_VERSION=3.3.5
FROM registry.docker.com/library/ruby:$RUBY_VERSION-alpine AS base

LABEL fly_launch_runtime="rails"
Expand Down
7 changes: 4 additions & 3 deletions docker/dockerfiles/production.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUBY_VERSION=3.3.2
ARG RUBY_VERSION=3.3.5
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base

LABEL fly_launch_runtime="rails"
Expand All @@ -21,13 +21,14 @@ RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
build-essential \
libsqlite3-0 \
pkg-config \
nodejs \
npm && \
npm \
pkg-config && \
apt-get clean

# Install application gems
COPY Gemfile Gemfile.lock package.json package-lock.json ./
COPY gemfiles/rubocop.gemfile gemfiles/rubocop.gemfile
RUN bundle config set build.sqlite3 "--with-sqlite-cflags='-DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_PAGE_SIZE=16384 -DSQLITE_DQS=0 -DSQLITE_ENABLE_FTS5 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_USE_ALLOCA'" && \
bundle install && \
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
Expand Down

0 comments on commit 1eb0d89

Please sign in to comment.