Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
f62e85d
fix(633): fix the bug
IgorKrupenja Jul 30, 2025
8b69436
fix(633): clean up
IgorKrupenja Jul 30, 2025
98753d0
chore(644): Added Params Key/Value Pair Changes
1AhmedYasser Jul 30, 2025
73c352b
chore(644): Added Body and header updates
1AhmedYasser Jul 30, 2025
4a38e9e
chore(644): Added New field check on value or variable change
1AhmedYasser Jul 30, 2025
115de21
chore(644): Fixed row value
1AhmedYasser Jul 30, 2025
13d6d10
chore(644): Removed console.log
1AhmedYasser Jul 30, 2025
7d7f59b
chore(644): Removed AutoComplete field from value
1AhmedYasser Jul 31, 2025
43da1d3
fix(644): Fixed Sonar Issues
1AhmedYasser Jul 31, 2025
eeefc03
fix(648): re-order
IgorKrupenja Jul 31, 2025
3abb7f3
fix(644): Fixed Value Update
1AhmedYasser Jul 31, 2025
946588c
fix(648): fix typo
IgorKrupenja Jul 31, 2025
66ea283
fix(633): merge
IgorKrupenja Jul 31, 2025
3ebf984
fix(644): Fixed Delete Variable UI Bug
1AhmedYasser Jul 31, 2025
36af7ee
Merge pull request #655 from IgorKrupenja/633-service-delete-list
jaX10bt Jul 31, 2025
5bc595f
Merge pull request #656 from 1AhmedYasser/Bug-Parameters-Body-Headers…
jaX10bt Jul 31, 2025
fa1829c
chore(0): Fix row deletion ui update
1AhmedYasser Jul 31, 2025
b9ddf6e
Merge pull request #659 from 1AhmedYasser/Hot-fix-Fixed-Row-Deletion
jaX10bt Aug 1, 2025
e8b41f9
fix(648): fix modal height
IgorKrupenja Aug 3, 2025
3b9f426
fix(648): fill modal
IgorKrupenja Aug 3, 2025
2d59efc
fix(648): fix height
IgorKrupenja Aug 3, 2025
c53ed41
Revert "fix(648): fix height"
IgorKrupenja Aug 3, 2025
d1e6e0d
Revert "fix(648): fill modal"
IgorKrupenja Aug 3, 2025
3ce7e1b
fix(648): fix height
IgorKrupenja Aug 3, 2025
1c8458c
fix(648): cl
IgorKrupenja Aug 3, 2025
4dfc4ee
fix(648): cl
IgorKrupenja Aug 3, 2025
79158f3
fix(648): cl
IgorKrupenja Aug 3, 2025
60c9976
fix(648): cl
IgorKrupenja Aug 3, 2025
b46e97f
fix(648): fix height completelyt
IgorKrupenja Aug 3, 2025
466b1bc
fix(648): cl
IgorKrupenja Aug 3, 2025
88f4c76
fix(648): cl
IgorKrupenja Aug 3, 2025
9c096cc
fix(648): REVERT LATER
IgorKrupenja Aug 3, 2025
ab4438c
feat(648): add endpoints column to user_step_preference table for API…
IgorKrupenja Aug 3, 2025
5fac0e8
feat(648): update get_endpoints_by_service_id to respect user endpoin…
IgorKrupenja Aug 3, 2025
76328aa
feat(648): add user authentication to service-by-id endpoint for endp…
IgorKrupenja Aug 3, 2025
bb2f7fe
feat(648): extend preferences endpoints to support both steps and end…
IgorKrupenja Aug 3, 2025
154017f
feat(648): fix YAML return statements to return JSON objects instead …
IgorKrupenja Aug 3, 2025
24da9f0
fix(648): update loadStepPreferences to handle new API response format
IgorKrupenja Aug 3, 2025
5ac1912
feat(648): add endpointPreferences to useServiceStore state and API l…
IgorKrupenja Aug 3, 2025
7b8a2c2
feat(648): add apiElements state to CustomEdge component
IgorKrupenja Aug 3, 2025
9f9af1d
feat(648): move apiElements state management to store
IgorKrupenja Aug 3, 2025
e9caf40
feat(648): add drag-and-drop functionality to API elements
IgorKrupenja Aug 3, 2025
ba96ccf
feat(648): simplify endpoint preference logic to use only endpointId
IgorKrupenja Aug 3, 2025
71c450e
feat(648): remove endpointPreferences and use apiElements as single s…
IgorKrupenja Aug 3, 2025
a1f2b5f
feat(648): extract common reorderElements helper function
IgorKrupenja Aug 3, 2025
8137244
feat(648): remove unused steps parameter from service builder functions
IgorKrupenja Aug 3, 2025
4401b1b
feat(648): move apiElements state from store to component
IgorKrupenja Aug 3, 2025
40db33d
fix(648): cl
IgorKrupenja Aug 3, 2025
edef1df
chore(658): Added Endpoint Handling Enhancements
1AhmedYasser Aug 3, 2025
072948f
chore(658): Added Status Code Chip to endpoints
1AhmedYasser Aug 4, 2025
65a805c
Merge pull request #660 from 1AhmedYasser/Migrate-weather-service-to-…
jaX10bt Aug 4, 2025
227ba73
fix(648): fix all elems
IgorKrupenja Aug 4, 2025
3fa7424
feat(648): add public endpoint label for common API elements
IgorKrupenja Aug 4, 2025
0a74210
feat(648): add spacing between API and PUBLIC icons
IgorKrupenja Aug 4, 2025
c7aa0cd
feat(648): convert API and PUBLIC icons to CSS badges with translations
IgorKrupenja Aug 4, 2025
d7b14f4
fix(648): ensure endpoint list updates when new endpoints are added
IgorKrupenja Aug 4, 2025
d122dd2
fix(648): cl
IgorKrupenja Aug 4, 2025
3e9f799
fix(648): cl
IgorKrupenja Aug 4, 2025
25d21cd
fix(648): cl
IgorKrupenja Aug 4, 2025
e1b054e
feat(648): temporarily filter step elements to show only specific types
IgorKrupenja Aug 4, 2025
3500c44
feat(648): handle endpoint deletion by removing from user preferences
IgorKrupenja Aug 4, 2025
23c3839
feat(648): handle service deletion by removing its endpoints from use…
IgorKrupenja Aug 4, 2025
e0b29f1
feat(648): simplify endpoint preference updates to use IDs directly
IgorKrupenja Aug 4, 2025
d7fe4ab
feat(648): extract add endpoint modal into separate component
IgorKrupenja Aug 4, 2025
fb2760f
feat(648): remove isVisible prop from AddEndpointModal, handle visibi…
IgorKrupenja Aug 4, 2025
010ed8b
fix(648): fix on all reorder
IgorKrupenja Aug 4, 2025
7b091da
feat(648): extract endpoint ID helper function to reduce duplication
IgorKrupenja Aug 4, 2025
df43bd6
fix(648): tran
IgorKrupenja Aug 4, 2025
6640f25
chore(658): Added Environments to previous variables
1AhmedYasser Aug 5, 2025
7c594a4
Merge pull request #662 from 1AhmedYasser/Added-Environment-to-previo…
jaX10bt Aug 5, 2025
6d86354
Merge pull request #661 from IgorKrupenja/648-modal-elements
jaX10bt Aug 5, 2025
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@
**/npm-debug.log*
/.idea/
**/package-lock.json

# Cursor IDE
.cursor/
.cursorrules
.cursorrules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd">

<changeSet id="20250127000000" author="IgorKrupenja">
<sqlFile
path="changelog/migrations/20250127000000_add_endpoints_to_user_step_preference.sql" />
<rollback>
<sqlFile path="changelog/migrations/rollback/20250127000000_rollback.sql" />
</rollback>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- liquibase formatted sql
-- changeset IgorKrupenja:20250127000000

ALTER TABLE user_step_preference ADD COLUMN endpoints UUID[] DEFAULT '{}';
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- liquibase formatted sql
-- rollback

ALTER TABLE user_step_preference DROP COLUMN endpoints;
32 changes: 24 additions & 8 deletions DSL/Resql/services/POST/endpoints/get_endpoints_by_service_id.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,29 @@ WITH LatestEndpoints AS (
FROM endpoints AS e
WHERE (e.service_id = :id::uuid OR e.is_common = true)
ORDER BY e.endpoint_id, e.id DESC
),
UserPreferences AS (
SELECT endpoints
FROM user_step_preference
WHERE user_id_code = :user_id_code
ORDER BY created_at DESC
LIMIT 1
)
SELECT
endpoint_id,
name,
type,
is_common,
definitions
FROM LatestEndpoints
WHERE deleted IS FALSE
ORDER BY id DESC;
le.endpoint_id,
le.name,
le.type,
le.is_common,
le.definitions
FROM LatestEndpoints AS le
CROSS JOIN UserPreferences AS up
WHERE le.deleted IS FALSE
ORDER BY
CASE
WHEN up.endpoints IS NULL OR array_length(up.endpoints, 1) = 0 THEN 1
ELSE array_position(up.endpoints, le.endpoint_id)
END,
CASE
WHEN up.endpoints IS NULL OR array_length(up.endpoints, 1) = 0 THEN le.id
ELSE NULL
END DESC;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- Remove a specific endpoint from all user step preferences
-- This is called when an endpoint is deleted to clean up references

INSERT INTO user_step_preference (steps, endpoints, user_id_code)
SELECT
steps,
array_remove(endpoints, :endpoint_id::uuid) AS endpoints,
user_id_code
FROM user_step_preference AS usp1
WHERE endpoints @> ARRAY[:endpoint_id::uuid]
AND created_at = (
SELECT MAX(created_at)
FROM user_step_preference AS usp2
WHERE usp2.user_id_code = usp1.user_id_code
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- Remove all non-common endpoints of a deleted service from all user step preferences
-- This is called when a service is deleted to clean up references to its endpoints

INSERT INTO user_step_preference (steps, endpoints, user_id_code)
SELECT
steps,
array_remove(endpoints, le.endpoint_id) AS endpoints,
user_id_code
FROM user_step_preference AS usp1
CROSS JOIN (
SELECT DISTINCT ON (endpoint_id) endpoint_id
FROM endpoints
WHERE service_id = :serviceId::uuid
AND is_common = FALSE
AND deleted = FALSE
ORDER BY endpoint_id, id DESC
) AS le
WHERE usp1.endpoints @> ARRAY[le.endpoint_id]
AND usp1.created_at = (
SELECT MAX(created_at)
FROM user_step_preference AS usp2
WHERE usp2.user_id_code = usp1.user_id_code
);
2 changes: 1 addition & 1 deletion DSL/Resql/services/POST/get-user-step-preferences.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SELECT steps
SELECT steps, endpoints
FROM user_step_preference
WHERE user_id_code = :user_id_code
ORDER BY created_at DESC
Expand Down
4 changes: 2 additions & 2 deletions DSL/Resql/services/POST/update-user-step-preferences.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
INSERT INTO user_step_preference(steps, user_id_code)
VALUES(:steps::step_type[], :user_id_code);
INSERT INTO user_step_preference(steps, endpoints, user_id_code)
VALUES(:steps::step_type[], :endpoints::uuid[], :user_id_code);
26 changes: 26 additions & 0 deletions DSL/Ruuter/services/GET/service-by-id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ check_for_parameters:
- condition: ${incoming.params == null || incoming.params.id == null}
next: return_incorrect_request

get_user_info:
call: http.post
args:
url: "[#SERVICE_TIM]/jwt/custom-jwt-userinfo"
contentType: plaintext
headers:
cookie: ${incoming.headers.cookie}
plaintext: "customJwtCookie"
result: res

check_user_info_response:
switch:
- condition: ${200 <= res.response.statusCodeValue && res.response.statusCodeValue < 300}
next: assignIdCode
next: return_unauthorized

assignIdCode:
assign:
idCode: ${res.response.body.idCode}

get_service_by_id:
call: http.post
args:
Expand All @@ -31,6 +51,7 @@ get_endpoints_by_service_id:
url: "[#SERVICE_RESQL]/endpoints/get_endpoints_by_service_id"
body:
id: ${incoming.params.id}
user_id_code: ${idCode}
result: endpoints_results

prepare_results:
Expand All @@ -57,3 +78,8 @@ return_incorrect_request:
status: 400
return: "Required parameter(s) missing"
next: end

return_unauthorized:
status: 401
return: "unauthorized"
next: end
6 changes: 3 additions & 3 deletions DSL/Ruuter/services/GET/steps/preferences.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ check_preferences_response:
switch:
- condition: ${preferences.response.body.length > 0}
next: return_preferences
next: seed_default_user_preferences
next: seed_default_user_preferences

seed_default_user_preferences:
call: http.post
Expand All @@ -58,11 +58,11 @@ refetch_user_step_preferences:
result: refetched_preferences

return_refetched_preferences:
return: ${refetched_preferences.response.body[0].steps}
return: ${refetched_preferences.response.body[0]}
next: end

return_preferences:
return: ${preferences.response.body[0].steps}
return: ${preferences.response.body[0]}
next: end

return_unauthorized:
Expand Down
2 changes: 1 addition & 1 deletion DSL/Ruuter/services/POST/services/create-endpoint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declaration:
type: string
description: "Service UUID"
- field: definitions
type: json
type: object
description: "Endpoint definitions"

create_endpoint:
Expand Down
8 changes: 8 additions & 0 deletions DSL/Ruuter/services/POST/services/delete-endpoint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ delete_endpoint:
id: ${incoming.body.id}
result: res

remove_from_preferences:
call: http.post
args:
url: "[#SERVICE_RESQL]/endpoints/remove_endpoint_from_preferences"
body:
endpoint_id: ${incoming.body.id}
result: preferences_res

return_ok:
status: 200
return: "Endpoint deleted"
Expand Down
9 changes: 9 additions & 0 deletions DSL/Ruuter/services/POST/services/delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ delete_endpoints_by_service_id:
body:
serviceId: ${id}
result: delete_endpoint_results
next: remove_service_endpoints_from_preferences

remove_service_endpoints_from_preferences:
call: http.post
args:
url: "[#SERVICE_RESQL]/endpoints/remove_service_endpoints_from_preferences"
body:
serviceId: ${id}
result: remove_preferences_results
next: delete_mcq_files

delete_mcq_files:
Expand Down
2 changes: 1 addition & 1 deletion DSL/Ruuter/services/POST/services/update-endpoint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declaration:
type: string
description: "Service UUID"
- field: definitions
type: json
type: object
description: "Endpoint definitions"
params:
- field: id
Expand Down
9 changes: 7 additions & 2 deletions DSL/Ruuter/services/POST/steps/preferences.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ declaration:
- field: steps
type: string
description: "Body field 'steps'"
- field: endpoints
type: string
description: "Body field 'endpoints'"

extractRequestData:
assign:
steps: ${incoming.body.steps.join(",")}
steps: ${incoming.body.steps.join(",")}
endpoints: ${incoming.body.endpoints.join(",")}

get_user_info:
call: http.post
Expand Down Expand Up @@ -42,6 +46,7 @@ update_user_step_preferences:
url: "[#SERVICE_RESQL]/update-user-step-preferences"
body:
steps: "{${steps}}"
endpoints: "{${endpoints}}"
user_id_code: ${idCode}
result: update_preferences_res

Expand All @@ -54,7 +59,7 @@ get_user_step_preferences:
result: preferences

return_preferences:
return: ${preferences.response.body[0].steps}
return: ${preferences.response.body[0]}
next: end

return_unauthorized:
Expand Down
3 changes: 0 additions & 3 deletions GUI/src/assets/images/api-icon-tag.svg

This file was deleted.

21 changes: 20 additions & 1 deletion GUI/src/components/ApiEndpoint/ApiEndpoint.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,32 @@
align-items: center;
width: 100%;
min-width: 0;
gap: 8px;

.label {
padding-left: 8px;
overflow: hidden;
text-overflow: ellipsis;
min-width: 0;
}

.apiBadge,
.publicBadge {
color: white;
font-size: 10px;
font-weight: bold;
padding: 2px 6px;
border-radius: 2px;
white-space: nowrap;
text-transform: uppercase;
}

.apiBadge {
background-color: #8bb4d5;
}

.publicBadge {
background-color: #6b9bc5;
}
}

.loader {
Expand Down
32 changes: 24 additions & 8 deletions GUI/src/components/ApiEndpoint/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ import Icon from "components/Icon";
import Track from "components/Track";
import { FC, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { MdDeleteOutline, MdOutlineEdit } from "react-icons/md";
import { MdDeleteOutline, MdOutlineEdit, MdDragIndicator } from "react-icons/md";
import { Link } from "react-router-dom";
import { deleteEndpoint } from "resources/api-constants";
import useServiceStore from "store/new-services.store";
import useToastStore from "store/toasts.store";
import { Step, StepType } from "types";
import { EndpointData } from "types/endpoint";
import apiIconTag from "../../assets/images/api-icon-tag.svg";

import styles from "./ApiEndpoint.module.scss";
import api from "../../services/api-dev";
import Modal from "components/Modal";
import ApiEndpointCard from "components/ApiEndpointCard";
import { saveEndpoints } from "services/service-builder";
import { removeTrailingUnderscores } from "utils/string-util";
import { useSortable } from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities";

interface RelatedService {
serviceId: string;
Expand All @@ -32,6 +34,14 @@ interface ApiEndpointProps {
const ApiEndpoint: FC<ApiEndpointProps> = ({ step, onClick }) => {
const { t } = useTranslation();

const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: step.id });

const style = {
transform: CSS.Transform.toString(transform),
transition,
opacity: isDragging ? 0.5 : 1,
};

const [relatedServices, setRelatedServices] = useState<RelatedService[]>([]);
const [showEditModal, setShowEditModal] = useState(false);
const [showDeleteModal, setShowDeleteModal] = useState(false);
Expand Down Expand Up @@ -182,18 +192,24 @@ const ApiEndpoint: FC<ApiEndpointProps> = ({ step, onClick }) => {
)}

<Box
ref={setNodeRef}
style={style}
className={styles.box}
key={step.id}
style={{ cursor: "pointer" }}
color={[StepType.FinishingStepEnd, StepType.FinishingStepRedirect].includes(step.type) ? "red" : "blue"}
onClick={() => onClick(step)}
draggable={false}
>
<Track gap={8} style={{ justifyContent: "space-between", overflow: "hidden" }}>
<div className={styles.labelContainer}>
{step.type === "user-defined" && <img alt="" src={apiIconTag} />}
<span className={styles.label}>{step.label}</span>
</div>
<Track gap={8} style={{ alignItems: "center" }}>
<div {...attributes} {...listeners} style={{ cursor: "grab", display: "flex", alignItems: "center" }}>
<Icon icon={<MdDragIndicator size={16} />} size="small" />
</div>
<div className={styles.labelContainer}>
{step.type === "user-defined" && <span className={styles.apiBadge}>API</span>}
{step.data?.isCommon && <span className={styles.publicBadge}>{t("serviceFlow.apiElements.public")}</span>}
<span className={styles.label}>{step.label}</span>
</div>
</Track>
<Track gap={12}>
<button
className={styles.deleteButton}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const EndpointCustom: React.FC<EndpointCustomProps> = ({
key={key}
requestValues={requestValues}
isLive={isLive}
endpointData={endpoint.definitions[0]}
endpoint={endpoint}
requestTab={requestTab}
setRequestTab={setRequestTab}
parentEndpointId={endpoint.endpointId}
Expand Down
Loading
Loading