Skip to content

Commit

Permalink
Merge pull request #20 from shopware/exs-124/fix-refresh-for-app
Browse files Browse the repository at this point in the history
EXS-124 - Fix refresh for app
  • Loading branch information
mstegmeyer authored Jul 2, 2024
2 parents 4f20a4b + 4c18678 commit 32d44c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swag/swag-extension-store",
"version": "3.0.4",
"version": "3.0.5",
"description": "SWAG Extension Store",
"type": "shopware-platform-plugin",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,12 @@ export default {
await this.extensionHelperService.downloadAndActivateExtension(this.extension.name, this.extension.type);

if (this.extension.type === 'plugin') {
await this.clearCacheAndReloadPage();
await this.cacheApiService.clear();
}

this.isInstallSuccessful = true;

window.location.reload();
} catch (error) {
this.showExtensionErrors(error);

Expand Down Expand Up @@ -415,12 +417,6 @@ export default {

closeInstallationFailedModal() {
this.showInstallationFailedModal = false;
},

async clearCacheAndReloadPage() {
await this.cacheApiService.clear();

window.location.reload();
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ describe('SwagExtensionStore/module/sw-extension-store/page/sw-extension-store-d
.toBe('sw-extension-store.detail.enterpriseFeatureAlertText');
});

it('should reload the administration when a plugin is installed', async () => {
it('should clear cache and reload the administration when a plugin is installed', async () => {
const wrapper = await createWrapper();
await flushPromises();

Expand All @@ -167,7 +167,7 @@ describe('SwagExtensionStore/module/sw-extension-store/page/sw-extension-store-d
expect(window.location.reload).toHaveBeenCalledTimes(1);
});

it('should not reload the administration when an app is installed', async () => {
it('should reload the administration when an app is installed', async () => {
const wrapper = await createWrapper({ type: 'app' });
await flushPromises();

Expand All @@ -177,7 +177,7 @@ describe('SwagExtensionStore/module/sw-extension-store/page/sw-extension-store-d

expect(extensionHelperService.downloadAndActivateExtension).toHaveBeenCalledTimes(1);
expect(cacheApiService.clear).not.toHaveBeenCalled();
expect(window.location.reload).not.toHaveBeenCalled();
expect(window.location.reload).toHaveBeenCalledTimes(1);
});

describe('verify smart bar primary action buttons', () => {
Expand Down

0 comments on commit 32d44c3

Please sign in to comment.