Skip to content

Commit

Permalink
OP-290: behat fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Sep 3, 2024
1 parent 8f349b8 commit 9dc5802
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(document).ready(function() {
$('.bitbag-media-autocomplete, .sylius-autocomplete').each((index, element) => {
$('.cms-media-autocomplete, .sylius-autocomplete').each((index, element) => {
$(element).autoComplete();
});

Expand All @@ -13,7 +13,7 @@ $(document).ready(function() {
}

$(document).on('collection-form-add', () => {
$('.bitbag-media-autocomplete, .sylius-autocomplete').each((index, element) => {
$('.cms-media-autocomplete, .sylius-autocomplete').each((index, element) => {
if ($._data($(element).get(0), 'events') === undefined) {
$(element).autoComplete();
}
Expand Down Expand Up @@ -60,7 +60,7 @@ $(document).ready(function() {
);

$(element).attr('name', newConfigInputName);
$(newConfig).find('.bitbag-media-autocomplete').autoComplete();
$(newConfig).find('.cms-media-autocomplete').autoComplete();
$(newConfig).find('.sylius-autocomplete').autoComplete();
});
}
Expand Down
6 changes: 3 additions & 3 deletions src/Resources/assets/admin/js/cms/cms-media-autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class HandleAutoComplete {

init() {
if (typeof this.config !== 'object') {
throw new Error('Bitbag CMS Plugin - HandleAutoComplete class config is not a valid object');
throw new Error('Sylius CMS Plugin - HandleAutoComplete class config is not a valid object');
}
this.mediaContainers.forEach((mediaContainer) => {
this._handleSavedValue(mediaContainer);
Expand Down Expand Up @@ -108,7 +108,7 @@ export class HandleAutoComplete {

triggerCustomEvent(mediaContainer, 'cms.media.saved.reload.completed', data);
} catch (error) {
console.error(`BitBag CMS Plugin - HandleAutoComplete class error : ${error}`);
console.error(`Sylius CMS Plugin - HandleAutoComplete class error : ${error}`);
triggerCustomEvent(mediaContainer, 'cms.media.saved.reload.error', error);
} finally {
mediaContainer.classList.remove('loading');
Expand All @@ -134,7 +134,7 @@ export class HandleAutoComplete {

triggerCustomEvent(mediaContainer, 'cms.media.display.completed', data);
} catch (error) {
console.error(`BitBag CMS Plugin - HandleAutoComplete class error : ${error}`);
console.error(`Sylius CMS Plugin - HandleAutoComplete class error : ${error}`);
triggerCustomEvent(mediaContainer, 'cms.media.display.error', error);
} finally {
mediaContainer.classList.remove('loading');
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/assets/admin/js/cms/cms-page-slug.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ export class HandleSlugUpdate {

init() {
if (typeof this.config !== 'object') {
throw new Error('Bitbag CMS Plugin - HandleSlugUpdate class config is not a valid object');
throw new Error('Sylius CMS Plugin - HandleSlugUpdate class config is not a valid object');
}

if (typeof this.lockFieldIndicator !== 'string' || typeof this.bbTarget !== 'string') {
throw new Error('Bitbag CMS Plugin - HandleSlugUpdate class config key values are not valid strings');
throw new Error('Sylius CMS Plugin - HandleSlugUpdate class config key values are not valid strings');
}

if (!this.nameField ) {
throw new Error('Bitbag CMS Plugin - HandleSlugUpdate name field not found');
throw new Error('Sylius CMS Plugin - HandleSlugUpdate name field not found');
}

this._handleFields();
Expand Down Expand Up @@ -84,7 +84,7 @@ export class HandleSlugUpdate {
const response = await request.json();
return response.slug;
} catch (error) {
console.error(`BitBag CMS Plugin - HandleSlugUpdate class error : ${error}`);
console.error(`Sylius CMS Plugin - HandleSlugUpdate class error : ${error}`);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Resources/assets/admin/js/cms/cms-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export class HandlePreview {
}
init() {
if (typeof this.config !== 'object') {
throw new Error('Bitbag CMS Plugin - HandlePreview class config is not a valid object');
throw new Error('Sylius CMS Plugin - HandlePreview class config is not a valid object');
}
if (
typeof this.localeSelector !== 'string' ||
typeof this.channelSelector !== 'string' ||
typeof this.modalSelector !== 'string'
) {
throw new Error('Bitbag CMS Plugin - HandlePreview class config key values are not valid strings');
throw new Error('Sylius CMS Plugin - HandlePreview class config key values are not valid strings');
}
this._resourcePreview();
}
Expand Down Expand Up @@ -88,7 +88,7 @@ export class HandlePreview {
this.modal.querySelector('iframe').src = blobUrl;
triggerCustomEvent(this.modal, 'cms.create.preview.completed', res);
} catch (error) {
console.error(`BitBag CMS Plugin - HandlePreview class error : ${error}`);
console.error(`Sylius CMS Plugin - HandlePreview class error : ${error}`);
triggerCustomEvent(this.modal, 'cms.create.preview.error', error);
} finally {
this.modal.querySelector('.ui.loadable').classList.remove('loading');
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/assets/admin/js/cms/cms-upload-csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class HandleCsvUpload {

init() {
if (typeof this.config !== 'object') {
throw new Error('Bitbag CMS Plugin - HandleCsvUpload class config is not a valid object');
throw new Error('Sylius CMS Plugin - HandleCsvUpload class config is not a valid object');
}

this._handleFields();
Expand Down

0 comments on commit 9dc5802

Please sign in to comment.