Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit 7c8a25b

Browse files
committed
fix(openbuilt-templates-marketplace): quality stack — phpstan, psalm, eslint, stylelint
- PHPStan: drop `=== null` branch that PHPStan flagged as unreachable in SeedApplicationTemplates::validateFixture (the `=== ''` check already covers null after the isset guard). - Psalm: register RegisterMapper/SchemaMapper/Register/Schema in the UndefinedClass suppress list so cross-app references stop tripping errorLevel=4 (matches existing pattern for ObjectService / ConfigurationService). - ESLint --fix: auto-formatted Vue templates (newline-after-block in scoped styles, multi-line interpolations). - stylelint --fix: no changes needed. All four PHP quality tools (PHPCS, PHPMD, Psalm, PHPStan) + ESLint + stylelint now pass green. `openspec validate openbuilt-templates-marketplace --strict` passes.
1 parent 3af4cc8 commit 7c8a25b

5 files changed

Lines changed: 43 additions & 5 deletions

File tree

lib/Repair/SeedApplicationTemplates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private function validateFixture(array $data, string $slug): void
170170
{
171171
$required = ['slug', 'title', 'description', 'useCase', 'category', 'manifest', 'version'];
172172
foreach ($required as $key) {
173-
if (isset($data[$key]) === false || $data[$key] === '' || $data[$key] === null) {
173+
if (isset($data[$key]) === false || $data[$key] === '') {
174174
throw new RuntimeException('Template "'.$slug.'" missing required field: '.$key);
175175
}
176176
}

psalm.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@
6363
<referencedClass name="OCA\OpenRegister\Event\DeepLinkRegistrationEvent"/>
6464
<referencedClass name="OCA\OpenRegister\Service\ObjectService"/>
6565
<referencedClass name="OCA\OpenRegister\Service\ConfigurationService"/>
66+
<referencedClass name="OCA\OpenRegister\Db\RegisterMapper"/>
67+
<referencedClass name="OCA\OpenRegister\Db\SchemaMapper"/>
68+
<referencedClass name="OCA\OpenRegister\Db\Register"/>
69+
<referencedClass name="OCA\OpenRegister\Db\Schema"/>
6670
<!-- Nextcloud server internals -->
6771
<referencedClass name="OC"/>
6872
<!-- GuzzleHttp (loaded via composer at runtime) -->

src/modals/CloneTemplateDialog.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
:label="t('openbuilt', 'Slug (kebab-case, max 32 chars)')"
1919
:placeholder="t('openbuilt', 'my-permits')"
2020
@update:value="localSlug = $event" />
21-
<p v-if="error" class="clone-dialog__error" role="alert">{{ error }}</p>
21+
<p v-if="error" class="clone-dialog__error" role="alert">
22+
{{ error }}
23+
</p>
2224
<div class="clone-dialog__actions">
2325
<NcButton @click="onClose">
2426
{{ t('openbuilt', 'Cancel') }}
@@ -106,14 +108,17 @@ export default {
106108
gap: 12px;
107109
min-width: 320px;
108110
}
111+
109112
.clone-dialog__summary {
110113
color: var(--color-text-maxcontrast);
111114
margin: 0 0 8px 0;
112115
}
116+
113117
.clone-dialog__error {
114118
color: var(--color-error);
115119
margin: 4px 0 0 0;
116120
}
121+
117122
.clone-dialog__actions {
118123
display: flex;
119124
gap: 8px;

src/views/ApplicationEditor.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,32 +155,38 @@ export default {
155155
padding: var(--default-grid-baseline, 8px);
156156
height: 100%;
157157
}
158+
158159
.openbuilt-editor__list {
159160
width: 240px;
160161
flex-shrink: 0;
161162
overflow-y: auto;
162163
border-right: 1px solid var(--color-border, #ddd);
163164
}
165+
164166
.openbuilt-editor__list ul {
165167
list-style: none;
166168
padding: 0;
167169
margin: 0;
168170
}
171+
169172
.openbuilt-editor__list li {
170173
padding: 8px 12px;
171174
cursor: pointer;
172175
border-radius: var(--border-radius, 4px);
173176
}
177+
174178
.openbuilt-editor__list li.active {
175179
background: var(--color-primary-light, #e6f0fa);
176180
}
181+
177182
.openbuilt-editor__pane {
178183
flex: 1 1 auto;
179184
display: flex;
180185
flex-direction: column;
181186
gap: 8px;
182187
padding: 8px 16px;
183188
}
189+
184190
.openbuilt-editor__textarea {
185191
flex: 1 1 auto;
186192
min-height: 400px;
@@ -190,15 +196,18 @@ export default {
190196
border: 1px solid var(--color-border, #ddd);
191197
border-radius: var(--border-radius, 4px);
192198
}
199+
193200
.openbuilt-editor__error {
194201
color: var(--color-error, #d63f3f);
195202
font-size: 13px;
196203
}
204+
197205
.openbuilt-editor__actions {
198206
display: flex;
199207
gap: 8px;
200208
align-items: center;
201209
}
210+
202211
.openbuilt-editor__help {
203212
font-size: 13px;
204213
color: var(--color-text-maxcontrast, #888);

src/views/TemplateGallery.vue

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,16 @@
3939
:alt="tpl.title || tpl.slug"
4040
class="template-card__screenshot">
4141
<div class="template-card__body">
42-
<h2 class="template-card__title">{{ tpl.title || tpl.slug }}</h2>
42+
<h2 class="template-card__title">
43+
{{ tpl.title || tpl.slug }}
44+
</h2>
4345
<span class="template-card__category">{{ categoryLabel(tpl.category) }}</span>
44-
<p class="template-card__usecase">{{ tpl.useCase || '' }}</p>
45-
<p class="template-card__description">{{ tpl.description || '' }}</p>
46+
<p class="template-card__usecase">
47+
{{ tpl.useCase || '' }}
48+
</p>
49+
<p class="template-card__description">
50+
{{ tpl.description || '' }}
51+
</p>
4652
</div>
4753
<div class="template-card__actions">
4854
<NcButton type="primary" @click="openClone(tpl)">
@@ -200,28 +206,34 @@ export default {
200206
gap: 20px;
201207
color: var(--color-main-text);
202208
}
209+
203210
.template-gallery__header h1 {
204211
margin: 0 0 4px 0;
205212
}
213+
206214
.template-gallery__subtitle {
207215
margin: 0;
208216
color: var(--color-text-maxcontrast);
209217
}
218+
210219
.template-gallery__filters {
211220
display: flex;
212221
gap: 16px;
213222
flex-wrap: wrap;
214223
}
224+
215225
.template-gallery__loading {
216226
display: flex;
217227
gap: 12px;
218228
align-items: center;
219229
padding: 24px;
220230
color: var(--color-text-maxcontrast);
221231
}
232+
222233
.template-gallery__empty {
223234
padding: 32px;
224235
}
236+
225237
.template-gallery__grid {
226238
list-style: none;
227239
padding: 0;
@@ -230,6 +242,7 @@ export default {
230242
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
231243
gap: 20px;
232244
}
245+
233246
.template-card {
234247
background: var(--color-main-background);
235248
border: 1px solid var(--color-border);
@@ -238,38 +251,45 @@ export default {
238251
flex-direction: column;
239252
overflow: hidden;
240253
}
254+
241255
.template-card__screenshot {
242256
width: 100%;
243257
height: 160px;
244258
object-fit: cover;
245259
display: block;
246260
background: var(--color-background-dark);
247261
}
262+
248263
.template-card__body {
249264
padding: 16px;
250265
display: flex;
251266
flex-direction: column;
252267
gap: 6px;
253268
flex: 1 1 auto;
254269
}
270+
255271
.template-card__title {
256272
margin: 0;
257273
font-size: 1.05rem;
258274
}
275+
259276
.template-card__category {
260277
font-size: 0.8rem;
261278
color: var(--color-primary-element);
262279
text-transform: uppercase;
263280
letter-spacing: 0.5px;
264281
}
282+
265283
.template-card__usecase {
266284
margin: 0;
267285
font-weight: 500;
268286
}
287+
269288
.template-card__description {
270289
margin: 0;
271290
color: var(--color-text-maxcontrast);
272291
}
292+
273293
.template-card__actions {
274294
padding: 0 16px 16px 16px;
275295
display: flex;

0 commit comments

Comments
 (0)