Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Gias/search view #540

Merged
merged 84 commits into from
Jul 17, 2023
Merged

Gias/search view #540

merged 84 commits into from
Jul 17, 2023

Conversation

14slash12
Copy link
Contributor

@14slash12 14slash12 commented Apr 6, 2023

⚠️ IMPORTANT NOTE ⚠️

First the GIAS/API branch needs to be merged into development which can be done with pull request #536. ✅ The design is subject to change - functionality is final.


Issue

Implements a the new GIAS (Global In-App Search) across all the data types. This includes a new view containing all the searchable types like Grades, Movies, etc. This includes some refactoring of some ViewModels and Views to make the integration possible.

Screenshots

…ws to display the results from the query the user entered, but always going back to the HomeView/WidgetView by canceling the search.
…entataion of how likely the category/data type was searched for
…algorithm to search across all properties of each grade
…documentation with DocC. Refactoring the UI.
…g each result by data type and the heighest match, i.e. if a grade has the best levensheit distance all grades are displayed first
…toring into multiple files to have a better overview
…hing levenshtein distance, but rather each one by ascending order. E.g. GradeA has for token ['grade','ott'] the two best levenshtein distances of [0, 71] and GradeB has [0, 78] -> GradeA is better than GradeB.
… struct EventSearchResult and creating a new CalendarService for API fetches
…exists)

Additionally, the algorithm for calculating the bestRelativeLevenshteinDistance was changed to the normalized Levenshtein Distance (see https://ieeexplore.ieee.org/document/4160958)
… were previously not shown, i.e. the onChange(for:query) in each view did not get trigged. So each SearchResultView gets a onAppear to trigger the searching in each View even if the View was previously not on the screen, but now is due to a change in the query.

2) Added the RoomFinder and the LectureSearch to the GIAS
…ne MainAPI enum independent of the API (TUMCabe, TUMOnline, CampusOnline, etc.), the respective data type which (i.e. Grades, Movie, StudyRoom, etc.) and independent of the decoder (XML or JSON).
…o be used with the newly created method makeRequest<T,S> in the enum MainAPI
…um and the new API. This includes, that Calendar now shows the error screen, if the fetching failed
… to the async-await-pattern, and the state-enum and handling errors properly
… new API, including async-await pattern and many many adjustments alongside.
@14slash12 14slash12 marked this pull request as ready for review April 10, 2023 16:57
…e with the flickering MenuView due to too many async calls when fetching the DishesLabels; Old Roomfinder is in this commit still used for GIAS (Global In-App Search)
…en was invalid then the token is activated. A forced refresh is necessary to retrieve the current token activation status
Copy link
Contributor

@Antonwy Antonwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most essential points

  • For consistent mock/preview data, use either an external JSON or Swift file.
  • Utilise custom ViewModifiers or Decorators to enhance your views.
  • Enum failed state vs hasState variable → are both necessary?

Other than that, looks really good!

→ It would be helpful if someone else could review this pull request as well, as I am not that familiar with the codebase.

@14slash12 14slash12 requested a review from Antonwy May 24, 2023 09:27
@timothymaxwellsummers timothymaxwellsummers merged commit 875fbb2 into development Jul 17, 2023
@timothymaxwellsummers timothymaxwellsummers deleted the GIAS/SearchView branch July 17, 2023 14:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants