diff --git a/src/framework/processing/py/port/script.py b/src/framework/processing/py/port/script.py index 9b8f2a89..1e064b4b 100644 --- a/src/framework/processing/py/port/script.py +++ b/src/framework/processing/py/port/script.py @@ -168,7 +168,16 @@ def generate_consent_prompt(*args: pd.DataFrame) -> props.PropsUIPromptConsentFo "en": f"The contents of your zipfile contents (Table {index + 1}/{len(args)})", "nl": "De inhoud van uw zip bestand" }) - tables.append(props.PropsUIPromptConsentFormTable(f"zip_contents_{index}", table_title, df)) + wordcloud = { + "title": { + "en": "You can also add visualizations", + "nl": "You can also add visualizations" + }, + "type": "wordcloud", + "textColumn": "File name", + "tokenize": True, + } + tables.append(props.PropsUIPromptConsentFormTable(f"zip_contents_{index}", table_title, df, visualizations=[wordcloud])) return props.PropsUIPromptConsentForm( tables, diff --git a/src/framework/types/elements.ts b/src/framework/types/elements.ts index f8e62bf7..fd828dfa 100644 --- a/src/framework/types/elements.ts +++ b/src/framework/types/elements.ts @@ -9,7 +9,7 @@ export type PropsUI = | PropsUICheckBox | PropsUIRadioItem | PropsUISpinner - | PropsUIProgress + | PropsUIProgressBar | PropsUIHeader | PropsUITable | PropsUISearchBar @@ -323,14 +323,15 @@ export function isPropsUISpinner(arg: any): arg is PropsUISpinner { return isInstanceOf(arg, "PropsUISpinner", ["color", "spinning"]) } -// PROGRESS -export interface PropsUIProgress { - __type__: "PropsUIProgress" +// PROGRESS BAR + +export interface PropsUIProgressBar { + __type__: 'PropsUIProgressBar' percentage: number } -export function isPropsUIProgress(arg: any): arg is PropsUIProgress { - return isInstanceOf(arg, "PropsUIProgress", ["percentage"]) +export function isPropsUIProgress (arg: any): arg is PropsUIProgressBar { + return isInstanceOf(arg, 'PropsUIProgressBar', ['percentage']) } // Header diff --git a/src/framework/visualisation/react/ui/prompts/consent_form.tsx b/src/framework/visualisation/react/ui/prompts/consent_form.tsx index 9a465230..6a09e6df 100644 --- a/src/framework/visualisation/react/ui/prompts/consent_form.tsx +++ b/src/framework/visualisation/react/ui/prompts/consent_form.tsx @@ -211,26 +211,26 @@ function prepareCopy({ donateQuestion, donateButton, description, locale }: Prop description: Translator.translate(description ?? defaultDescription, locale), donateQuestion: Translator.translate(donateQuestion ?? defaultDonateQuestionLabel, locale), donateButton: Translator.translate(donateButton ?? defaultDonateButtonLabel, locale), - cancelButton: Translator.translate(cancelButtonLabel, locale), + cancelButton: Translator.translate(defaultCancelButtonLabel, locale), } } -const donateQuestionLabel = new TextBundle() +const defaultDonateQuestionLabel = new TextBundle() .add('en', 'Do you want to donate the above data?') .add('de', 'Möchten Sie die oben genannten Daten spenden?') .add('nl', 'Wilt u de bovenstaande gegevens doneren?') -const donateButtonLabel = new TextBundle() +const defaultDonateButtonLabel = new TextBundle() .add('en', 'Yes, donate') .add('de', 'Ja, spenden') .add('nl', 'Ja, doneer') -const cancelButtonLabel = new TextBundle() +const defaultCancelButtonLabel = new TextBundle() .add('en', 'No') .add('de', 'Nein') .add('nl', 'Nee') -const description = new TextBundle() +const defaultDescription = new TextBundle() .add('en', 'Determine whether you would like to donate the data below. Carefully check the data and adjust when required. With your donation you contribute to the previously described research. Thank you in advance.') .add('de', 'Legen Sie fest, ob Sie die untenstehenden Daten spenden möchten. Überprüfen Sie die Daten sorgfältig und passen Sie sie bei Bedarf an. Mit Ihrer Spende tragen Sie zur zuvor beschriebenen Forschung bei. Vielen Dank im Voraus.') .add('nl', 'Bepaal of u de onderstaande gegevens wilt doneren. Bekijk de gegevens zorgvuldig en pas zo nodig aan. Met uw donatie draagt u bij aan het eerder beschreven onderzoek. Alvast hartelijk dank.')