-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow to get suggestion labels in Northern Sami #18
Open
juhoinkinen
wants to merge
3
commits into
update-2024
Choose a base branch
from
add-saami-to-label-langs
base: update-2024
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -356,6 +356,7 @@ mainApp.component('project-select', { | |
}, | ||
computed: { | ||
vocabularyId() { | ||
// TODO: This is a hack. We should expose the vocabulary id from Annif API. | ||
// Assume vocabulary id is a prefix of project id | ||
if (this.selectedProject && this.selectedProject.project_id) { | ||
// Assume vocabulary id is a prefix of project id | ||
|
@@ -435,23 +436,44 @@ mainApp.component('limit-input', { | |
}) | ||
|
||
mainApp.component('language-select', { | ||
props: ['modelValue'], // modelValue: selected language | ||
props: ['modelValue', 'selected_project'], | ||
emits: ['update:modelValue'], | ||
computed: { | ||
vocabularyId() { | ||
// TODO: This is a hack. We should expose the vocabulary id from Annif API. | ||
// Why project is here the project_id string? | ||
// Assume vocabulary id is a prefix | ||
if (this.selected_project) { | ||
return this.selected_project.split("-")[0]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could not use camelCased name |
||
} | ||
return ''; | ||
}, | ||
disabledLanguages() { | ||
// Map of languages and their enabling criteria based on vocabularyId | ||
return { | ||
se: this.vocabularyId !== 'yso', // 'se' enabled only if vocabularyId is 'yso' | ||
}; | ||
} | ||
}, | ||
methods: { | ||
isOptionDisabled(language) { | ||
return this.disabledLanguages[language] || false; // Default to false if not specified in map | ||
} | ||
}, | ||
template: ` | ||
<label class="suggest-form-label form-label" for="label-language">{{ $t('language_select_label') }}</label> | ||
<div class="select-wrapper"> | ||
<select class="form-control" id="label-language" | ||
:value="modelValue" | ||
@change="$emit('update:modelValue', $event.target.value)" | ||
> | ||
<select class="form-control" id="label-language" :value="modelValue" | ||
@change="$emit('update:modelValue', $event.target.value)"> | ||
<option value="project-language">{{ $t('language_select_project') }}</option> | ||
<option value="fi">{{ $t('language_select_fi') }}</option> | ||
<option value="sv">{{ $t('language_select_sv') }}</option> | ||
<option value="en">{{ $t('language_select_en') }}</option> | ||
<option :disabled="isOptionDisabled('se')" value="se">{{ $t('language_select_sm') }}</option> | ||
</select> | ||
</div> | ||
` | ||
}) | ||
}); | ||
|
||
mainApp.component('result-list', { | ||
props: ['results', 'language', 'selected_project', 'projects'], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming
selected_project
toselectedProject
did not affect the props name on line 439.