-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Data bag details UI improvements changes with search box (#4675)
* added UI changes for the accordion Signed-off-by: Vinay Sharma <[email protected]> * added search bar for the data bag items Signed-off-by: Vinay Sharma <[email protected]> * changes for the API integrations Signed-off-by: Vinay Sharma <[email protected]> * added changes for the spinner Signed-off-by: Vinay Sharma <[email protected]> * fixed build issue Signed-off-by: Vinay Sharma <[email protected]> * added some minor changes Signed-off-by: Vinay Sharma <[email protected]> * added changes for the new preview available Signed-off-by: Vinay Sharma <[email protected]> * added changes for the build issue Signed-off-by: Vinay Sharma <[email protected]> * change the less no preview gif Signed-off-by: Vinay Sharma <[email protected]> * fix the size of no preview image Signed-off-by: Vinay Sharma <[email protected]> * added some changes for the API request Signed-off-by: Vinay Sharma <[email protected]> * added some changes for the load search result Signed-off-by: Vinay Sharma <[email protected]> * added changes for empty list without search Signed-off-by: Vinay Sharma <[email protected]> * added some minor changes Signed-off-by: Vinay Sharma <[email protected]> * added changes for the entities Signed-off-by: Vinay Sharma <[email protected]> * added chanegs for the data bag items pagination Signed-off-by: Vinay Sharma <[email protected]> * added chanegs for the loading spinner Signed-off-by: Vinay Sharma <[email protected]> * added some minor changes Signed-off-by: Vinay Sharma <[email protected]> * added some changes for lint Signed-off-by: Vinay Sharma <[email protected]>
- Loading branch information
Showing
19 changed files
with
518 additions
and
172 deletions.
There are no files selected for viewing
48 changes: 29 additions & 19 deletions
48
components/automate-ui/src/app/entities/data-bags/data-bag-details.actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,43 @@ | ||
import { HttpErrorResponse } from '@angular/common/http'; | ||
import { Action } from '@ngrx/store'; | ||
import { DataBags } from './data-bags.model'; | ||
import { DataBagItems } from './data-bags.model'; | ||
|
||
export enum DataBagDetailsActionTypes { | ||
GET_ALL = 'DATA_BAG_DETAILS::GET_ALL', | ||
GET_ALL_SUCCESS = 'DATA_BAG_DETAILS::GET_ALL::SUCCESS', | ||
GET_ALL_FAILURE = 'DATA_BAG_DETAILS::GET_ALL::FAILURE' | ||
export enum DataBagItemsActionTypes { | ||
GET_ALL = 'DATA_BAG_ITEMS::GET_ALL', | ||
GET_ALL_SUCCESS = 'DATA_BAG_ITEMS::GET_ALL::SUCCESS', | ||
GET_ALL_FAILURE = 'DATA_BAG_ITEMS::GET_ALL::FAILURE' | ||
} | ||
|
||
export interface DataBagDetailsSuccessPayload { | ||
data_bags: DataBags[]; | ||
export interface DataBagItemsSuccessPayload { | ||
items: DataBagItems[]; | ||
total: number; | ||
} | ||
|
||
export class GetDataBagDetails implements Action { | ||
readonly type = DataBagDetailsActionTypes.GET_ALL; | ||
constructor(public payload: { server_id: string, org_id: string, name: string }) { } | ||
export interface DataBagItemPayload { | ||
databagName: string; | ||
server_id: string; | ||
org_id: string; | ||
name: string; | ||
page: number; | ||
per_page: number; | ||
} | ||
|
||
export class GetDataBagDetailsSuccess implements Action { | ||
readonly type = DataBagDetailsActionTypes.GET_ALL_SUCCESS; | ||
constructor(public payload: DataBagDetailsSuccessPayload) { } | ||
export class GetDataBagItems implements Action { | ||
readonly type = DataBagItemsActionTypes.GET_ALL; | ||
constructor(public payload: DataBagItemPayload) { } | ||
} | ||
|
||
export class GetDataBagDetailsFailure implements Action { | ||
readonly type = DataBagDetailsActionTypes.GET_ALL_FAILURE; | ||
export class GetDataBagItemsSuccess implements Action { | ||
readonly type = DataBagItemsActionTypes.GET_ALL_SUCCESS; | ||
constructor(public payload: DataBagItemsSuccessPayload) { } | ||
} | ||
|
||
export class GetDataBagItemsFailure implements Action { | ||
readonly type = DataBagItemsActionTypes.GET_ALL_FAILURE; | ||
constructor(public payload: HttpErrorResponse) { } | ||
} | ||
|
||
export type DataBagDetailsActions = | ||
| GetDataBagDetails | ||
| GetDataBagDetailsSuccess | ||
| GetDataBagDetailsFailure; | ||
export type DataBagItemsActions = | ||
| GetDataBagItems | ||
| GetDataBagItemsSuccess | ||
| GetDataBagItemsFailure; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 14 additions & 12 deletions
26
components/automate-ui/src/app/entities/data-bags/data-bag-details.selector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
import { createSelector, createFeatureSelector } from '@ngrx/store'; | ||
|
||
import { routeParams } from 'app/route.selectors'; | ||
import { find } from 'lodash/fp'; | ||
|
||
import { DataBagDetailsEntityState, dataBagDetailsEntityAdapter } from './data-bag-details.reducer'; | ||
import { DataBagItemsEntityState, dataBagItemsEntityAdapter } from './data-bag-details.reducer'; | ||
|
||
|
||
export const dataBagDetailsState = | ||
createFeatureSelector<DataBagDetailsEntityState> | ||
('dataBagDetails'); | ||
export const dataBagItemsState = | ||
createFeatureSelector<DataBagItemsEntityState>('dataBagItems'); | ||
|
||
export const { | ||
selectAll: allDataBagDetails, | ||
selectEntities: dataBagDetailsEntities | ||
} = dataBagDetailsEntityAdapter.getSelectors(dataBagDetailsState); | ||
selectAll: allDataBagItems, | ||
selectEntities: dataBagItemsEntities | ||
} = dataBagItemsEntityAdapter.getSelectors(dataBagItemsState); | ||
|
||
export const getAllStatus = createSelector( | ||
dataBagDetailsState, | ||
dataBagItemsState, | ||
(state) => state.getAllStatus | ||
); | ||
|
||
export const dataBagDetailsFromRoute = createSelector( | ||
dataBagDetailsEntities, | ||
export const dataBagItemsFromRoute = createSelector( | ||
dataBagItemsEntities, | ||
routeParams, | ||
(state, { name }) => find({ name }, state) | ||
); | ||
|
||
export const dataBagItemList = createSelector( | ||
dataBagItemsState, | ||
(state) => state.dataBagItems | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.