Skip to content

Commit

Permalink
Stalwart 22 preview screen modal (#6679)
Browse files Browse the repository at this point in the history
* Added preview screen slider

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Added metadata changes

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Added vault variable into cypress

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Added cancel migration API integration

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Added preview data API requests

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Updated for cancel migration

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Updated values with API data variables

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Update for preview modal input

Signed-off-by: Chaitali Mane <cmane@progress.com>

* minor change

Signed-off-by: Chaitali Mane <cmane@progress.com>

* removed server IP dependancy

Signed-off-by: Chaitali Mane <cmane@progress.com>

* minor

Signed-off-by: Chaitali Mane <cmane@progress.com>

* removed lint in iam

Signed-off-by: Chaitali Mane <cmane@progress.com>

* removed file

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Pipeline failure changes

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* Pipeline failure changes

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* pipeline failure changes

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* pipeline failure changes

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* removed commented code

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Adding variable

Signed-off-by: Chaitali Mane <cmane@progress.com>

* Complitation error fix

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

* Pipeline failure changes

Signed-off-by: Yashvi Jain <Yashvi.jain@progress.com>

Co-authored-by: Yashvi Jain <Yashvi.jain@progress.com>
  • Loading branch information
2 people authored and Pappu Kumar committed Feb 25, 2022
1 parent 743de62 commit 4337e1a
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 110 deletions.
35 changes: 0 additions & 35 deletions components/automate-ui/src/app/entities/orgs/org.actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Action } from '@ngrx/store';

<<<<<<< HEAD
import { Org, UploadFile, PreviewData } from './org.model';

export enum OrgActionTypes {
Expand Down Expand Up @@ -32,29 +31,6 @@ export enum OrgActionTypes {
CONFIRM_PREVIEW = 'ORGS::CONFIRM_PREVIEW',
CONFIRM_PREVIEW_SUCCESS = 'ORGS::CONFIRM_PREVIEW::SUCCESS',
CONFIRM_PREVIEW_FAILURE = 'ORGS::CONFIRM_PREVIEW::FAILURE'
=======
import { Org, UploadFile } from './org.model';

export enum OrgActionTypes {
GET_ALL = 'ORGS::GET_ALL',
GET_ALL_SUCCESS = 'ORGS::GET_ALL::SUCCESS',
GET_ALL_FAILURE = 'ORGS::GET_ALL::FAILURE',
GET = 'ORGS::GET',
GET_SUCCESS = 'ORGS::GET::SUCCESS',
GET_FAILURE = 'ORGS::GET::FAILURE',
CREATE = 'ORGS::CREATE',
CREATE_SUCCESS = 'ORGS::CREATE::SUCCESS',
CREATE_FAILURE = 'ORGS::CREATE::FAILURE',
DELETE = 'ORGS::DELETE',
DELETE_SUCCESS = 'ORGS::DELETE::SUCCESS',
DELETE_FAILURE = 'ORGS::DELETE::FAILURE',
UPDATE = 'ORGS::UPDATE',
UPDATE_SUCCESS = 'ORGS::UPDATE::SUCCESS',
UPDATE_FAILURE = 'ORGS::UPDATE::FAILURE',
UPLOAD = 'ORGS::UPLOAD',
UPLOAD_SUCCESS = 'ORGS::UPLOAD::SUCCESS',
UPLOAD_FAILURE = 'ORGS::UPLOAD::FAILURE'
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
}

export interface OrgSuccessPayload {
Expand Down Expand Up @@ -162,11 +138,7 @@ export class UpdateOrgFailure implements Action {

export interface UploadSuccessPayload {
success: boolean;
<<<<<<< HEAD
migration_id: string;
=======
migrationId: string;
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
}

export class UploadZip implements Action {
Expand All @@ -187,7 +159,6 @@ export class UploadZipFailure implements Action {
constructor(public payload: HttpErrorResponse) { }
}

<<<<<<< HEAD
export interface CancelSuccessPayload {
success: boolean;
error: [];
Expand Down Expand Up @@ -256,8 +227,6 @@ export class ConfirmPreviewFailure implements Action {
constructor(public payload: HttpErrorResponse) { }
}

=======
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
export type OrgActions =
| GetOrgs
| GetOrgsSuccess
Expand All @@ -276,7 +245,6 @@ export type OrgActions =
| UpdateOrgFailure
| UploadZip
| UploadZipSuccess
<<<<<<< HEAD
| UploadZipFailure
| CancelMigration
| CancelMigrationSuccess
Expand All @@ -287,6 +255,3 @@ export type OrgActions =
| ConfirmPreview
| ConfirmPreviewSuccess
| ConfirmPreviewFailure;
=======
| UploadZipFailure;
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
8 changes: 0 additions & 8 deletions components/automate-ui/src/app/entities/orgs/org.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
UploadZipSuccess,
UploadZipFailure,
UploadSuccessPayload,
<<<<<<< HEAD
CancelMigration,
CancelMigrationSuccess,
CancelMigrationFailure,
Expand All @@ -40,8 +39,6 @@ import {
ConfirmPreview,
ConfirmPreviewSuccess,
ConfirmPreviewFailure,
=======
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
OrgActionTypes
} from './org.actions';

Expand Down Expand Up @@ -203,7 +200,6 @@ export class OrgEffects {
type: Type.error,
message: `Could not upload file: ${msg || payload.error}`
});
<<<<<<< HEAD
})));

cancelMigration$ = createEffect(() =>
Expand Down Expand Up @@ -281,8 +277,4 @@ export class OrgEffects {
message: `Could not confirm preview: ${msg || payload.error}`
});
})));
=======
})));

