Skip to content

Commit 28cdc85

Browse files
authored
Merge pull request #448 from dreamfactorysoftware/claude-scripted-service-patch
rebuild
2 parents 25f6e91 + 5af9db0 commit 28cdc85

6 files changed

Lines changed: 23 additions & 19 deletions

File tree

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
<body class="mat-typography">
1010
<df-root></df-root>
1111
<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>
12-
<script src="runtime.99380091d42587c0.js" type="module"></script><script src="polyfills.def0190516b19e6b.js" type="module"></script><script src="main.1b31dd8117704925.js" type="module"></script></body>
12+
<script src="runtime.1adb24c16ff25b9a.js" type="module"></script><script src="polyfills.def0190516b19e6b.js" type="module"></script><script src="main.1b31dd8117704925.js" type="module"></script></body>
1313
</html>
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/adf-services/df-service-details/df-service-details.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,9 @@ <h4 class="text-center" style="color: black !important">
717717
<mat-button-toggle value="0">JSON</mat-button-toggle>
718718
<mat-button-toggle value="1">YAML</mat-button-toggle>
719719
</mat-button-toggle-group>
720-
<mat-label class="full-width">OpenAPI Service Definition (Optional)</mat-label>
720+
<mat-label class="full-width"
721+
>OpenAPI Service Definition (Optional)</mat-label
722+
>
721723

722724
<df-ace-editor
723725
class="full-width"

src/app/adf-services/df-service-details/df-service-details.component.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -308,25 +308,25 @@ export class DfServiceDetailsComponent implements OnInit {
308308
if (!data.config) {
309309
data.config = {};
310310
}
311-
311+
312312
// Helper function to detect if content is likely an OpenAPI/Swagger spec
313313
const isLikelyOpenApiSpec = (content: string): boolean => {
314314
if (!content) return false;
315315
const trimmed = content.trim();
316-
316+
317317
// Check for common OpenAPI/Swagger patterns
318318
const openApiPatterns = [
319-
/^\s*\{?\s*["']?openapi["']?\s*:/i, // JSON or YAML openapi field
320-
/^\s*\{?\s*["']?swagger["']?\s*:/i, // JSON or YAML swagger field
321-
/^\s*openapi\s*:/im, // YAML format
322-
/^\s*swagger\s*:/im, // YAML format
323-
/["']paths["']\s*:\s*\{/i, // JSON paths object
324-
/^\s*paths\s*:/im // YAML paths
319+
/^\s*\{?\s*["']?openapi["']?\s*:/i, // JSON or YAML openapi field
320+
/^\s*\{?\s*["']?swagger["']?\s*:/i, // JSON or YAML swagger field
321+
/^\s*openapi\s*:/im, // YAML format
322+
/^\s*swagger\s*:/im, // YAML format
323+
/["']paths["']\s*:\s*\{/i, // JSON paths object
324+
/^\s*paths\s*:/im, // YAML paths
325325
];
326-
326+
327327
return openApiPatterns.some(pattern => pattern.test(trimmed));
328328
};
329-
329+
330330
// Check if this is an old script service with content in the wrong place
331331
// Old structure: script content was in serviceDocByServiceId.content
332332
// New structure: script content should be in config.content, OpenAPI spec (if any) in serviceDocByServiceId.content
@@ -421,7 +421,7 @@ export class DfServiceDetailsComponent implements OnInit {
421421
this.isNetworkService = false;
422422
this.isScriptService = false;
423423
this.isFile = false;
424-
424+
425425
// Find the service type to get its group
426426
const serviceType = this.serviceTypes.find(st => st.name === type);
427427
if (serviceType && serviceType.group) {
@@ -735,7 +735,8 @@ export class DfServiceDetailsComponent implements OnInit {
735735
related: 'service_doc_by_service_id',
736736
};
737737
// For script services, check if there's an OpenAPI spec
738-
const openApiContent = this.getServiceDocByServiceIdControl('content')?.value;
738+
const openApiContent =
739+
this.getServiceDocByServiceIdControl('content')?.value;
739740
if (openApiContent && openApiContent.trim()) {
740741
serviceDoc = {
741742
content: openApiContent,
@@ -1003,7 +1004,8 @@ export class DfServiceDetailsComponent implements OnInit {
10031004
// Remove content from config as it's moved to service_doc_by_service_id
10041005
delete payload.config.content;
10051006
} else if (this.isScriptService) {
1006-
const openApiContent = this.getServiceDocByServiceIdControl('content')?.value;
1007+
const openApiContent =
1008+
this.getServiceDocByServiceIdControl('content')?.value;
10071009
if (openApiContent && openApiContent.trim()) {
10081010
payload.service_doc_by_service_id = {
10091011
content: openApiContent,

src/app/shared/services/df-loading-spinner.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export class DfLoadingSpinnerService {
1818
} else {
1919
this.activeCounter = Math.max(this.activeCounter - 1, 0);
2020
}
21-
21+
2222
const shouldBeActive = this.activeCounter > 0;
23-
23+
2424
// Only defer if the value is actually changing to avoid unnecessary timeouts
2525
// This prevents ExpressionChangedAfterItHasBeenCheckedError by ensuring
2626
// the value change happens after the current change detection cycle completes

0 commit comments

Comments
 (0)