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

"Facility has moved" banner does not appear after facilities are linked via Link ID page on dashboard #2385

Open
vrwOAR opened this issue Mar 15, 2023 · 6 comments
Labels
bug Something isn't working client action needed This ticket is blocked until additional information or a decision is provided by the client OSH_JIRA

Comments

@vrwOAR
Copy link
Member

vrwOAR commented Mar 15, 2023

Overview

The Link to New OS ID feature appears to not be working as it previously did with OAR.

Expected Behavior

When attempting to Link two OS IDs, both were entered into the page and submitted. The status updates on the Link ID page, however, the banner indicating that the facility has moved is not appearing on either facility. Here is an example of a moved facility from OAR with the banner update at the top of the page.

Actual Behavior

The facilities display as linked on the Link ID page, however, the banner does not appear reflecting their affiliation with one another.

Steps to Reproduce

  • Visit OS Hub dashboard
  • Link new OS ID page
  • Facility to link - MX20190834BJ041, then Search
  • New OS ID - MX20222177ZMHRR, then Search
  • Click Link Facility
  • Function processes and the Facility to Link's fields are updated to reflect new link -
  • Linked OS ID: MX20222177ZMHRR
  • Facility VF Owned Manufacturing - Acanceh at latitude 20.8418183 and longitude -89.4772479
  • Name: VF Owned Manufacturing - Acanceh
  • Address: Tablaje Catastral No. 2287 Petectunich No. 1 y Xcanchacan Acanceh Yucatan
  • Country: Mexico
  • Location: -89.4772479, 20.8418183
  • Contributors: 2 Brands / Retailers
  • Visit each facility's page to review updated "facility moved" banner
  • Facility to Link - no updated banner
  • New OS ID - no updated banner

Demo

Here's the legacy OAR example with the "Facility has moved" banner
American Textile Company - Tifton

Additional context

This bug stems from a contributor looking to move a listing of facilities. These can be utilized to test the functionality:

Facility to Link - Name Facility to Link - OS ID New OS ID - name New OS ID - link
VF Owned Manufacturing - Acanceh https://opensupplyhub.org/facilities/MX20190834BJ041 Kontoor Owned Manufacturing - Planta Acanceh https://opensupplyhub.org/facilities/MX20222177ZMHRR
VF Owned Manufacturing - Coyote https://opensupplyhub.org/facilities/MX2019083E6JXNM Kontoor Owned Manufacturing - Coyote Plant https://opensupplyhub.org/facilities/MX2022217NH1XHA
VF Owned Manufacturing - Izamal https://opensupplyhub.org/facilities/MX2019083H2GC4F Kontoor Owned Manufacturing - Planta Izamal https://opensupplyhub.org/facilities/MX2022217S15GAE
VF Owned Manufacturing - La Rosita https://opensupplyhub.org/facilities/MX2019083872QSX Kontoor Owned Manufacturing - La Rosita Plant https://opensupplyhub.org/facilities/MX2022217ZZQS14
VF Owned Manufacturing - San Pedro Garza Garcia https://opensupplyhub.org/facilities/MX2019093531FF4 Kontoor Owned Manufacturing - (Planta San Pedro) https://opensupplyhub.org/facilities/MX202221707FPZ0
VF Owned Manufacturing - Tekax https://opensupplyhub.org/facilities/MX201908340DD93 Kontoor Owned Manufacturing - Tekax https://opensupplyhub.org/facilities/MX2022217TRJJ6H
VF Owned Manufacturing - Torreon (JW) https://opensupplyhub.org/facilities/MX201908346CAKF Kontoor Owned Manufacturing - Torreon https://opensupplyhub.org/facilities/MX2022217S6QQTW
@vrwOAR vrwOAR added the bug Something isn't working label Mar 15, 2023
@jwalgran
Copy link
Contributor

@vrwOAR I looked up the code that decides when to shows this banner and it depends on the closure status of the facility. The banner is currently only shown when the facility is both closed and linked to a new facility

I confirmed this by looking at the two facilities mentioned in your description

The "Is Closed" field on this facility is "Unknown"
https://opensupplyhub.org/admin/api/facility/MX20190834BJ041

The "Is Closed" field on this facility is "Yes"
https://opensupplyhub.org/admin/api/facility/US2019192QZVF11/

To decide how to proceed with this issue we need to answer the following?

  • Is the current behavior ok? Does the MX20190834BJ041 facility just need to be reported and approved as closed?
  • If the MX20190834BJ041 is not closed, what does the creating a link between that facility and MX20222177ZMHRR represent?

@jwalgran jwalgran added the client action needed This ticket is blocked until additional information or a decision is provided by the client label Mar 15, 2023
@mariel-oar
Copy link

mariel-oar commented Mar 15, 2023

@jwalgran, @obrienad, this is another one that would be great if you all could take a look.

To summarize the issue:

More recently we have tried to move a facility to a new OS ID and the "moved banner" is not being displayed even though the "new OS ID" field is populated:

@jwalgran
Copy link
Contributor

@mariel-oar Looks like we were tying our responses at the same time. See my comment above. I added the client action needed label indicating that we need some answers to decided what needs to be done (maybe nothing).

@mariel-oar
Copy link

Thank you @jwalgran! We will discuss and circle back.

@mariel-oar
Copy link

@jwalgran, we marked the facility as closed on the backend, but are still not seeing the banner show up. We also went through the linking process again just in case the sequence has to be that it is moved after it is marked as closed.

one that should have banner: https://opensupplyhub.org/facilities/MX20190834BJ041
Django: https://opensupplyhub.org/admin/api/facility/MX20190834BJ041/change/?_changelist_filters=p%3D620

@jwalgran
Copy link
Contributor

Thanks for the additional detail. I revisited the code and the banner that shows closure/link status depends on the closure report workflow being completed. I expect that completing series of steps should result in the desired banner being correctly displayed on VF Owned Manufacturing - Acanceh

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working client action needed This ticket is blocked until additional information or a decision is provided by the client OSH_JIRA
Projects
None yet
Development

No branches or pull requests

3 participants