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

feat/app-deployment-plugin #390

Merged
merged 31 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5dce6df
feat/app-deployment-plugin
athul-rs Jun 6, 2024
a43f606
Merge branch 'main' into fix/app-deployment-plugin
athul-rs Jun 6, 2024
1e9a2c4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 6, 2024
dd7a4d6
feature-flag enhancements
athul-rs Jun 10, 2024
d0fdd4f
flags list api
athul-rs Jun 11, 2024
030ad01
fix/Enhancement changes
athul-rs Jun 11, 2024
0d9122f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 11, 2024
e13b2c1
Merge branch 'main' into fix/app-deployment-plugin
athul-rs Jun 11, 2024
4e2db98
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 11, 2024
4e8b5c5
fix/pre-commit hook fix
athul-rs Jun 11, 2024
e6b99f4
fix/conflict fix
athul-rs Jun 11, 2024
e92205f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 11, 2024
baf30f0
sonar fix
athul-rs Jun 11, 2024
14f688b
Merge branch 'fix/app-deployment-plugin' of github.com:Zipstack/unstr…
athul-rs Jun 11, 2024
7afac33
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 11, 2024
8040f70
fix/sonar
athul-rs Jun 11, 2024
448b08f
conflict fix
athul-rs Jun 11, 2024
4473fcb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 11, 2024
7ac66ce
REST drf changes
athul-rs Jun 11, 2024
0468a88
conflict fix
athul-rs Jun 11, 2024
258ec13
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 11, 2024
86ae26b
Merge branch 'main' into fix/app-deployment-plugin
athul-rs Jun 14, 2024
5f0e45b
Merge branch 'main' into fix/app-deployment-plugin
athul-rs Jun 18, 2024
a089803
router updated
athul-rs Jun 19, 2024
7d77761
flags review comment improvement
athul-rs Jun 19, 2024
dbcb6a2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 19, 2024
efb92fd
pre-commit hooks fix
athul-rs Jun 19, 2024
cfb6ca9
conflict fix
athul-rs Jun 19, 2024
54423d4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 19, 2024
5687b8b
Empty-Commit
athul-rs Jun 19, 2024
fd87348
Merge branch 'main' into fix/app-deployment-plugin
johnyrahul Jun 20, 2024
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
1 change: 1 addition & 0 deletions backend/backend/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
path("", include("tool_instance.urls")),
path("", include("pipeline.urls")),
path("", include("apps.urls")),
path("", include("feature_flag.urls")),
path("workflow/", include("workflow_manager.urls")),
path("platform/", include("platform_settings.urls")),
path("api/", include("api.urls")),
Expand Down
19 changes: 4 additions & 15 deletions backend/feature_flag/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
from rest_framework.decorators import api_view
from rest_framework.request import Request
from rest_framework.response import Response

from unstract.flags.client import EvaluationClient
from utils.request.feature_flag import check_feature_flag_status

logger = logging.getLogger(__name__)

Expand All @@ -29,26 +28,16 @@ def evaluate_feature_flag(request: Request) -> Response:
evaluate response
"""
try:
namespace_key = request.data.get("namespace_key")
flag_key = request.data.get("flag_key")
entity_id = request.data.get("entity_id")
context = request.data.get("context")

if not namespace_key or not flag_key or not entity_id:
if not flag_key:
return Response(
{"message": "Request paramteres are missing."},
status=status.HTTP_400_BAD_REQUEST,
)

evaluation_client = EvaluationClient()
response = evaluation_client.boolean_evaluate_feature_flag(
namespace_key=namespace_key,
flag_key=flag_key,
entity_id=entity_id,
context=context,
)

return Response({"enabled": response}, status=status.HTTP_200_OK)
flag_enabled = check_feature_flag_status(flag_key)
return Response({"flag_status": flag_enabled}, status=status.HTTP_200_OK)
except Exception as e:
logger.error("No response from server: %s", e)
return Response(
Expand Down
23 changes: 12 additions & 11 deletions frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const { Sider } = Layout;

import Workflows from "../../../assets/Workflows.svg";
import apiDeploy from "../../../assets/api-deployments.svg";
import appdev from "../../../assets/appdev.svg";
import CustomTools from "../../../assets/custom-tools-icon.svg";
import EmbeddingIcon from "../../../assets/embedding.svg";
import etl from "../../../assets/etl.svg";
Expand All @@ -18,10 +17,17 @@ import VectorDbIcon from "../../../assets/vector-db.svg";
import TextExtractorIcon from "../../../assets/text-extractor.svg";
import { useSessionStore } from "../../../store/session-store";

let getMenuItem;
try {
getMenuItem = require("../../../plugins/app-deployments/app-deployment-components/helpers/getMenuItem");
} catch (err) {
// Plugin unavailable.
}

const SideNavBar = ({ collapsed }) => {
const navigate = useNavigate();
const { sessionDetails } = useSessionStore();
const { orgName } = sessionDetails;
const { orgName, appDeployment } = sessionDetails;

const data = [
{
Expand All @@ -36,15 +42,6 @@ const SideNavBar = ({ collapsed }) => {
path: `/${orgName}/api`,
active: window.location.pathname.startsWith(`/${orgName}/api`),
},
{
id: 1.2,
title: "App Deployments",
description: "Standalone unstructured data apps",
icon: BranchesOutlined,
image: appdev,
path: `/${orgName}/app`,
active: window.location.pathname.startsWith(`/${orgName}/app`),
},
{
id: 1.3,
title: "ETL Pipelines",
Expand Down Expand Up @@ -147,6 +144,10 @@ const SideNavBar = ({ collapsed }) => {
},
];

if (getMenuItem && appDeployment) {
data[0].subMenu.splice(1, 0, getMenuItem.default(orgName));
athul-rs marked this conversation as resolved.
Show resolved Hide resolved
}

return (
<Sider
trigger={null}
Expand Down

This file was deleted.

22 changes: 0 additions & 22 deletions frontend/src/components/pipelines-or-deployments/header/Header.css

This file was deleted.

54 changes: 0 additions & 54 deletions frontend/src/components/pipelines-or-deployments/header/Header.jsx

This file was deleted.

This file was deleted.

Loading
Loading