Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Conversation

@nick-skriabin
Copy link
Member

@nick-skriabin nick-skriabin commented Oct 27, 2022

This PR provides two fixes for the memory-intensive cases:

  • large taxonomy with in-config choices
  • large taxonomy within repeater with dynamic children

for the first case the fix will work automatically

for the second case a special attribute was introduced called sharedStore. it accepts a string identifier:

<View>
  <Header size="10">Document ID: $document_id</Header>
  <Repeater indexFlag="{{idx}}" on="$images" mode="pagination">
    <View style="display: flex; margin-bottom: 10px;">
      <Image maxHeight="auto" name="page_{{idx}}" value="$images[{{idx}}].url"/>

      <RectangleLabels name="taxonomy_{{idx}}" toName="page_{{idx}}">
        <Label alias="taxonomy" background="#B2CDFE" selectedColor="#74A7FE" value="Primary taxonomy">
        </Label>
        <Label alias="taxonomy_other" background="#F9AEC8" selectedColor="#FF7FAC" value="Other taxonomies">
        </Label>
      </RectangleLabels>

      <Taxonomy name="categories_{{idx}}" perRegion="true" toName="page_{{idx}}" visibleWhen="region-selected" whenLabelValue="taxonomy" value="$categories" sharedStore="categories"/>
      <Taxonomy name="taxonomy_other_{{idx}}" perRegion="true" toName="page_{{idx}}" visibleWhen="region-selected" whenLabelValue="taxonomy_other" value="$other" sharedStore="taxonomy_other"/>
    </View>
  </Repeater>
</View>

@swarmia
Copy link

swarmia bot commented Oct 27, 2022

@nick-skriabin nick-skriabin merged commit 6661a8a into master Nov 3, 2022
@nick-skriabin nick-skriabin deleted the fb-dev-3617 branch November 3, 2022 11:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants