Skip to content

Commit

Permalink
Revert "[OSDEV-360] Facility Search. Make it easier to search for gro…
Browse files Browse the repository at this point in the history
…ups of related sectors (BE)" (#298)

Reverts #285
  • Loading branch information
mazursasha1990 authored Jul 23, 2024
1 parent faae273 commit 55de881
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 335 deletions.
8 changes: 1 addition & 7 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,9 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
### Database changes
#### Migrations:
* 0151_replace_index_number_of_workers - replace function `index_number_of_workers` to use one source of truth for both`number_of_workers` & `extended_fields`.
* 0152_add_sector_group_table - creates the `SectorGroup` model and populates it with the sector groups names.
* 0153_associate_sectors_with_groups - associates sectors with sector groups.

#### Scheme changes
* [OSDEV-360](https://opensupplyhub.atlassian.net/browse/OSDEV-360) - The following changes have been implemented:
* A new table, `api_sectorgroup`, has been introduced and populated with sector group names.
* A new field named `groups` has been added to the `Sector` model to establish a many-to-many relationship between the `api_sector` and the `api_sectorgroup` tables.
* *Describe scheme changes here.*

### Code/API changes
* *Describe code/API changes here.*
Expand All @@ -31,12 +27,10 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
* [OSDEV-1145](https://opensupplyhub.atlassian.net/browse/OSDEV-1145) - Error message appearing as red dot with no context. Error display has been fixed. Simplified displaying logic of errors. Changed error property type.
* [OSDEV-576](https://opensupplyhub.atlassian.net/browse/OSDEV-576) - Implemented one source of truth to Search query source & Production Location Details page source for field `number_of_workers`.
* [OSDEV-1146](https://opensupplyhub.atlassian.net/browse/OSDEV-1146) - Fixed issue with missed header & data for Claim Decision column while downloaded Facility Claims data in xlsx format.

### What's new
* [OSDEV-1090](https://opensupplyhub.atlassian.net/browse/OSDEV-1090) - Claims. Remove extra product type field on Claimed Facility Details page.
* [OSDEV-273](https://opensupplyhub.atlassian.net/browse/OSDEV-273) - Facility Claims. Implement filtering by Country and Status. Set 'pending' claim status as a default filter.
* [OSDEV-1083](https://opensupplyhub.atlassian.net/browse/OSDEV-1083) - Implemented a 'toggle password visibility' feature in the login, registration, reset password and user profile forms.
* [OSDEV-360](https://opensupplyhub.atlassian.net/browse/OSDEV-360) - On the admin dashboard, functionality has been added to allow Admins to add, remove, or modify sector groups. In the `Sectors` tab, Admins can now adjust the related sector groups for each sector. Each sector must be associated with at least one group.
* The legacy `_template` API endpoint was disabled via the configuration file in favor of the new `_index_template` API endpoint, since the composable index template is used for OpenSearch. The `legacy_template` was set to `false` to start using the defined composable index template in the `production_locations.json` file. This change is necessary to avoid omitting the `production_locations.json` index template for the `production-locations` index defined in the Logstash app and to enforce the OpenSearch cluster to use the explicit mapping for the `production-locations` index.

### Release instructions:
Expand Down
9 changes: 0 additions & 9 deletions src/django/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from django.shortcuts import render
from django.urls import reverse
from django.utils.safestring import mark_safe
from api.models.sector_group import SectorGroup
from simple_history.admin import SimpleHistoryAdmin
from waffle.models import Flag, Sample, Switch
from waffle.admin import FlagAdmin, SampleAdmin, SwitchAdmin
Expand Down Expand Up @@ -178,13 +177,6 @@ class ExtendedFieldAdmin(admin.ModelAdmin):


class SectorAdmin(admin.ModelAdmin):
filter_horizontal = ('groups',)

def get_ordering(self, request):
return ['name']


class SectorGroupAdmin(admin.ModelAdmin):
def get_ordering(self, request):
return ['name']

Expand Down Expand Up @@ -213,6 +205,5 @@ class TileCacheAdmin(SimpleHistoryAdmin):
admin_site.register(models.RequestLog, RequestLogAdmin)
admin_site.register(models.ApiLimit, ApiLimitAdmin)
admin_site.register(models.Sector, SectorAdmin)
admin_site.register(SectorGroup, SectorGroupAdmin)
admin_site.register(models.TileCache, TileCacheAdmin)
admin_site.register(models.DynamicSetting)
70 changes: 0 additions & 70 deletions src/django/api/migrations/0152_add_sector_group_table.py

This file was deleted.

234 changes: 0 additions & 234 deletions src/django/api/migrations/0153_associate_sectors_with_groups.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/django/api/models/sector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@ class Sector(models.Model):

name = models.CharField(max_length=200, primary_key=True)

groups = models.ManyToManyField(
'SectorGroup',
blank=False,
related_name='sectors',
help_text='The sector groups to which this sector belongs.',
)

def __str__(self):
return self.name
8 changes: 0 additions & 8 deletions src/django/api/models/sector_group.py

This file was deleted.

0 comments on commit 55de881

Please sign in to comment.