Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert commits planned for 1.1 from 1.0 branch #95

Merged
merged 25 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
428f1e3
Revert "Register action hook (#64)"
bowenlan-amzn Sep 23, 2021
1ea04bb
Revert "Added PolicyDetails page (#62)"
bowenlan-amzn Sep 23, 2021
f503226
Revert "Adds VisualCreatePolicy page, missing backend routes/configs,…
bowenlan-amzn Sep 23, 2021
b843668
Revert "Added PolicySettings and DeleteModal components for PolicyDet…
bowenlan-amzn Sep 23, 2021
e1339ae
Revert "Adds create state container and removes unused props from mod…
bowenlan-amzn Sep 23, 2021
b66c17e
Revert "Adds modal for choosing between visual and json editor (#58)"
bowenlan-amzn Sep 23, 2021
524954b
Revert "Adds create transition container (#59)"
bowenlan-amzn Sep 23, 2021
affe67d
Revert "Adds transition component (#57)"
bowenlan-amzn Sep 23, 2021
2d4edb8
Revert "Adds create action container shown in flyout (#56)"
bowenlan-amzn Sep 23, 2021
37678ee
Revert "Adds ISM Templates UI component (#55)"
bowenlan-amzn Sep 23, 2021
4f67b16
Revert "Adds State UI component (#54)"
bowenlan-amzn Sep 23, 2021
346498e
Revert "Adds timeout retry settings component used in action flyout (…
bowenlan-amzn Sep 23, 2021
2ead575
Revert "Adds single state UI component (#53)"
bowenlan-amzn Sep 23, 2021
d862852
Revert "Adds individual ISM template UI component (#51)"
bowenlan-amzn Sep 23, 2021
431396b
Revert "Adds UI actions for all the supported ISM actions (#49)"
bowenlan-amzn Sep 23, 2021
1b9d84b
Revert "Adds draggable transitions and transition content (#48)"
bowenlan-amzn Sep 23, 2021
4d5b079
Revert "Adds error notification UI container and updates snapshots (#…
bowenlan-amzn Sep 23, 2021
6c9d700
Revert "Adds policy info section for new UI (#45)"
bowenlan-amzn Sep 23, 2021
70192b3
Revert "Adds new UI for Channel Notification (#44)"
bowenlan-amzn Sep 23, 2021
9842040
Revert "Adds notification service to make backend call for getting li…
bowenlan-amzn Sep 23, 2021
1ea77d1
Revert "Adds draggable action component (#43)"
bowenlan-amzn Sep 23, 2021
d27471f
Revert "Adds legacy notification UI input (#42)"
bowenlan-amzn Sep 23, 2021
fc2e8f3
Revert "Adds a small Badge component (#39)"
bowenlan-amzn Sep 23, 2021
ea26921
Revert "Adds reusable flyout footer (#41)"
bowenlan-amzn Sep 23, 2021
797ee2a
Revert "Adds custom label to use with EuiForm component (#40)"
bowenlan-amzn Sep 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cypress/integration/managed_indices_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ describe("Managed indices", () => {
// Confirm we got the change policy toaster
cy.contains("Changed policy on 1 indices");

// Click back to Managed Indices page by clicking "Managed indices" breadcrumb
cy.contains("Managed indices").click();
// Click back to Managed Indices page
cy.contains("Managed Indices").click();

// Speed up execution of managed index
cy.updateManagedIndexConfigStartTime(SAMPLE_INDEX);
Expand Down
34 changes: 0 additions & 34 deletions cypress/integration/policies_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ describe("Policies", () => {
// Route us to create policy page
cy.contains("Create policy").click({ force: true });

// Route us to create policy page
cy.contains("JSON editor").click({ force: true });

// Route us to create policy page
cy.contains("Continue").click({ force: true });

// Wait for input to load and then type in the policy ID
cy.get(`input[placeholder="hot_cold_workflow"]`).type(POLICY_ID, { force: true });

Expand Down Expand Up @@ -103,12 +97,6 @@ describe("Policies", () => {
// Click Edit button
cy.get(`[data-test-subj="EditButton"]`).click({ force: true });

// Route us to edit policy page
cy.contains("JSON editor").click({ force: true });

// Route us to edit policy page
cy.contains("Continue").click({ force: true });

// Wait for initial policy JSON to load
cy.contains("A simple description");

Expand Down Expand Up @@ -188,26 +176,4 @@ describe("Policies", () => {
});
});
});

describe("can be viewed", () => {
before(() => {
cy.deleteAllIndices();
cy.createPolicy(POLICY_ID, samplePolicy);
});

it("successfully", () => {
cy.contains(POLICY_ID);

cy.get(`[data-test-subj="policyLink_${POLICY_ID}"]`).click({ force: true });

cy.contains(POLICY_ID);
cy.contains(samplePolicy.policy.description);
samplePolicy.policy.states.forEach((state, i) => {
cy.contains(state.name);
});

cy.get(`[data-test-subj="viewButton"]`).click({ force: true });
cy.contains(`View JSON of ${POLICY_ID}`);
});
})
});
179 changes: 5 additions & 174 deletions models/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

// TODO: Backend has PR out to change this model, this needs to be updated once that goes through

import { ActionType } from "../public/pages/VisualCreatePolicy/utils/constants";

