diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 00000000..228c3a7f
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,27 @@
+name: Test
+
+on:
+ push:
+ branches: [ v2 ]
+ pull_request:
+ branches: [ v2 ]
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+jobs:
+ # This workflow contains a single job called "build"
+ build:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [ubuntu-latest]
+ python-version: [3.11.3]
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Check typos in code
+ run: |
+ echo "Checking typos in code"
+ pip3 install typos
+ typos
\ No newline at end of file
diff --git a/.typos.toml b/.typos.toml
new file mode 100644
index 00000000..2fcf122b
--- /dev/null
+++ b/.typos.toml
@@ -0,0 +1,8 @@
+[default]
+extend-ignore-identifiers-re = [
+ "Longe",
+ "servie",
+ "admn",
+ "Brocoli",
+ "sur"
+]
\ No newline at end of file
diff --git a/README.md b/README.md
index f681c35e..40295791 100644
--- a/README.md
+++ b/README.md
@@ -12,17 +12,17 @@ For Ubuntu, see [Setting up the backend (postgraphile) on Ubuntu](../../wiki/Set
The mealplanner project can be built and run using docker-compose on platforms that support Docker (Linux, MacOS, Windows 10)
-In the main project directory there is a docker-compose.yml file that will build and run three containers: postgres, graphl backend and the frontend application. The postgres container uses a standard psotgres image from docker hub, the other two will be built on top of the node:12 container. The Dockerfiles in the backend and meal-planner-fredericton-ui directories decribe the builds.
+In the main project directory there is a docker-compose.yml file that will build and run three containers: postgres, graphl backend and the frontend application. The postgres container uses a standard psotgres image from docker hub, the other two will be built on top of the node:12 container. The Dockerfiles in the backend and meal-planner-fredericton-ui directories describe the builds.
### Pre-requisites
-Before composing the application you must ensure that Docker is installed and functioning. A quick check is to run `docker version` on the command line to see if you get any output. If you get an error, see the Docker set up for your platfrom.
+Before composing the application you must ensure that Docker is installed and functioning. A quick check is to run `docker version` on the command line to see if you get any output. If you get an error, see the Docker set up for your platform.
- Ubuntu - this should be as simple as `sudo apt install docker docker-compose docker.io python3-docker python3-dockerpty` . To enable Docker access for the current user, run the following command in the terminal: `sudo usermod -a -G docker $USER`. It's important to note that after running the command, you need to log out and log back in for the changes to take effect.
- MacOS [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/)
- Windows 10 [Docker Desktop for Windows 10](https://docs.docker.com/docker-for-windows/install/)
-It is recomended to perform the install and "getting started" steps for Docker Desktop before proceeding.
+It is recommended to perform the install and "getting started" steps for Docker Desktop before proceeding.
## Important Notice
@@ -39,7 +39,7 @@ If you are running a Linux distribution, Docker can be installed directly from t
Please refer to the official documentation or community resources specific to your Linux distribution for guidance on installing and managing Docker and KVM.
-Now that Docker is available, set up the environment for the composed applications. In the main project folder, where the `docker-compose.yml` file is, create a file named `.env` and add two variables to it. These are a databse password and a token secret. Both should be treated like passwords and should be reasonably unique and random. This is and example (please don't use these passwords, create your own):
+Now that Docker is available, set up the environment for the composed applications. In the main project folder, where the `docker-compose.yml` file is, create a file named `.env` and add two variables to it. These are a database password and a token secret. Both should be treated like passwords and should be reasonably unique and random. This is and example (please don't use these passwords, create your own):
```
POSTGRES_PASSWORD=databasepassword
@@ -66,7 +66,7 @@ docker-compose up --build
```
### populating sample data
-On the initial build and startup, the database will be completely empty. There won't even be an account created for logging in. To populate the databse with a handful of users and some recipe material run the appropriate version of the following docker-compose commands to seed the database.
+On the initial build and startup, the database will be completely empty. There won't even be an account created for logging in. To populate the database with a handful of users and some recipe material run the appropriate version of the following docker-compose commands to seed the database.
On Linux or MacOS:
@@ -83,7 +83,7 @@ Get-Content .\backend\seed.sql | docker-compose exec -T db /usr/bin/psql -U post
```
-Pay careful attention to the output as it will include the randomly generated passwords for the defaul users. This will look something like the following but the passwords will be unique each time:
+Pay careful attention to the output as it will include the randomly generated passwords for the default users. This will look something like the following but the passwords will be unique each time:
```
BEGIN
diff --git a/admin-ui/src/Nutrition/NutritionForm.tsx b/admin-ui/src/Nutrition/NutritionForm.tsx
index a803cc45..99032ff7 100644
--- a/admin-ui/src/Nutrition/NutritionForm.tsx
+++ b/admin-ui/src/Nutrition/NutritionForm.tsx
@@ -58,9 +58,9 @@ export const NutritionForm = () => {
-
-
-
+
+
+
diff --git a/admin-ui/src/Nutrition/NutritionList.tsx b/admin-ui/src/Nutrition/NutritionList.tsx
index ae8f3007..1535dab8 100644
--- a/admin-ui/src/Nutrition/NutritionList.tsx
+++ b/admin-ui/src/Nutrition/NutritionList.tsx
@@ -57,9 +57,9 @@ const Details = () => {
-
-
-
+
+
+
diff --git a/admin-ui/src/Nutrition/NutritionShow.tsx b/admin-ui/src/Nutrition/NutritionShow.tsx
index 3ef1c968..79ed5a6f 100644
--- a/admin-ui/src/Nutrition/NutritionShow.tsx
+++ b/admin-ui/src/Nutrition/NutritionShow.tsx
@@ -22,9 +22,9 @@ export const NutritionShow = () => {
-
-
-
+
+
+
diff --git a/backend/004-meal.sql b/backend/004-meal.sql
index 35f4ded0..b2aec63b 100644
--- a/backend/004-meal.sql
+++ b/backend/004-meal.sql
@@ -33,7 +33,7 @@ comment on column app.meal.name_fr is 'Short name or title in French';
comment on column app.meal.tags is 'A list of tags (strings) used to apply attributes to the Meal/recipe. May include things like "vegetarian" or "contains peanuts" to facilitate filtering and matching with user''s dietrary needs and so forth. Tag values are determined by the user.';
comment on column app.meal.description_en is 'Longer form description of the recipe to complement the name, in English';
comment on column app.meal.description_fr is 'Longer form description of the recipe to complement the name, in French';
-comment on column app.meal.categories is 'Categories for which this Meal is appropriate. This is used to restrict Categories to which a Meal may be assigned within a Meal Plan. These iclude "Breakfast", "Lunch", "Dinner", "Snack"';
+comment on column app.meal.categories is 'Categories for which this Meal is appropriate. This is used to restrict Categories to which a Meal may be assigned within a Meal Plan. These include "Breakfast", "Lunch", "Dinner", "Snack"';
comment on column app.meal.photo_url is '??';
comment on column app.meal.video_url is '??';
comment on column app.meal.method is 'The instructions for preparing the recipe, usually in point form. Plain text formatting determined by the user.';
diff --git a/backend/example_query_annotated.sql b/backend/example_query_annotated.sql
index 3de1ffeb..afdceac2 100644
--- a/backend/example_query_annotated.sql
+++ b/backend/example_query_annotated.sql
@@ -18,7 +18,7 @@ with meals_arr as (
)
) as "@nodes"
from "app"."meal_products"(meals_rel) as products_rel -- this is a function call
- where (TRUE) and (TRUE) -- totally superflous
+ where (TRUE) and (TRUE) -- totally superfluous
),
products_arr_data as (
select json_agg(
diff --git a/backend/migrations/001-241-meal-plan-entry-policy.sql b/backend/migrations/001-241-meal-plan-entry-policy.sql
index 9dd9f9ff..49f452b3 100644
--- a/backend/migrations/001-241-meal-plan-entry-policy.sql
+++ b/backend/migrations/001-241-meal-plan-entry-policy.sql
@@ -38,7 +38,7 @@ create policy all_meal_plan_entry_meal_designer
for all
to app_meal_designer using(true);
--- user can only see or update entries beloning to their own meal plans
+-- user can only see or update entries belonging to their own meal plans
-- IMPORTANT: the row level policy on meal_plan must be in place for this to work
drop policy if exists all_meal_plan_entry_user on app.meal_plan_entry;
create policy all_meal_plan_entry_user
diff --git a/mealplanner-ui/README.md b/mealplanner-ui/README.md
index 3124c26f..54df1a6b 100644
--- a/mealplanner-ui/README.md
+++ b/mealplanner-ui/README.md
@@ -60,11 +60,11 @@ In Version 2 of meal planner,we are using TypeScript and updated version of Rela
Upgrading Relay as we are going to use hooks such as PreLoadedQuery as the version 9.1.0 used in the current code doesn’t support.
1. DashBoard
- 1. Dashboard component will be simplifed by extracting them as different components
+ 1. Dashboard component will be simplified by extracting them as different components
1. QueryRenderer and Refetch container becomes PreloadedQuery in Dashboard component.
2. The people filter menu will be its own component with its associated fragment.
3. DeleteDialog - use `@deleteEdge` on the commit mutation to automatically drop the edge and avoid a refetch.
- 2. Extract selected person into its own local state. (Implementing state using Relay - commitLocalUpdate and seperate graphQL file for state extending the Query type.)
+ 2. Extract selected person into its own local state. (Implementing state using Relay - commitLocalUpdate and separate graphQL file for state extending the Query type.)
3. If and when pagination is implemented this client side filter will break i.e. if the record is not present for that user in the first page, but in the subsequent pages, it will show as no records found. So we need to use the condition in graphQL and refetch when the peoplefilter changes.
2. Mealplan page
1. Create Plan option: a better name would be meal selector.
@@ -77,10 +77,10 @@ Upgrading Relay as we are going to use hooks such as PreLoadedQuery as the versi
4. MealplansToolbar - It unnecessarily queries all the fields on the meal plan while it displays only the meal plan name and the user name. So query needs to be modified to include only the meal plan name and username.
5. CreatePlanTable - should contain the meal plan entry details for the current meal plan. As of now that part of the query fragment is in MealplansToolbar.
6. Create a type for global state to include isCreateMPModalOpen, isDuplicateMPModalOpen, createMPConfig, duplicateMPConfig instead of using local state such as newModalOpen and selectedPlan controlled by the toolbar so that eventually we avoid prop drilling. Remove unnecessary states such as alreadySelectedMealAfterNav.
- 7. New, Duplicate, Save is as 3 different buttons in the current release. This can all be combined to one. There can be just one modal which gives the option for the new meal plan which offers existing meal plan as template option and the other as from scratch. We can save as an when the meal is getting dropped instead of having a seperate save button.
+ 7. New, Duplicate, Save is as 3 different buttons in the current release. This can all be combined to one. There can be just one modal which gives the option for the new meal plan which offers existing meal plan as template option and the other as from scratch. We can save as an when the meal is getting dropped instead of having a separate save button.
8. MealplansToolbar - We will use the mealplan ID in the url and avoid using useLocation and useEffect. Instead we can use useParams.
9. MealPlanAssignment - This assigns users. mutation will move from PlanPage to MealPlanAssignment and eliminating the need of a save button or props drilling. This will also read from the global state.
- 10. Duplicate meal plan is going part of new meal plan itself as an option to select mealplan from a template rather than a seperate button.
+ 10. Duplicate meal plan is going part of new meal plan itself as an option to select mealplan from a template rather than a separate button.
11. The mutation of NewMealPlanModal is containing mealplan entries which is not available in a new mealplan. We need not query for it. NewMealPlanModal is in MealplanToolbar, but it should be in PlanPage.
12. In Delete functionality as of now I am doing relay.refetch(). This can be avoided with `@deleteEdge` with connections.
13. createMealPlanEntry is creating an array of promises and making so many network calls in a single SAVE button click. However we can push those entries to the database as and when it is created. This would eliminate requirement for mealEntryAlreadyExists, mealEntryHasBeenRemoved.
diff --git a/mealplanner-ui/src/App.tsx b/mealplanner-ui/src/App.tsx
index 3c12d699..a76a3211 100644
--- a/mealplanner-ui/src/App.tsx
+++ b/mealplanner-ui/src/App.tsx
@@ -43,13 +43,13 @@ const theme = createTheme({
initState();
function App() {
- let [intialized, setInitialized] = useState(false);
+ let [initialized, setInitialized] = useState(false);
useEffect(() => {
fetchCurrentPerson().then(() => {
setInitialized(true);
});
}, []);
- if (!intialized) {
+ if (!initialized) {
return
loading...
;
}
diff --git a/mealplanner-ui/src/pages/MealPlans/Calendar.tsx b/mealplanner-ui/src/pages/MealPlans/Calendar.tsx
index bcd9b24e..295ad2e1 100644
--- a/mealplanner-ui/src/pages/MealPlans/Calendar.tsx
+++ b/mealplanner-ui/src/pages/MealPlans/Calendar.tsx
@@ -6,7 +6,7 @@ import { DesktopCalendar } from "./DesktopCalendar";
import { MobileCalendar } from "./MobileCalendar";
import { Calendar_mealPlan$key } from "./__generated__/Calendar_mealPlan.graphql";
-// Refered https://relay.dev/docs/guided-tour/list-data/updating-connections/ documentation for @connection, __id
+// Referred https://relay.dev/docs/guided-tour/list-data/updating-connections/ documentation for @connection, __id
// The example does not work exactly. It threw errors that first or last should be included
// The second error was edges was missing
// Complained Calendar_mealPlan_mealPlanEntries_connection should be Calendar_mealPlan_mealPlanEntries