-
Notifications
You must be signed in to change notification settings - Fork 9
[OSDEV-2305] Add LiwingWage indicator support to the platform #842
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
Merged
protsack-stephan
merged 26 commits into
main
from
OSDEV-2305-upload-the-wageindicator-data-into-the-platform
Dec 26, 2025
Merged
Changes from 17 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b91f2a0
Implemented basic wage indicator mapping logic
vladsha-dev 0344ae7
Refactored code
vladsha-dev 0df08d2
Merge branch 'main' into OSDEV-2305-upload-the-wageindicator-data-int…
vlad-shapik e688f10
Updated FE to render multiple links one under another. Added link tex…
vladsha-dev c980a9d
Added active and system_field flag for partner fields; added dynamic …
vladsha-dev 88638ae
Reworked validation for the PartnerField form; moved getting contribu…
vladsha-dev ad6a125
Created tests
vladsha-dev c479427
Handled coderabbit comments
vladsha-dev ebe486c
Updated release notes and naming
vladsha-dev 99b2838
Fixed tests
vladsha-dev d989054
Fixed tests
vladsha-dev 7083459
Fixed tests
vladsha-dev 5d5110d
Added prints to debug
vladsha-dev 6bddcd9
Added more prints
vladsha-dev fce929c
Fixed tests
vladsha-dev 1430956
Fixed tests
vladsha-dev 72d7691
Updated release notes
vladsha-dev f6ea4aa
Merge main
protsack-stephan 133a4b5
Change labels in the Django admin
protsack-stephan c9d716b
Cleanup admin.py file from unneeded comments
protsack-stephan a7d3419
Refacot the partner_field.py to be more readable
protsack-stephan 7947b5f
Fix review comments
protsack-stephan 57f221a
Fix linting issues
protsack-stephan 8e87a43
Fix the issue with base provider
protsack-stephan 024651d
Fix linting issues and change errors to warnings in logs
protsack-stephan 0134c9d
Merge branch 'main' of github.com:opensupplyhub/open-supply-hub into …
protsack-stephan 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 hidden or 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 hidden or 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
38 changes: 38 additions & 0 deletions
38
src/django/api/migrations/0190_add_active_system_field_to_partnerfield.py
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Generated by Django 3.2.17 on 2025-12-17 10:51 | ||
|
|
||
| from django.db.migrations import Migration, AddField | ||
| from django.db.models import BooleanField | ||
|
|
||
|
|
||
| class Migration(Migration): | ||
|
|
||
| dependencies = [ | ||
| ('api', '0189_add_base_url_and_text_field_to_partner_field'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| AddField( | ||
| model_name='partnerfield', | ||
| name='active', | ||
| field=BooleanField( | ||
| default=True, | ||
| help_text=( | ||
| 'Indicates if this partner field is active. ' | ||
| 'Inactive fields are not available for contributions and ' | ||
| 'will not appear in listings.' | ||
| ), | ||
| ), | ||
| ), | ||
| AddField( | ||
| model_name='partnerfield', | ||
| name='system_field', | ||
| field=BooleanField( | ||
| default=False, | ||
| help_text=( | ||
| 'Indicates if this is a system field. ' | ||
| 'System fields cannot be deleted and have restricted ' | ||
| 'editing.' | ||
| ), | ||
| ), | ||
| ), | ||
| ] |
77 changes: 77 additions & 0 deletions
77
src/django/api/migrations/0191_create_wage_indicator_partner_field.py
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Generated by Django 3.2.17 on 2025-12-17 11:19 | ||
|
|
||
| from django.db.migrations import Migration, RunPython | ||
|
|
||
|
|
||
| def create_wage_indicator_partner_field(apps, schema_editor): | ||
| '''Create wage_indicator partner field.''' | ||
| PartnerField = apps.get_model('api', 'PartnerField') | ||
|
|
||
| json_schema = { | ||
| '$schema': 'https://json-schema.org/draft/2020-12/schema', | ||
| 'type': 'object', | ||
| 'title': 'Wage indicator reference links', | ||
| 'properties': { | ||
| 'living_wage_link_national': { | ||
| 'type': 'string', | ||
| 'format': 'uri', | ||
| 'title': 'Living wage reference link (national language)' | ||
| }, | ||
| 'minimum_wage_link_english': { | ||
| 'type': 'string', | ||
| 'format': 'uri', | ||
| 'title': 'Minimum wage reference link (English)' | ||
| }, | ||
| 'minimum_wage_link_national': { | ||
| 'type': 'string', | ||
| 'format': 'uri', | ||
| 'title': 'Minimum wage reference link (national language)' | ||
| }, | ||
| 'living_wage_link_national_text': { | ||
| 'type': 'string', | ||
| 'title': 'Living wage link text (national language)' | ||
| }, | ||
| 'minimum_wage_link_english_text': { | ||
| 'type': 'string', | ||
| 'title': 'Minimum wage link text (English)' | ||
| }, | ||
| 'minimum_wage_link_national_text': { | ||
| 'type': 'string', | ||
| 'title': 'Minimum wage link text (national language)' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| source_by = ( | ||
| '<p>2024 Minimum Wage Benchmark sourced by ' | ||
| '<a href="https://wageindicator.org/" target="_blank" ' | ||
| 'title="WageIndicator">WageIndicator</a></p>' | ||
| ) | ||
|
|
||
| PartnerField.objects.create( | ||
| name='wage_indicator', | ||
| type='object', | ||
| source_by=source_by, | ||
| json_schema=json_schema, | ||
| system_field=True | ||
| ) | ||
|
|
||
|
|
||
| def reverse_wage_indicator_partner_field(apps, schema_editor): | ||
| '''Remove wage_indicator partner field.''' | ||
| PartnerField = apps.get_model('api', 'PartnerField') | ||
| PartnerField.objects.filter(name='wage_indicator').delete() | ||
|
|
||
|
|
||
| class Migration(Migration): | ||
|
|
||
| dependencies = [ | ||
| ('api', '0190_add_active_system_field_to_partnerfield'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| RunPython( | ||
| create_wage_indicator_partner_field, | ||
| reverse_wage_indicator_partner_field | ||
| ), | ||
| ] |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.