export interface ManagedIndexMetaData {
index: string;
indexUuid: string;
Expand Down Expand Up @@ -89,186 +87,19 @@ export interface DocumentTransform {
metadata: any;
}

// TODO: Fill out when needed
// TODO: separate a frontend Policy from backendPolicy
export interface Policy {
description: string;
default_state: string;
error_notification?: ErrorNotification | null;
states: State[];
ism_template?: ISMTemplate[] | ISMTemplate | null;
last_updated_time?: string;
schema_version?: number;
}

export interface ErrorNotification {
destination?: Destination;
channel?: Channel;
message_template: MessageTemplate;
}

export interface Channel {
id: string;
}

export interface Destination {
chime?: {
url: string;
};
slack?: {
url: string;
};
custom_webhook?: {
url: string;
[other: string]: any; // custom webhook also allows users to create by part including customizing headers/query params, port/host, etc.
};
}

export interface MessageTemplate {
source: string;
lang?: string;
}

export interface ISMTemplate {
index_patterns: string[];
priority: number;
ism_template: any;
}

export interface State {
name: string;
actions?: Action[];
transitions?: Transition[];
}

export interface Action {
timeout?: string;
retry?: Retry;
[action: string]: any;
}

export interface Retry {
count?: number;
backoff?: string;
delay?: string;
}

export interface UIAction<Data> {
action: Data;
id: string;
type: ActionType | string;
render: (uiAction: UIAction<Data>, onChangeAction: (uiAction: UIAction<Data>) => void) => JSX.Element | null;
clone: (action: Data) => UIAction<Data>;
content: () => JSX.Element | string | null;
toAction: () => Action;
}

export interface ForceMergeAction extends Action {
force_merge: {
max_num_segments: number;
};
}

export interface ReadOnlyAction extends Action {
read_only: {};
}

export interface ReadWriteAction extends Action {
read_write: {};
}

export interface ReplicaCountAction extends Action {
replica_count: {
number_of_replicas: number;
};
}

export interface CloseAction extends Action {
close: {};
}

export interface OpenAction extends Action {
open: {};
}

export interface DeleteAction extends Action {
delete: {};
}

export interface RolloverAction extends Action {
rollover: {
min_size?: string;
min_doc_count?: number;
min_index_age?: string;
};
}

export interface UITransition {
transition: Transition;
id: string;
}

export interface Transition {
state_name: string;
conditions?: Condition;
}

export interface Condition {
min_index_age?: string;
min_doc_count?: number;
min_size?: string;
cron?: Cron;
}

export interface Cron {
cron: InnerCron;
}

export interface InnerCron {
expression: string;
timezone: string;
}

export interface NotificationAction extends Action {
notification: {
destination?: Destination;
channel?: {
id: string;
};
message_template: MessageTemplate;
};
notificationJsonString?: string;
}

export interface SnapshotAction extends Action {
snapshot: {
repository: string;
snapshot: string;
};
}

export interface IndexPriorityAction extends Action {
index_priority: {
priority: number;
};
}

export interface AllocationAction extends Action {
allocation: {
require: {
[key: string]: string;
};
include: {
[key: string]: string;
};
exclude: {
[key: string]: string;
};
wait_for: boolean;
};
}

export interface RollupAction extends Action {
rollup: {
jsonString: string;
};
actions: object[];
transitions: object[];
}

export interface Rollup {
Expand Down
38 changes: 0 additions & 38 deletions public/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,3 @@
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

// Copies over styling from eui library to be used in custom classes
// Core
$euiColorPrimary: #006BB4 !default;
$euiColorDarkestShade: #343741 !default;
$euiColorGhost: #FFF !default;
$euiColorInk: #000 !default;
$euiTextColor: $euiColorDarkestShade !default;

.selected-radio-panel {
background-color: tintOrShade($euiColorPrimary, 90%, 70%);
border-color: $euiColorPrimary;
}

@function tintOrShade($color, $tint, $shade) {
@if (lightness($euiTextColor) > 50) {
@return shade($color, $shade);
} @else {
@return tint($color, $tint);
}
}

@function tint($color, $percent) {
@return mix($euiColorGhost, $color, $percent);
}

@function shade($color, $percent) {
@return mix($euiColorInk, $color, $percent);
}

.refresh-button {
min-width: 0;
.euiButtonContent {
.euiButton__text {
margin: 0;
}
}
}
17 changes: 3 additions & 14 deletions public/components/ConfirmationModal/ConfirmationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,18 @@ import {

interface ConfirmationModalProps {
title: string;
bodyMessage: string | JSX.Element;
bodyMessage: string;
actionMessage: string;
actionProps?: object;
modalProps?: object;
onClose: () => void;
onAction: () => void;
}

const ConfirmationModal: React.SFC<ConfirmationModalProps> = ({
title,
bodyMessage,
actionMessage,
onClose,
onAction,
actionProps = {},
modalProps = {},
}) => {
const ConfirmationModal: React.SFC<ConfirmationModalProps> = ({ title, bodyMessage, actionMessage, onClose, onAction }) => {
return (
<EuiOverlayMask>
{/*
// @ts-ignore */}
<EuiModal onCancel={onClose} onClose={onClose} maxWidth={1000} {...modalProps}>
<EuiModal onCancel={onClose} onClose={onClose} maxWidth={1000}>
<EuiModalHeader>
<EuiModalHeaderTitle>{title}</EuiModalHeaderTitle>
</EuiModalHeader>
Expand All @@ -78,7 +68,6 @@ const ConfirmationModal: React.SFC<ConfirmationModalProps> = ({
}}
fill
data-test-subj="confirmationModalActionButton"
{...actionProps}
>
{actionMessage}
</EuiButton>
Expand Down
Loading