Skip to content

Commit cbd7d72

Browse files
feat: make 6.7 compatible (#331)
* feat: make 6.7 compatible * fix: fix admin ui * fix: switch to deprecated components for 6.7 * chore: bump plugin version --------- Co-authored-by: Felix Schneider <felix.schneider@wimmelbach.de>
1 parent e15098c commit cbd7d72

File tree

14 files changed

+396
-307
lines changed

14 files changed

+396
-307
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "frosh/tools",
3-
"version": "3.0.0",
3+
"version": "3.1.0",
44
"description": "Provides some basic things for managing the Shopware Installation",
55
"type": "shopware-platform-plugin",
66
"license": "MIT",
@@ -35,10 +35,10 @@
3535
}
3636
},
3737
"require": {
38-
"shopware/core": "~6.6.0"
38+
"shopware/core": "~6.6.0 || ~6.7.0"
3939
},
4040
"require-dev": {
41-
"shopware/elasticsearch": "~6.6.0"
41+
"shopware/elasticsearch": "~6.6.0 || ~6.7.0"
4242
},
4343
"config": {
4444
"allow-plugins": {

src/Controller/ShopwareFilesController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public function listShopwareFiles(): JsonResponse
6464
$data = $this->httpClient->request('GET', $url)->getContent(false);
6565
$data = trim((string) $data);
6666

67-
if (empty($data)) {
67+
// Cloudflare fallbacks to index.html for 404 pages...
68+
if (empty($data) || str_contains($data, '<!DOCTYPE html>')) {
6869
return new JsonResponse(['error' => 'No file information for this Shopware version']);
6970
}
7071

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-cache/template.twig

Lines changed: 52 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<sw-card-view>
22
<sw-card
33
class="frosh-tools-tab-cache__cache-card"
4+
deprecated
45
:title="$t('frosh-tools.tabs.cache.title')"
56
:isLoading="isLoading"
67
:large="true"
@@ -10,76 +11,83 @@
1011
<!-- @todo: Make the refresh button fancy -->
1112
<sw-button
1213
variant="ghost"
14+
deprecated
1315
@click="createdComponent"
1416
>
1517
<sw-icon
18+
deprecated
1619
:small="true"
1720
name="regular-undo"
1821
></sw-icon>
1922
</sw-button>
2023
</template>
21-
<sw-data-grid
22-
:showSelection="false"
23-
:dataSource="cacheFolders"
24-
:columns="columns"
25-
>
26-
<template #column-name="{ item }">
27-
<sw-label
28-
variant="success"
29-
appearance="pill"
30-
v-if="item.active"
31-
>
32-
{{ $t('frosh-tools.active') }}
33-
</sw-label>
34-
<sw-label
35-
variant="primary"
36-
appearance="pill"
37-
v-if="item.type"
38-
>
39-
{{ item.type }}
40-
</sw-label>
41-
{{ item.name }}
42-
</template>
4324

44-
<template #column-size="{ item }">
45-
<template v-if="item.size < 0">
46-
{{ $t('frosh-tools.unknown') }}
25+
<template #grid>
26+
<sw-data-grid
27+
:showSelection="false"
28+
:dataSource="cacheFolders"
29+
:columns="columns"
30+
>
31+
<template #column-name="{ item }">
32+
<sw-label
33+
variant="success"
34+
appearance="pill"
35+
v-if="item.active"
36+
>
37+
{{ $t('frosh-tools.active') }}
38+
</sw-label>
39+
<sw-label
40+
variant="primary"
41+
appearance="pill"
42+
v-if="item.type"
43+
>
44+
{{ item.type }}
45+
</sw-label>
46+
{{ item.name }}
4747
</template>
4848

49-
<template v-else>
50-
{{ formatSize(item.size) }}
51-
</template>
52-
</template>
49+
<template #column-size="{ item }">
50+
<template v-if="item.size < 0">
51+
{{ $t('frosh-tools.unknown') }}
52+
</template>
5353

54-
<template #column-freeSpace="{ item }">
55-
<template v-if="item.freeSpace < 0">
56-
{{ $t('frosh-tools.unknown') }}
54+
<template v-else>
55+
{{ formatSize(item.size) }}
56+
</template>
5757
</template>
5858

59-
<template v-else>
60-
{{ formatSize(item.freeSpace) }}
59+
<template #column-freeSpace="{ item }">
60+
<template v-if="item.freeSpace < 0">
61+
{{ $t('frosh-tools.unknown') }}
62+
</template>
63+
64+
<template v-else>
65+
{{ formatSize(item.freeSpace) }}
66+
</template>
6167
</template>
62-
</template>
6368

64-
<template #actions="{ item }">
65-
<sw-context-menu-item
66-
variant="danger"
67-
@click="clearCache(item)"
68-
>
69-
{{ $t('frosh-tools.clear') }}
70-
</sw-context-menu-item>
71-
</template>
72-
</sw-data-grid>
69+
<template #actions="{ item }">
70+
<sw-context-menu-item
71+
variant="danger"
72+
@click="clearCache(item)"
73+
>
74+
{{ $t('frosh-tools.clear') }}
75+
</sw-context-menu-item>
76+
</template>
77+
</sw-data-grid>
78+
</template>
7379
</sw-card>
7480
<sw-card
7581
class="frosh-tools-tab-cache__action-card"
82+
deprecated
7683
:title="$t('frosh-tools.actions')"
7784
:isLoading="isLoading"
7885
:large="true"
7986
positionIdentifier="frosh-tools-tab-cache-action"
8087
>
8188
<sw-button
8289
variant="primary"
90+
deprecated
8391
@click="compileTheme"
8492
>
8593
{{ $t('frosh-tools.compileTheme') }}

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-elasticsearch/template.twig

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<sw-card-view>
22
<sw-card
33
:title="$t('frosh-tools.tabs.elasticsearch.title')"
4+
deprecated
45
:large="true"
56
:isLoading="isLoading"
67
positionIdentifier="frosh-tools-tab-elasticsearch"
78
>
89
<sw-alert
910
variant="error"
11+
deprecated
1012
v-if="!isLoading && !isActive"
1113
>
1214
{{ $t('frosh-tools.tabs.elasticsearch.disabled') }}
@@ -37,77 +39,95 @@
3739
</sw-card>
3840
<sw-card
3941
:title="$t('frosh-tools.tabs.elasticsearch.indices')"
42+
deprecated
4043
v-if="!isLoading && isActive"
4144
:large="true"
4245
positionIdentifier="frosh-tools-tab-elasticsearch-indices"
4346
>
4447
<template #toolbar>
4548
<!-- @todo: Make the refresh button fancy -->
4649
<sw-button
50+
deprecated
4751
variant="ghost"
4852
@click="createdComponent"
4953
>
5054
<sw-icon
5155
:small="true"
56+
deprecated
5257
name="regular-undo"
5358
></sw-icon>
5459
</sw-button>
5560
</template>
56-
<sw-data-grid
57-
v-if="indices"
58-
:showSelection="false"
59-
:dataSource="indices"
60-
:columns="columns"
61-
>
62-
<template #column-name="{ item }">
63-
<sw-label
64-
variant="primary"
65-
appearance="pill"
66-
v-if="item.aliases.length"
67-
>
68-
{{ $t('frosh-tools.active') }}
69-
</sw-label>
70-
{{ item.name }}
71-
<br/>
72-
</template>
7361

74-
<template #column-indexSize="{ item }">
75-
{{ formatSize(item.indexSize) }}
76-
<br/>
77-
</template>
62+
<template #grid>
63+
<sw-data-grid
64+
v-if="indices"
65+
:showSelection="false"
66+
:dataSource="indices"
67+
:columns="columns"
68+
>
69+
<template #column-name="{ item }">
70+
<sw-label
71+
variant="primary"
72+
appearance="pill"
73+
v-if="item.aliases.length"
74+
>
75+
{{ $t('frosh-tools.active') }}
76+
</sw-label>
77+
{{ item.name }}
78+
<br/>
79+
</template>
80+
81+
<template #column-indexSize="{ item }">
82+
{{ formatSize(item.indexSize) }}
83+
<br/>
84+
</template>
7885

79-
<template #actions="{ item }">
80-
<sw-context-menu-item
81-
variant="danger"
82-
@click="deleteIndex(item.name)"
83-
>
84-
{{ $t('frosh-tools.delete') }}
85-
</sw-context-menu-item>
86-
</template>
87-
</sw-data-grid>
86+
<template #actions="{ item }">
87+
<sw-context-menu-item
88+
variant="danger"
89+
@click="deleteIndex(item.name)"
90+
>
91+
{{ $t('frosh-tools.delete') }}
92+
</sw-context-menu-item>
93+
</template>
94+
</sw-data-grid>
95+
</template>
8896
</sw-card>
8997
<sw-card
9098
:title="$t('frosh-tools.actions')"
9199
v-if="!isLoading && isActive"
100+
deprecated
92101
:large="true"
93102
positionIdentifier="frosh-tools-tab-elasticsearch-health"
94103
>
95104
<sw-button
105+
deprecated
96106
@click="reindex"
97107
variant="primary"
98108
>
99109
{{ $t('frosh-tools.tabs.elasticsearch.action.reindex') }}
100110
</sw-button>
101-
<sw-button @click="switchAlias">
111+
<sw-button
112+
deprecated
113+
@click="switchAlias"
114+
>
102115
{{ $t('frosh-tools.tabs.elasticsearch.action.switchAlias') }}
103116
</sw-button>
104-
<sw-button @click="flushAll">
117+
<sw-button
118+
deprecated
119+
@click="flushAll"
120+
>
105121
{{ $t('frosh-tools.tabs.elasticsearch.action.flushAll') }}
106122
</sw-button>
107-
<sw-button @click="cleanup">
123+
<sw-button
124+
deprecated
125+
@click="cleanup"
126+
>
108127
{{ $t('frosh-tools.tabs.elasticsearch.action.cleanup') }}
109128
</sw-button>
110129
<sw-button
130+
deprecated
111131
@click="resetElasticsearch"
112132
variant="danger"
113133
>
@@ -116,6 +136,7 @@
116136
</sw-card>
117137
<sw-card
118138
:title="$t('frosh-tools.tabs.elasticsearch.console.title')"
139+
deprecated
119140
v-if="!isLoading && isActive"
120141
:large="true"
121142
positionIdentifier="frosh-tools-tab-elasticsearch-console"
@@ -129,7 +150,10 @@
129150
:sanitizeInput="false"
130151
v-model="consoleInput"
131152
></sw-code-editor>
132-
<sw-button @click="onConsoleEnter">
153+
<sw-button
154+
deprecated
155+
@click="onConsoleEnter"
156+
>
133157
{{ $t('frosh-tools.tabs.elasticsearch.console.send') }}
134158
</sw-button>
135159
<div>

src/Resources/app/administration/src/module/frosh-tools/component/frosh-tools-tab-files/template.twig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,37 @@
66
:isLoading="isLoading"
77
:large="true"
88
positionIdentifier="frosh-tools-tab-files__files-card"
9+
deprecated
910
>
1011
<sw-alert
1112
variant="error"
13+
deprecated
1214
v-if="items.error"
1315
>{{ items.error }}</sw-alert>
1416
<sw-alert
1517
variant="success"
18+
deprecated
1619
v-if="items.ok"
1720
>
1821
{{ $t('frosh-tools.tabs.files.allFilesOk') }}
1922
</sw-alert>
2023
<sw-alert
2124
variant="warning"
2225
v-else-if="items.files"
26+
deprecated
2327
>
2428
{{ $t('frosh-tools.tabs.files.notOk') }}
2529
</sw-alert>
2630
<template #toolbar>
2731
<!-- @todo: Make the refresh button fancy -->
2832
<sw-button
2933
variant="ghost"
34+
deprecated
3035
@click="refresh"
3136
>
3237
<sw-icon
3338
:small="true"
39+
deprecated
3440
name="regular-undo"
3541
></sw-icon>
3642
</sw-button>
@@ -80,10 +86,14 @@
8086
<template #modal-footer>
8187
<sw-button
8288
variant="ghost-danger"
89+
deprecated
8390
@click="restoreFile(diffData.file.name)"
8491
:disabled="diffData.file.expected"
8592
>
86-
<sw-icon name="regular-exclamation-triangle"></sw-icon>
93+
<sw-icon
94+
name="regular-exclamation-triangle"
95+
deprecated
96+
></sw-icon>
8797
{{ $t('frosh-tools.tabs.files.restore.restoreFile') }}
8898
</sw-button>
8999
</template>

0 commit comments

Comments
 (0)