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

[frontend] fix link resolution for file export (#5466) #5472

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

labo-flg
Copy link
Member

@labo-flg labo-flg commented Jan 11, 2024

Proposed changes

  • Make sure all use of StixDomainObjectHeader have the right entity type set
  • resolveLink utility is now insensitive to capitalization of the entity type, to avoid future typo problems)

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

To test, go to a Country knowledge view > export (any format) and hit Create. You should properly redirected to the entity's data tab.

@labo-flg labo-flg self-assigned this Jan 11, 2024
@labo-flg labo-flg added the filigran team use to identify PR from the Filigran team label Jan 11, 2024
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6050df4) 66.24% compared to head (093441e) 66.24%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5472   +/-   ##
=======================================
  Coverage   66.24%   66.24%           
=======================================
  Files         508      508           
  Lines       59807    59807           
  Branches     4365     4366    +1     
=======================================
+ Hits        39619    39622    +3     
+ Misses      20188    20185    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SouadHadjiat
Copy link
Member

There is still this one which should be Administrative-Area :

<StixDomainObjectHeader
            entityType="administrativeArea"
            disableSharing={true}
            stixDomainObject={administrativeArea}
            PopoverComponent={
              <AdministrativeAreaPopover id={administrativeArea.id} />
            }
            enableQuickSubscription={true}
          />

@SouadHadjiat
Copy link
Member

Also, about the uppercase fix, I think it's better to put the right entity_type with the right case, or change the method to put everything in lowercase and lowercase the type.
Anyway I found country and city which are in lowercase here :

<StixDomainObjectHeader
            entityType="country"
            disableSharing={true}
            stixDomainObject={country}
            PopoverComponent={<CountryPopover id={country.id} />}
            enableQuickSubscription={true}
          />

<StixDomainObjectHeader
            entityType="city"
            disableSharing={true}
            stixDomainObject={city}
            PopoverComponent={<CityPopover id={city.id} />}
            enableQuickSubscription={true}
          />

@labo-flg
Copy link
Member Author

Yes you're right, let's use the right entity type, it makes much more sense.

@SamuelHassine SamuelHassine merged commit e2fb509 into master Jan 16, 2024
8 checks passed
@SamuelHassine SamuelHassine deleted the issue/5466 branch January 16, 2024 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants