Skip to content

Commit

Permalink
Revert "Revert "fix(ui): Prevent versionId 0 Error on New Application…
Browse files Browse the repository at this point in the history
…s with No History (argoproj#20574)""

This reverts commit cecf8f4.
  • Loading branch information
pasha-codefresh committed Oct 31, 2024
1 parent 1e1c153 commit 6b746fb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {Timestamp} from '../../../shared/components/timestamp';
import {ApplicationSource, RevisionMetadata, ChartDetails} from '../../../shared/models';
import {services} from '../../../shared/services';

export const RevisionMetadataRows = (props: {applicationName: string; applicationNamespace: string; source: ApplicationSource; index: number; versionId: number}) => {
export const RevisionMetadataRows = (props: {applicationName: string; applicationNamespace: string; source: ApplicationSource; index: number; versionId: number | null}) => {
if (props?.source?.chart) {
return (
<DataLoader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ export class ApplicationDetails extends React.Component<RouteComponentProps<{app
const getContentForNonChart = (
aRevision: string,
aSourceIndex: number,
aVersionId: number,
aVersionId: number | null,
indx: number,
aSource: models.ApplicationSource,
sourceHeader?: JSX.Element
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/shared/services/applications-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class ApplicationsService {
return r.then(res => res.body as models.RevisionMetadata);
}

public revisionChartDetails(name: string, appNamespace: string, revision: string, sourceIndex: number, versionId: number): Promise<models.ChartDetails> {
public revisionChartDetails(name: string, appNamespace: string, revision: string, sourceIndex: number, versionId: number | null): Promise<models.ChartDetails> {
let r = requests.get(`/applications/${name}/revisions/${revision || 'HEAD'}/chartdetails`).query({appNamespace});
if (sourceIndex !== null) {
r = r.query({sourceIndex});
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/shared/services/repo-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class RepositoriesService {
return requests.get(`/repositories/${encodeURIComponent(repo)}/helmcharts`).then(res => (res.body.items as models.HelmChart[]) || []);
}

public appDetails(source: models.ApplicationSource, appName: string, appProject: string, sourceIndex: number, versionId: number): Promise<models.RepoAppDetails> {
public appDetails(source: models.ApplicationSource, appName: string, appProject: string, sourceIndex: number, versionId: number | null): Promise<models.RepoAppDetails> {
return requests
.post(`/repositories/${encodeURIComponent(source.repoURL)}/appdetails`)
.send({source, appName, appProject, sourceIndex, versionId})
Expand Down

0 comments on commit 6b746fb

Please sign in to comment.