Skip to content

Commit 79c3542

Browse files
authored
Merge branch 'main' into feat/ad-user-group
2 parents 4ba4dbf + 2797d2a commit 79c3542

File tree

26 files changed

+139
-46
lines changed

26 files changed

+139
-46
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ ANNOUNCEMENT_BANNER_MSG=
3838
LOGIN_PAGE_IMAGE=
3939
LOGIN_PAGE_IMAGE_BG=
4040
HIDE_DEFAULT_CLUSTER=false
41+
GLOBAL_API_TIMEOUT=60000
42+
TRIGGER_API_TIMEOUT=60000

config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@
2828
| LOGIN_PAGE_IMAGE | "" | Login page image url |
2929
| LOGIN_PAGE_IMAGE_BG | "" | Login page image background color code |
3030
| DEFAULT_CI_TRIGGER_TYPE_MANUAL | "false" | Change default trigger behaviour of newly created ci-pipeline to manual |
31+
| GLOBAL_API_TIMEOUT | 60000 | Default timeout for all API requests in DASHBOARD |
32+
| TRIGGER_API_TIMEOUT | 60000 | Default timeout for all API requests for Trigger calls (Deploy artifacts, charts) in DASHBOARD |
3133

3234
# DASHBOARD CONFIG SECRET

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "0.0.48",
7+
"@devtron-labs/devtron-fe-common-lib": "0.0.50",
88
"@rjsf/core": "^5.13.3",
99
"@rjsf/utils": "^5.13.3",
1010
"@rjsf/validator-ajv8": "^5.13.3",

src/components/CIPipelineN/YAMLScriptComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function YAMLScriptComponent({
5656
components={{
5757
IndicatorSeparator: null,
5858
}}
59-
menuPortalTarget={document.getElementById('visible-modal')}
59+
menuPosition="fixed"
6060
/>
6161
)}
6262
</div>

src/components/ResourceBrowser/ResourceList/ResourceList.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export default function ResourceList() {
310310
!isTerminal &&
311311
!isNodes
312312
) {
313-
getResourceListData()
313+
selectedResource.gvk.Kind !== SIDEBAR_KEYS.nodeGVK.Kind && getResourceListData()
314314
setSearchText('')
315315
setSearchApplied(false)
316316
} else if (isNodes) {
@@ -634,7 +634,6 @@ export default function ResourceList() {
634634
setResourceListLoader(true)
635635
setResourceList(null)
636636
setFilteredResourceList([])
637-
638637
const resourceListPayload: ResourceListPayloadType = {
639638
clusterId: Number(clusterId),
640639
k8sRequest: {

src/components/app/create/CreateApp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class AddNewApp extends Component<AddNewAppProps, AddNewAppState> {
4040
constructor(props) {
4141
super(props)
4242
this.state = {
43-
view: ViewType.FORM,
43+
view: ViewType.LOADING,
4444
code: 0,
4545
projects: [],
4646
disableForm: false,
@@ -72,6 +72,7 @@ export class AddNewApp extends Component<AddNewAppProps, AddNewAppState> {
7272
}
7373

7474
async componentDidMount() {
75+
this.setState({ view: ViewType.LOADING })
7576
try {
7677
const { result } = await getTeamListMin()
7778
sortObjectArrayAlphabetically(result, 'name')

src/components/app/details/appConfig/AppComposeRouter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function AppComposeRouter({
5959
isBaseConfigProtected,
6060
reloadEnvironments,
6161
configProtectionData,
62-
filteredEnvIds
62+
filteredEnvIds,
6363
}: AppComposeRouterProps) {
6464
const { path } = useRouteMatch()
6565
const renderJobViewRoutes = (): JSX.Element => {
@@ -205,7 +205,7 @@ export default function AppComposeRouter({
205205
</Route>,
206206
<Route
207207
key={`${path}/${URLS.APP_ENV_OVERRIDE_CONFIG}`}
208-
path={`${path}/${URLS.APP_ENV_OVERRIDE_CONFIG}/:envId(\\d+)?/:name?`}
208+
path={`${path}/${URLS.APP_ENV_OVERRIDE_CONFIG}/:envId(\\d+)?`}
209209
render={(props) => (
210210
<EnvironmentOverride environments={environments} reloadEnvironments={reloadEnvironments} />
211211
)}

src/components/app/details/appDetails/AppDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ export function TimeRangeSelector({
14421442
options={options.map((time) => ({ label: time, value: time }))}
14431443
value={{ label: selectedRange, value: selectedRange }}
14441444
onChange={(selected) => selectRange(selected.value)}
1445-
menuPortalTarget={document.body}
1445+
menuPosition="fixed"
14461446
components={{ IndicatorSeparator: null, ValueContainer, Option }}
14471447
styles={{
14481448
...multiSelectStyles,

src/components/app/details/cicdHistory/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ const Sidebar = React.memo(
133133
DropdownIndicator,
134134
}}
135135
styles={FILTER_STYLE}
136-
menuPortalTarget={document.body}
136+
menuPosition="fixed"
137137
/>
138138
</div>
139139

src/components/app/details/cicdHistory/TriggerDetails.tsx

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,33 +176,58 @@ const WorkerStatus = React.memo(
176176
const ProgressingStatus = React.memo(
177177
({ status, message, podStatus, stage, type, finishedOn, workerPodName }: ProgressingStatusType): JSX.Element => {
178178
const [aborting, setAborting] = useState(false)
179-
const [abortConfirmation, setAbortConfiguration] = useState(false)
179+
const [abortConfirmation, setAbortConfirmation] = useState(false)
180+
const [abortError, setAbortError] = useState<{
181+
status: boolean
182+
message: string
183+
}>({
184+
status: false,
185+
message: '',
186+
})
180187
const { buildId, triggerId, pipelineId } = useParams<{
181188
buildId: string
182189
triggerId: string
183190
pipelineId: string
184191
}>()
185192
let abort = null
186193
if (type === HistoryComponentType.CI) {
187-
abort = () => cancelCiTrigger({ pipelineId, workflowId: buildId })
194+
abort = (isForceAbort: boolean) => cancelCiTrigger({ pipelineId, workflowId: buildId }, isForceAbort)
188195
} else if (stage !== 'DEPLOY') {
189196
abort = () => cancelPrePostCdTrigger(pipelineId, triggerId)
190197
}
191198

192199
async function abortRunning() {
193200
setAborting(true)
194-
const [error] = await asyncWrap(abort())
195-
setAborting(false)
196-
if (error) {
197-
showError(error)
198-
} else {
201+
try {
202+
await abort(abortError.status)
199203
toast.success('Build Aborted')
200-
setAbortConfiguration(false)
204+
setAbortConfirmation(false)
205+
setAbortError({
206+
status: false,
207+
message: '',
208+
})
209+
} catch (error) {
210+
setAborting(false)
211+
setAbortConfirmation(false)
212+
if (error['code'] === 400) {
213+
// code 400 is for aborting a running build
214+
const errors = error['errors']
215+
setAbortError({
216+
status: true,
217+
message: errors[0].userMessage,
218+
})
219+
}
201220
}
202221
}
203222

204223
const toggleAbortConfiguration = (): void => {
205-
setAbortConfiguration(not)
224+
setAbortConfirmation(not)
225+
}
226+
const closeForceAbortModal = (): void => {
227+
setAbortError({
228+
status: false,
229+
message: '',
230+
})
206231
}
207232
return (
208233
<>
@@ -252,6 +277,29 @@ const ProgressingStatus = React.memo(
252277
</ConfirmationDialog.ButtonGroup>
253278
</ConfirmationDialog>
254279
)}
280+
{abortError.status && (
281+
<ConfirmationDialog>
282+
<ConfirmationDialog.Icon src={warn} />
283+
<ConfirmationDialog.Body title="Could not abort build!" />
284+
<div className="w-100 bc-n50 h-36 flexbox dc__align-items-center">
285+
<span className="pl-12">Error: {abortError.message}</span>
286+
</div>
287+
<div className="fs-13 fw-6 pt-12 cn-7 lh-1-54">
288+
<span>Please try to force abort</span>
289+
</div>
290+
<div className="pt-4 fw-4 cn-7 lh-1-54">
291+
<span>Some resource might get orphaned which will be cleaned up with Job-lifecycle</span>
292+
</div>
293+
<ConfirmationDialog.ButtonGroup>
294+
<button type="button" className="cta cancel" onClick={closeForceAbortModal}>
295+
Cancel
296+
</button>
297+
<button type="button" className="cta delete" onClick={abortRunning}>
298+
{aborting ? <Progressing /> : 'Force Abort'}
299+
</button>
300+
</ConfirmationDialog.ButtonGroup>
301+
</ConfirmationDialog>
302+
)}
255303
</>
256304
)
257305
},

0 commit comments

Comments
 (0)