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

log menu_lang and country_code #18

Closed
martinheppner opened this issue May 18, 2023 · 5 comments
Closed

log menu_lang and country_code #18

martinheppner opened this issue May 18, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@martinheppner
Copy link
Contributor

martinheppner commented May 18, 2023

menu_lang is two characters long. It defines the language the visitor gets the surface, the menu shown in.
It can be one of these values: de, ch, fr, it, sl
(Attention! sl = SL)

country_code is two characters long. It defines the top level domain.
It can be one of these values: AT, DE, CH, FR, IT, SL
The country code is stored as UPPER carachters in the database, to distinguish the value from menu_lang.

Both values should be logged with each search of the user into the table "logsearchphrase". The click on a detail page for one hike, should not be logged there.
The existing comlumns should continue to be filled.

After this issue #17 can be implemented.

@martinheppner martinheppner added the enhancement New feature or request label May 18, 2023
@martinheppner
Copy link
Contributor Author

Tours.js in line 262 "const sql = `INSERT INTO logsearchphrase"

@martinheppner martinheppner self-assigned this Jun 2, 2023
@martinheppner martinheppner added this to the Drop Slovenia milestone Jun 2, 2023
@Falsal
Copy link
Collaborator

Falsal commented Jun 6, 2023

Q1:
so, menu_lang is one of de, ch, fr, it, sl
is "ch" a language ?

@Falsal
Copy link
Collaborator

Falsal commented Jun 7, 2023

Q2:
on Sunday's call we discussed this feature and we agreed that the storing of the record (menu_lang, country_code etc.) is done when the user actually makes a selection of a collection of the tours (i.e. clicks on the "GO" button , looks up a collection of tours that are displayed when moving to "main" page.
So this is case I , any other cases you see when we need to store info in the losearchphrase?

@Falsal
Copy link
Collaborator

Falsal commented Jun 7, 2023

the basic functionality is done, but there are related issues that we must agree on.
so :
on the client side , I am pulling the currLanguage inside loadTours.js in every exported function that returns "loadList" . In crudActions.js , added "language" in the arguments of the function then initialized it and then passed it as a param to the axios call.
On the backend side I have pulled out the language from the request : req.query.currLanguage , initialised it and added it to the sql query which is then passed as a knex raw call.
I had to take out the condition which was based on "search" not being undefined, this is because 'search' value (which is supposed to be the value from the input of search bar) is not reaching this line yet.

result:
now when clicking the GO button to go to Main.js to list the tours, the insert in table "logsearchphase" happens 2 times with the right data passed as expected.

next steps:
must agree on what conditions this table insert must occur.
must get input bar done before we then make sure it is arriving to the backend where "search" value is set.

So I will consider this issue complete and will move on to the client side related issue, so i can create the input in search bar.

@Falsal Falsal self-assigned this Jun 7, 2023
@Falsal
Copy link
Collaborator

Falsal commented Jun 14, 2023

next steps:
must agree, under what conditions this table insert occurs.
at the moment, every click on go button would cause an insert inside the table "logsearchphrase"

My opinion:
just before the call for insertion , check if the values have been added already using localStorage . (compared to current search value)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants