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

[FAU-404] Increase API fetch timeout #35

Merged
merged 5 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Expand the admission requirements filter to include the "Admission free with restriction" option.
- Support filter reordering based on the `filters` attribute in the search shortcode.
- Support `ids` attribute in the search shortcode.
- Support `ids` attribute in the search shortcode to restrict search results by Campo Keys.
- Support `german-language-skills-for-international-students` attribute in the search shortcode to restrict search results by language skills.
- Support `hide` attribute in the search shortcode to hide the heading (`heading`) or search form (`search`).

### Changed

- Dynamically load degree program search results when selecting checkboxes or typing a search term.
- Only the title, subtitle, and field "What is the degree program about?" are indexed for searching.
- Increase timout limit when synchronizing data from the providing website.
tyrann0us marked this conversation as resolved.
Show resolved Hide resolved

### Fixed

Expand Down
26 changes: 13 additions & 13 deletions docs/degree_programs_search_shortcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ See below for a list of supported attributes.

## List of supported filters

| Filter | Description | Accepted values (if used as a pre-applied filter) |
|-------------------------|-------------------------------------------------------------------------|---------------------------------------------------|
| `admission-requirement` | Admission requirements filter | Not available |
| `area-of-study` | Area of study filter | Comma-separated term names |
| `attribute` | Attribute filter | Comma-separated term names |
| `degree` | Degree filter | Comma-separated term names |
| `faculty` | Faculty filter | Comma-separated term names |
| `german-language-skills-for-international-students` | German language skills for international students filter | Comma-separated term names |
| `search` | Search keyword filter (explicitly added by default, no need to include) | Not available |
| `semester` | Semester filter | Comma-separated term names |
| `study-location` | Study location filter | Comma-separated term names |
| `subject-group` | Subject group filter | Comma-separated term names |
| `teaching-language` | Teaching language filter | Comma-separated term names |
| Filter | Description | Accepted values (if used as a pre-applied filter) |
|-----------------------------------------------------|-------------------------------------------------------------------------|---------------------------------------------------|
| `admission-requirement` | Admission requirements filter | Not available |
| `area-of-study` | Area of study filter | Comma-separated term names |
| `attribute` | Attribute filter | Comma-separated term names |
| `degree` | Degree filter | Comma-separated term names |
| `faculty` | Faculty filter | Comma-separated term names |
| `german-language-skills-for-international-students` | German language skills for international students filter | Comma-separated term names |
| `search` | Search keyword filter (explicitly added by default, no need to include) | Not available |
| `semester` | Semester filter | Comma-separated term names |
| `study-location` | Study location filter | Comma-separated term names |
| `subject-group` | Subject group filter | Comma-separated term names |
| `teaching-language` | Teaching language filter | Comma-separated term names |

## List of elements that can be hidden

Expand Down
13 changes: 7 additions & 6 deletions src/Infrastructure/ApiClient/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ final class ApiClient
{
private const API_HOST = 'https://meinstudium.fau.de';

private array $headers;
private array $defaultArgs;

public function __construct(
private LoggerInterface $logger
) {

$this->headers = [
'Accept' => 'application/json',
$this->defaultArgs = [
'headers' => [
'Accept' => 'application/json',
],
'timeout' => 15,
];
}

Expand All @@ -39,9 +42,7 @@ public function get(string $path, array $queryArgs = [], array $args = []): ?Rem
$requestUrl,
wp_parse_args(
$args,
[
'headers' => $this->headers,
]
$this->defaultArgs
)
);

Expand Down