>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
}
3 changes: 0 additions & 3 deletions components/automate-ui/src/app/entities/orgs/org.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface Org {
export interface UploadFile {
formData: FormData;
}
<<<<<<< HEAD

export interface PreviewData {
migration_id: string;
Expand All @@ -34,5 +33,3 @@ export interface User {
is_conflicting: boolean;
is_admin: boolean;
}
=======
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
18 changes: 0 additions & 18 deletions components/automate-ui/src/app/entities/orgs/org.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import { HttpErrorResponse } from '@angular/common/http';
import { set, pipe, unset } from 'lodash/fp';

import { EntityStatus } from 'app/entities/entities';
<<<<<<< HEAD
import { OrgActionTypes, OrgActions, UploadSuccessPayload, PreviewSuccessPayload } from './org.actions';
=======
import { OrgActionTypes, OrgActions, UploadSuccessPayload } from './org.actions';
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
import { Org } from './org.model';

export interface OrgEntityState extends EntityState<Org> {
Expand All @@ -19,13 +15,10 @@ export interface OrgEntityState extends EntityState<Org> {
deleteStatus: EntityStatus;
uploadStatus: EntityStatus;
uploadDetails: UploadSuccessPayload;
<<<<<<< HEAD
cancelStatus: EntityStatus;
previewStatus: EntityStatus;
previewData: PreviewSuccessPayload;
confirmPreviewStatus: EntityStatus;
=======
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
}

const GET_ALL_STATUS = 'getAllStatus';
Expand All @@ -35,12 +28,9 @@ const CREATE_ERROR = 'createError';
const DELETE_STATUS = 'deleteStatus';
const UPDATE_STATUS = 'updateStatus';
const UPLOAD_STATUS = 'uploadStatus';
<<<<<<< HEAD
const CANCEL_STATUS = 'cancelStatus';
const PREVIEW_STATUS = 'previewStatus';
const CONFIRM_PREVIEW_STATUS = 'confirmPreviewStatus';
=======
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))

export const orgEntityAdapter: EntityAdapter<Org> = createEntityAdapter<Org>();

Expand All @@ -53,15 +43,10 @@ export const OrgEntityInitialState: OrgEntityState =
deleteStatus: EntityStatus.notLoaded,
updateStatus: EntityStatus.notLoaded,
uploadStatus: EntityStatus.notLoaded,
<<<<<<< HEAD
uploadDetails: null,
cancelStatus: EntityStatus.notLoaded,
previewData: null,
confirmPreviewStatus: EntityStatus.notLoaded
=======
uploadDetails: null
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
});

