<commit_before>import {Component, Input, OnInit} from "@angular/core";
import { CatalogueLine } from "./model/publish/catalogue-line";
import {ItemProperty} from "./model/publish/item-property";
import {Property} from "./model/category/property";
import {Code} from "./model/publish/code";

@Component({
    selector: 'product-details',
    templateUrl: './product-details.component.html',
})

// Component that displays category and custom properties inside the "product details" tab in CatalogueLin

export class ProductDetailsComponent implements OnInit{

    PROPERTY_BLOCK_FIELD_NAME: string = "name";
    PROPERTY_BLOCK_FIELD_ISCOLLAPSED = "isCollapsed";
    PROPERTY_BLOCK_FIELD_PROPERTIES = "properties";

    @Input() catalogueLine: CatalogueLine;

    // list keeping the custom additional properties
    customProperties: ItemProperty[] = [];
    /*
     * hash storing the blocks of each category
     * For eClasses, base block is held at propertyBlocks[itemClassificationCode.value][0]
     * and specific block at propertyBlocks[itemClassificationCode.value][1]
     * For others, the block is held at propertyBlocks[itemClassificationCode.listID][0]
     */
    propertyBlocks: any = {};

    ngOnInit(): void {
        this.refreshPropertyBlocks();
    }

    refreshPropertyBlocks(): void {
        this.customProperties = [];
        this.propertyBlocks = {};

        // determine categories the item belongs to<commit_msg>refactor<commit_after>import {Component, Input, OnInit} from "@angular/core";
import { CatalogueLine } from "./model/publish/catalogue-line";
import {ItemProperty} from "./model/publish/item-property";
import {Property} from "./model/category/property";
import {Code} from "./model/publish/code";

@Component({
    selector: 'product-details',
    templateUrl: './product-details.component.html',
})

// Component that displays category and custom properties inside the "product details" tab in CatalogueLin

export class ProductDetailsComponent implements OnInit{

    PROPERTY_BLOCK_FIELD_NAME: string = "name";
    PROPERTY_BLOCK_FIELD_ISCOLLAPSED = "isCollapsed";
    PROPERTY_BLOCK_FIELD_PROPERTIES = "properties";

    @Input() catalogueLine: CatalogueLine;

    /*
     * hash storing the blocks of each category
     * For eClasses, base block is held at propertyBlocks[itemClassificationCode.value][0]
     * and specific block at propertyBlocks[itemClassificationCode.value][1]
     * For others, the block is held at propertyBlocks[itemClassificationCode.listID][0]
     */
    propertyBlocks: any = {};

    ngOnInit(): void {
        this.refreshPropertyBlocks();
    }

    refreshPropertyBlocks(): void {
        this.propertyBlocks = {};

        // determine categories the item belongs to
{'fraction_non_alphanumeric': 0.1084030556566024, 'fraction_numerical': 0.0021826118588577663, 'mean_word_length': 4.0366300366300365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4883939', 'n_tokens_mistral': 727, 'n_tokens_neox': 716, 'n_words': 204}