Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 258x 258x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 567x 34x 34x 34x 34x 34x 34x 34x 34x 34x 391x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 281x 281x 281x 281x 281x 281x 281x 196x 281x 281x 281x 281x 281x 281x 18x 18x 263x 263x 263x 274x 299x 299x 299x 299x 299x 86x 42x 42x 42x 86x 299x 299x 299x 299x 34x 34x 34x 299x 263x 263x 263x 263x 76x 76x 76x 76x 76x 76x 64x 76x 263x 263x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 101x 101x 34x 34x 34x 34x 34x 34x 34x 34x 3x 3x 3x 3x 3x 34x 34x 34x 34x 34x 34x 34x 34x 34x 5x 5x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 34x 34x 34x 34x 34x 34x 34x 34x 34x 5x 5x 5x 5x 5x 5x 5x 5x 34x 34x 34x 34x 34x 34x 34x 34x 34x 3x 3x 3x 3x 3x 3x 3x 3x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 34x 34x 34x 34x 34x 34x 13x 15x 15x 15x 15x 15x 15x 15x 15x 10x 10x 10x 10x 10x 10x 15x 15x 15x 5x 5x 5x 5x 5x 5x 15x 15x 15x 15x 15x 15x 3x 3x 3x 3x 3x 3x 15x 15x 15x 10x 2x 2x 2x 2x 2x 2x 2x 10x 15x 13x 13x 34x 34x 34x 34x 34x 34x 34x 34x 34x 13x 1x 1x 12x 12x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 3x 3x 3x 1x 1x 2x 2x 2x 2x 2x 3x 1x 3x 3x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 1x 1x 1x 1x 1x 34x 34x 34x 34x 34x 34x 34x 1x 1x 1x 1x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 625x 625x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 247x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 34x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | <!--
WikiLambda Vue component - About Widget.
@copyright 2020– Abstract Wikipedia team; see AUTHORS.txt
@license MIT
-->
<template>
<wl-widget-base class="ext-wikilambda-app-about" data-testid="about-widget">
<!-- Widget header -->
<template #header>
{{ i18n( 'wikilambda-about-widget-title' ).text() }}
</template>
<template #header-action>
<cdx-button
v-if="isEditing && !edit"
class="ext-wikilambda-app-about__button-cancel"
action="default"
@click="resetEditState"
>
{{ i18n( 'wikilambda-cancel' ).text() }}
</cdx-button>
<cdx-button
v-if="isEditing && !edit"
class="ext-wikilambda-app-about__button-publish"
action="progressive"
@click="saveAllChanges"
>
{{ i18n( 'wikilambda-publishnew' ).text() }}
</cdx-button>
</template>
<!-- Widget main -->
<template #main>
<!-- Language accordion -->
<cdx-accordion
v-for="( displayLanguage, index ) in displayLanguages"
:key="displayLanguage.zid"
:ref="`block-${ index }`"
:action-icon="( canEditObject && !displayLanguage.edit ) ? iconEdit : null"
:open="displayLanguage.open"
class="ext-wikilambda-app-about__accordion"
action-always-visible
data-testid="about-language-accordion"
:action-button-label="i18n( 'wikilambda-about-widget-edit-button' ).text()"
@action-button-click="initializeEdit( index )"
@toggle="displayLanguage.open = $event"
>
<template #title>
{{ displayData[ index ].title }}
</template>
<template #description>
<span :class="accordionDescriptionClass( displayData[ index ].hasName )">
{{ displayData[ index ].name }}
</span>
</template>
<wl-about-language-block
:edit="displayLanguage.edit"
:language="displayLanguage.zid"
:is-function="isFunction"
:view-data="displayData[ index ].viewData"
:edit-data="displayLanguage.editData"
:field-langs="fieldLangs"
@update-edit-value="updateEditValue"
@change-value="saveFieldChange"
></wl-about-language-block>
</cdx-accordion>
<!-- Dialogs -->
<wl-about-languages-dialog
:open="showLanguagesDialog"
@add-language="addLanguage"
@close-dialog="showLanguagesDialog = false"
></wl-about-languages-dialog>
<wl-publish-dialog
v-if="!edit"
:show-dialog="showPublishDialog"
:submit-action="submitAction"
:success-callback="successCallback"
:error-callback="errorCallback"
@close-dialog="cancelPublish"
></wl-publish-dialog>
</template>
<!-- Widget footer -->
<template #footer>
<div class="ext-wikilambda-app-about__button-languages">
<cdx-button data-testid="languages-button" @click="showLanguagesDialog = true">
<cdx-icon :icon="iconLanguage"></cdx-icon>
{{ i18n( 'wikilambda-about-widget-language-count-button', languageCount ).text() }}
</cdx-button>
</div>
</template>
</wl-widget-base>
</template>
<script>
const { computed, defineComponent, inject, onMounted, ref, watch } = require( 'vue' );
const icons = require( '../../../../lib/icons.json' );
const Constants = require( '../../../Constants.js' );
const usePageTitle = require( '../../../composables/usePageTitle.js' );
const useMainStore = require( '../../../store/index.js' );
const ApiError = require( '../../../store/classes/ApiError.js' );
const urlUtils = require( '../../../utils/urlUtils.js' );
// Base components
const WidgetBase = require( '../../base/WidgetBase.vue' );
// Widget components
const AboutLanguageBlock = require( './AboutLanguageBlock.vue' );
const AboutLanguagesDialog = require( './AboutLanguagesDialog.vue' );
const PublishDialog = require( '../publish/PublishDialog.vue' );
// Codex components
const { CdxAccordion, CdxButton, CdxIcon } = require( '../../../../codex.js' );
module.exports = exports = defineComponent( {
name: 'wl-about-widget',
components: {
'cdx-accordion': CdxAccordion,
'cdx-button': CdxButton,
'cdx-icon': CdxIcon,
'wl-about-language-block': AboutLanguageBlock,
'wl-about-languages-dialog': AboutLanguagesDialog,
'wl-publish-dialog': PublishDialog,
'wl-widget-base': WidgetBase
},
props: {
edit: {
type: Boolean,
required: true
},
type: {
type: String,
required: true
}
},
emits: [ 'edit-multilingual-data', 'publish-multilingual-data', 'cancel-edit' ],
setup( props, { emit } ) {
const i18n = inject( 'i18n' );
const store = useMainStore();
const { updateZObjectPageTitle } = usePageTitle();
// Constants and configuration
const iconEdit = icons.cdxIconEdit;
const iconLanguage = icons.cdxIconLanguage;
// Language data
const displayLanguages = ref( [] );
/**
* Returns whether the current object is a function
*
* @return {boolean}
*/
const isFunction = computed( () => props.type === Constants.Z_FUNCTION );
/**
* Returns the available languages for each field
*
* @return {Object}
*/
const fieldLangs = computed( () => {
const { name, description, aliases, inputs } = store.getMultilingualDataLanguages;
return { name, description, aliases, inputs };
} );
/**
* Returns a list of all the language Zids that are present in
* the multilingual data collection (must have at least a name,
* a description, a set of aliases or an input label in case the
* object is a function).
*
* @return {Array}
*/
const allLangs = computed( () => store.getMultilingualDataLanguages.all );
/**
* Returns the count of the list of unique available languages
*
* @return {number}
*/
const languageCount = computed( () => allLangs.value.length );
/**
* Returns the list of fallback languages in their Zid
* representation, excluding the first (user selected language)
*
* @return {Array}
*/
const fallbackLanguageZids = computed( () => store.getFallbackLanguageZids.slice( 1 ) );
/**
* Returns the multilingual data for a given language
*
* @param {string} langZid
* @return {Object}
*/
function getMultilingualDataForLanguage( langZid ) {
const name = store.getZPersistentName( langZid );
const description = store.getZPersistentDescription( langZid );
const aliases = store.getZPersistentAlias( langZid );
const inputs = isFunction.value ? store.getZFunctionInputLabels( langZid ) : [];
const data = {
name: {
keyPath: name ? name.keyPath : undefined,
value: name ? name.value : ''
},
description: {
keyPath: description ? description.keyPath : undefined,
value: description ? description.value : ''
},
aliases: {
keyPath: aliases ? aliases.keyPath : undefined,
value: aliases ? aliases.value : []
},
inputs
};
return {
title: store.getLabelData( langZid ).label,
hasName: !!data.name.value,
name: data.name.value || i18n( 'wikilambda-editor-default-name' ).text(),
viewData: data
};
}
/**
* Returns a computed array of the multilingual data for
* the languages selected for display, as per their persisted
* state in the global store.
*
* @return {Array}
*/
const displayData = computed( () => displayLanguages.value.map(
( lang ) => getMultilingualDataForLanguage( lang.zid )
) );
/**
* Initializes the collection of languages to display in
* the About widget, according to the following logic:
* * The user language will always be shown first, in an expanded state.
* * If the user language doesn't have complete multilingual data, one or
* more fallback languges will be added to the display.
* Each item also includes their local state:
* * edit state flag
* * edit data values
*/
function initializeDisplayLanguages() {
// 1. Always start with user language
displayLanguages.value = [ {
zid: store.getUserLangZid,
edit: props.edit,
open: true,
editData: props.edit ?
editCopy( getMultilingualDataForLanguage( store.getUserLangZid ).viewData ) :
undefined
} ];
// 2. If important info in main language is complete, exit
let missingName = !fieldLangs.value.name.includes( store.getUserLangZid );
let missingInputs = fieldLangs.value.inputs.filter( ( langs ) => !langs.includes( store.getUserLangZid ) );
if ( !missingName && missingInputs.length === 0 ) {
return;
}
// 3. Collect fallback languages to cover up for missing fields
let addBlocks = [];
for ( const langZid of fallbackLanguageZids.value ) {
// 3.1. If everything is complete, exit loop
if ( !missingName && missingInputs.length === 0 ) {
break;
}
// 3.2. If we are still missing a fallback name, check if we have it in this language
if ( missingName ) {
if ( fieldLangs.value.name.includes( langZid ) ) {
addBlocks.push( langZid );
missingName = false;
}
}
// 3.3. For each missing input labels, check if we have it in this language
const availableInputs = missingInputs.filter( ( input ) => input.includes( langZid ) );
if ( availableInputs.length > 0 ) {
addBlocks.push( langZid );
missingInputs = missingInputs.filter( ( input ) => !input.includes( langZid ) );
}
}
// 4. Remove duplicates and add fallback languages to language blocks
addBlocks = [ ...new Set( addBlocks ) ];
addBlocks.forEach( ( langZid ) => {
displayLanguages.value.push( {
zid: langZid,
edit: props.edit,
open: false,
editData: props.edit ?
editCopy( getMultilingualDataForLanguage( langZid ).viewData ) :
undefined
} );
} );
}
// Editing
/**
* Returns whether the user can edit the function
*
* @return {boolean}
*/
const canEditObject = computed( () => store.isCreateNewPage ? true : store.isUserLoggedIn );
/**
* Returns whether any of the language blocks is being edited
*
* @return {boolean}
*/
const isEditing = computed( () => !!displayLanguages.value.find( ( item ) => item.edit ) );
/**
* Creates a deep copy of the edit data
*
* @param {Object} data
* @return {Object}
*/
function editCopy( data ) {
return JSON.parse( JSON.stringify( data ) );
}
/**
* Initialize the local editable data collection for a given
* language block given its index.
*
* @param {number} index
*/
function initializeEdit( index ) {
displayLanguages.value[ index ].edit = true;
displayLanguages.value[ index ].open = true;
displayLanguages.value[ index ].editData = editCopy( displayData.value[ index ].viewData );
emit( 'edit-multilingual-data' );
}
/**
* Persists locally all the changes in the Language Block fields
*
* @param {Object} payload
* @param {Object} payload.data
* @param {Array|string} payload.value
*/
function updateEditValue( payload ) {
payload.data.value = payload.value;
}
// Save field changes
/**
* Persist in the global state a new value for name in the given language
*
* @param {string|undefined} itemKeyPath
* @param {string} value
* @param {string} lang
*/
function persistName( itemKeyPath, value, lang ) {
const parentKeyPath = [
Constants.STORED_OBJECTS.MAIN,
Constants.Z_PERSISTENTOBJECT_LABEL,
Constants.Z_MULTILINGUALSTRING_VALUE
];
store.setZMonolingualString( { parentKeyPath, itemKeyPath, value, lang } );
// After persisting in the state, update the page title
updateZObjectPageTitle();
store.setDirty( true );
}
/**
* Persist in the global state a new value for description in the given language
*
* @param {string|undefined} itemKeyPath
* @param {string} value
* @param {string} lang
*/
function persistDescription( itemKeyPath, value, lang ) {
const parentKeyPath = [
Constants.STORED_OBJECTS.MAIN,
Constants.Z_PERSISTENTOBJECT_DESCRIPTION,
Constants.Z_MULTILINGUALSTRING_VALUE
];
store.setZMonolingualString( { parentKeyPath, itemKeyPath, value, lang } );
store.setDirty( true );
}
/**
* Persist in the global state a new value for aliases in the given language
*
* @param {string|undefined} itemKeyPath
* @param {Array} value
* @param {string} lang
*/
function persistAlias( itemKeyPath, value, lang ) {
const parentKeyPath = [
Constants.STORED_OBJECTS.MAIN,
Constants.Z_PERSISTENTOBJECT_ALIASES,
Constants.Z_MULTILINGUALSTRINGSET_VALUE
];
store.setZMonolingualStringset( { parentKeyPath, itemKeyPath, value, lang } );
store.setDirty( true );
}
/**
* Persist in the global state a new value for an input label in the given language
*
* @param {string|undefined} itemKeyPath
* @param {number} index
* @param {string} value
* @param {string} lang
*/
function persistInputLabel( itemKeyPath, index, value, lang ) {
const parentKeyPath = [
Constants.STORED_OBJECTS.MAIN,
Constants.Z_PERSISTENTOBJECT_VALUE,
Constants.Z_FUNCTION_ARGUMENTS,
index,
Constants.Z_ARGUMENT_LABEL,
Constants.Z_MULTILINGUALSTRING_VALUE
];
store.setZMonolingualString( { parentKeyPath, itemKeyPath, value, lang } );
store.setDirty( true );
}
/**
* For each language being edited, persists all changes
* in the store.
*/
function persistState() {
displayLanguages.value.forEach( ( lang, index ) => {
// If language block is in edit mode, persist
// all changes that have a different edit and view value.
if ( lang.edit ) {
const viewData = displayData.value[ index ].viewData;
const editData = lang.editData;
// Persist name if it changed
if ( viewData.name.value !== editData.name.value ) {
persistName(
viewData.name.keyPath,
editData.name.value,
lang.zid
);
}
// Persist description if it changed
if ( viewData.description.value !== editData.description.value ) {
persistDescription(
viewData.description.keyPath,
editData.description.value,
lang.zid
);
}
// Persist aliases if they changed
if (
JSON.stringify( viewData.aliases.value ) !==
JSON.stringify( editData.aliases.value )
) {
persistAlias(
viewData.aliases.keyPath,
editData.aliases.value,
lang.zid
);
}
// Persist input labels if they changed
for ( const input in editData.inputs ) {
if ( viewData.inputs[ input ].value !== editData.inputs[ input ].value ) {
persistInputLabel(
viewData.inputs[ input ].keyPath,
Number( input ) + 1,
editData.inputs[ input ].value,
lang.zid
);
}
}
}
} );
}
/**
* Only in edit page (non functions):
* Persists a field change in the store and updates the page title if needed.
* Triggered every time that a field emits a "change" event. Field changes
* are persisted as they are entered, and published when the page Publish
* button is clicked.
*/
function saveFieldChange() {
if ( !props.edit ) {
return;
}
persistState();
}
// Languages dialog
const showLanguagesDialog = ref( false );
/**
* Adds the selected language to the collection
* of displayed languages.
*
* @param {string} newLang
*/
function addLanguage( newLang ) {
// Ignore if already displayed
const found = displayLanguages.value.find( ( lang ) => lang.zid === newLang );
if ( found ) {
return;
}
displayLanguages.value.push( {
zid: newLang,
edit: props.edit,
open: false,
editData: props.edit ?
editCopy( getMultilingualDataForLanguage( newLang ).viewData ) :
undefined
} );
}
// Publish dialog
const showPublishDialog = ref( false );
/**
* Restores original view state and cancels publish
* action. This only happens when we are in a view page
* and after editing information, we proceed to publish
* and then we cancel.
*/
function cancelPublish() {
if ( store.isDirty ) {
store.resetMultilingualData();
}
showPublishDialog.value = false;
}
// Actions
/**
* Discards all edits and sets all language blocks to view mode.
*/
function resetEditState() {
displayLanguages.value.forEach( ( lang ) => {
lang.edit = false;
lang.editData = undefined;
} );
}
/**
* Only in view pages (functions and others):
* Persists all accummulated changes in the store and initiates publish process.
* Triggered when user clicks the "Publish" button from the About widget header.
*/
function saveAllChanges() {
if ( props.edit ) {
return;
}
persistState();
showPublishDialog.value = true;
}
// UI helpers
/**
* Returns special class for the accordion description
* depending on the availability of the title.
*
* @param {boolean} hasName
* @return {string}
*/
function accordionDescriptionClass( hasName ) {
return hasName ? '' : 'ext-wikilambda-app-about__accordion--untitled';
}
// Publish actions
/**
* Call store action for ZObject submission
*
* @param {Object} payload
* @param {string} payload.summary
* @return {Promise}
*/
function submitAction( { summary } ) {
return store.submitZObject( { summary } );
}
/**
* Actions to run after a publish action has finished
* successfully.
*
* @param {Object} response
*/
function successCallback( response ) {
const pageTitle = response.page;
store.clearErrors( Constants.STORED_OBJECTS.MAIN, true );
store.setPublishSuccessKey( pageTitle );
// FIXME: we are already in the view page, so we don't really need to navigate
// See if we can do it with just a store refresh and closing the dialog.
window.location.href = !pageTitle ?
new mw.Title( Constants.PATHS.MAIN_PAGE ).getUrl() :
urlUtils.generateViewUrl( { langCode: store.getUserLangCode, zid: pageTitle } );
}
/**
* Actions to run after a publish action has failed.
*
* @param {ApiError} error
*/
function errorCallback( error ) {
store.clearErrors( Constants.STORED_OBJECTS.MAIN );
const errorMessage = error.code === 'badtoken' ?
i18n( 'wikilambda-loggedout-error-message' ).text() :
error.messageOrFallback( 'wikilambda-unknown-save-error-message' );
store.setError( {
errorId: Constants.STORED_OBJECTS.MAIN,
errorType: Constants.ERROR_TYPES.ERROR,
errorMessage
} );
}
// Watch
watch( fallbackLanguageZids, () => {
initializeDisplayLanguages();
} );
// Lifecycle
onMounted( () => {
initializeDisplayLanguages();
} );
return {
accordionDescriptionClass,
addLanguage,
errorCallback,
canEditObject,
cancelPublish,
displayData,
displayLanguages,
fieldLangs,
iconEdit,
iconLanguage,
initializeEdit,
isEditing,
isFunction,
languageCount,
resetEditState,
saveAllChanges,
saveFieldChange,
showLanguagesDialog,
showPublishDialog,
submitAction,
successCallback,
updateEditValue,
i18n
};
}
} );
</script>
<style lang="less">
@import '../../../ext.wikilambda.app.variables.less';
.ext-wikilambda-app-about {
.ext-wikilambda-app-about__accordion--untitled {
color: @color-placeholder;
}
.ext-wikilambda-app-about__button-languages {
margin-top: @spacing-125;
}
.ext-wikilambda-app-about__accordion .cdx-accordion__header {
padding-right: @spacing-125;
}
}
</style>
|