export function orgEntityReducer(
Expand Down Expand Up @@ -140,7 +125,6 @@ export function orgEntityReducer(
case OrgActionTypes.UPLOAD_FAILURE:
return set(UPLOAD_STATUS, EntityStatus.loadingFailure, state);

<<<<<<< HEAD
case OrgActionTypes.CANCEL_MIGRATION:
return set(CANCEL_STATUS, EntityStatus.loading, state);

Expand Down Expand Up @@ -171,8 +155,6 @@ export function orgEntityReducer(
case OrgActionTypes.CONFIRM_PREVIEW_FAILURE:
return set(CONFIRM_PREVIEW_STATUS, EntityStatus.loadingFailure, state);

=======
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
default:
return state;
}
Expand Down
7 changes: 0 additions & 7 deletions components/automate-ui/src/app/entities/orgs/org.requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ import {
OrgsSuccessPayload,
OrgSuccessPayload,
CreateOrgPayload,
<<<<<<< HEAD
UploadSuccessPayload,
CancelSuccessPayload,
PreviewSuccessPayload,
ConfirmSuccessPayload
=======
UploadSuccessPayload
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
} from './org.actions';

@Injectable()
Expand Down Expand Up @@ -50,7 +46,6 @@ export class OrgRequests {
return this.http.post<UploadSuccessPayload>
(`${env.infra_proxy_url}/servers/migrations/upload`, formData);
}
<<<<<<< HEAD

public cancelMigration(server_id: string, migration_id: string)
: Observable<CancelSuccessPayload> {
Expand All @@ -68,6 +63,4 @@ export class OrgRequests {
return this.http.get<ConfirmSuccessPayload>(
`${env.infra_proxy_url}/servers/${server_id}/migrations/confirm_preview/${migration_id}`);
}
=======
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
}
3 changes: 0 additions & 3 deletions components/automate-ui/src/app/entities/orgs/org.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const uploadDetails = createSelector(
orgState,
(state) => state.uploadDetails
);
<<<<<<< HEAD

export const cancelStatus = createSelector(
orgState,
Expand All @@ -76,5 +75,3 @@ export const confirmPreviewStatus = createSelector(
orgState,
(state) => state.confirmPreviewStatus
);
=======
>>>>>>> d5e176b0b (Stalwart 32 upload slider functionality (#6654))
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export interface Server {
ip_address: string;
orgs_count?: number;
webui_key?: string;
<<<<<<< HEAD
migration_id?: string;
migration_type?: string;
migration_status?: string;
Expand All @@ -30,8 +29,6 @@ export interface MigrationStatus {
migration_id: string;
migration_type: string;
migration_status: string;
=======
>>>>>>> d8e13829d (WebUI key into add chef-server slider (#6357))
}

export interface User {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export class ChefServerDetailsComponent implements OnInit, OnDestroy {
this.migrationStarted = true;
this.getMigrationStatus(this.migration_id);
}
this.migration_id = this.server.migration_id;
});

combineLatest([
Expand Down Expand Up @@ -611,4 +612,27 @@ export class ChefServerDetailsComponent implements OnInit, OnDestroy {
};
this.store.dispatch(new ConfirmPreview(payload));
}

// cancel migration function
public cancelMigration(migration_id: string): void {
console.log('migrationId', migration_id);
const payload = {
server_id : this.server.id,
migration_id : migration_id
};
this.store.dispatch(new CancelMigration(payload));
}

// get migraion preview function
public getPreviewData() {
const payload = {
// migration_id: this.migration_id
migration_id: '1234'
};
this.store.dispatch(new GetPreviewData(payload));
}

public migrationPreview() {
console.log();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,7 @@ export class ChefServersListComponent implements OnInit, OnDestroy {
]]
});
this.webUIKeyForm = this.fb.group({
<<<<<<< HEAD
webui_key: ['', [Validators.required]]
=======
webui_key: ['', [Validators.required,
Validators.pattern(Regex.patterns.NON_BLANK)
]]
>>>>>>> d8e13829d (WebUI key into add chef-server slider (#6357))
});
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ func migrationTwoPipeline(source <-chan PipelineData, pipes ...PhaseTwoPipelineP
}

}()

}

func SetupPhaseTwoPipeline(service *service.Service) PhaseTwoPipleine {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"fmt"

"errors"
"github.com/chef/automate/api/interservice/local_user"
"io"
"os"
"path"
"path/filepath"

"github.com/chef/automate/api/interservice/local_user"

"github.com/chef/automate/api/interservice/authz"
"github.com/chef/automate/components/infra-proxy-service/pipeline"
"github.com/chef/automate/components/infra-proxy-service/storage"
Expand Down

0 comments on commit 4337e1a

Please sign in to comment.