Skip to content

Commit 47dbff1

Browse files
authored
Merge pull request #427 from dreamfactorysoftware/develop
DF v7.1.1 Release
2 parents fa7d46d + ae353bc commit 47dbff1

46 files changed

Lines changed: 1432 additions & 97 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ testem.log
3939
# System files
4040
.DS_Store
4141
Thumbs.db
42+
43+
.config/

src/app/adf-api-docs/df-api-docs/df-api-docs.component.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,54 @@
3232
</mat-form-field>
3333
</div>
3434

35+
<div #swaggerInjectedContentContainer class="custom-swagger-content-wrapper">
36+
<div
37+
#healthBannerElement
38+
class="api-health-banner"
39+
*ngIf="healthStatus"
40+
[ngClass]="{
41+
'status-loading': healthStatus === 'loading',
42+
'status-healthy': healthStatus === 'healthy',
43+
'status-unhealthy': healthStatus === 'unhealthy',
44+
'status-warning': healthStatus === 'warning'
45+
}">
46+
<div *ngIf="healthStatus === 'loading'">
47+
<p>{{ 'apiHealthBanner.loading' | transloco }}</p>
48+
</div>
49+
<div *ngIf="healthStatus === 'healthy'">
50+
<p>{{ 'apiHealthBanner.healthy' | transloco }}</p>
51+
</div>
52+
<div *ngIf="healthStatus === 'unhealthy'">
53+
<p>
54+
{{ 'apiHealthBanner.unhealthyBase' | transloco }}
55+
<button
56+
mat-button
57+
color="accent"
58+
class="view-details-button"
59+
(click)="toggleUnhealthyErrorDetails()">
60+
{{
61+
(showUnhealthyErrorDetails
62+
? 'apiHealthBanner.hideDetails'
63+
: 'apiHealthBanner.viewDetails'
64+
) | transloco
65+
}}
66+
</button>
67+
</p>
68+
<div *ngIf="showUnhealthyErrorDetails" class="unhealthy-error-details">
69+
<pre>{{ healthError }}</pre>
70+
</div>
71+
</div>
72+
<div *ngIf="healthStatus === 'warning'">
73+
<p>
74+
{{ 'apiHealthBanner.warningDefault' | transloco }}
75+
</p>
76+
</div>
77+
</div>
78+
79+
<df-api-quickstart
80+
*ngIf="serviceName"
81+
[apiDocJson]="apiDocJson"
82+
[serviceName]="serviceName"></df-api-quickstart>
83+
</div>
84+
3585
<div #apiDocumentation class="swagger-ui"></div>

src/app/adf-api-docs/df-api-docs/df-api-docs.component.scss

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,106 @@
4141
.swagger-ui {
4242
margin-top: 16px;
4343
}
44+
45+
.api-health-banner {
46+
display: flex;
47+
align-items: center;
48+
padding: 8px 12px;
49+
border-radius: 4px;
50+
border-left-width: 4px;
51+
border-left-style: solid;
52+
53+
p {
54+
margin: 0;
55+
font-size: 0.9em;
56+
}
57+
58+
&.status-healthy {
59+
border-left-color: #28a745;
60+
background-color: #e9f5ec;
61+
color: #155724;
62+
}
63+
64+
&.status-unhealthy,
65+
&.status-error {
66+
border-left-color: #dc3545;
67+
background-color: #f8d7da;
68+
color: #721c24;
69+
}
70+
71+
&.status-unhealthy {
72+
& > div {
73+
display: flex;
74+
flex-direction: column;
75+
align-items: flex-start;
76+
width: 100%;
77+
78+
& > p {
79+
display: flex;
80+
align-items: center;
81+
justify-content: space-between;
82+
width: 100%;
83+
84+
.view-details-button {
85+
margin-left: 12px;
86+
flex-shrink: 0;
87+
padding: 2px 8px;
88+
line-height: normal;
89+
font-size: 0.9em;
90+
min-width: auto;
91+
}
92+
}
93+
94+
.unhealthy-error-details {
95+
margin-top: 0;
96+
padding: 8px 12px;
97+
background-color: rgba(0, 0, 0, 0.03);
98+
border: 1px solid rgba(0, 0, 0, 0.06);
99+
border-radius: 4px;
100+
width: 100%;
101+
box-sizing: border-box;
102+
max-height: 150px;
103+
overflow-y: auto;
104+
105+
pre {
106+
margin: 0;
107+
white-space: pre-wrap;
108+
word-break: break-word;
109+
font-size: 0.85em;
110+
color: inherit;
111+
}
112+
}
113+
}
114+
}
115+
116+
&.status-loading {
117+
border-left-color: #007bff;
118+
background-color: #e7f3ff;
119+
color: #004085;
120+
}
121+
122+
&.status-warning {
123+
border-left-color: #ffc107;
124+
background-color: #fff3cd;
125+
color: #856404;
126+
}
127+
}
128+
129+
// Styles for elements within Swagger UI, piercing encapsulation
130+
:host ::ng-deep {
131+
.swagger-ui {
132+
// This targets the wrapper div for Swagger UI in your component's template
133+
.information-container {
134+
.main {
135+
display: flex;
136+
justify-content: space-between;
137+
flex-wrap: wrap;
138+
gap: 8px;
139+
}
140+
}
141+
}
142+
}
143+
144+
.custom-swagger-content-wrapper {
145+
width: 100%;
146+
}

0 commit comments

Comments
 (0)