Skip to content

Commit

Permalink
Merge pull request #1567 from memphisdev/RND-381-rbac-for-client-type…
Browse files Browse the repository at this point in the history
…-users

RND-381-rbac-for-client-type-users
  • Loading branch information
SvetaMemphis committed Dec 28, 2023
2 parents 8d83bf7 + 84327d7 commit 65a3948
Show file tree
Hide file tree
Showing 10 changed files with 835 additions and 299 deletions.
6 changes: 3 additions & 3 deletions ui_src/src/components/selectCheckBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import './style.scss';
import CheckCircleIcon from '@material-ui/icons/CheckCircle';
import React from 'react';

const SelectCheckBox = ({ selectOptions, selectedOption, allowEdit = true, handleOnClick, button, hideCircle, vertical }) => {
const SelectCheckBox = ({ selectOptions, selectedOption, allowEdit = true, handleOnClick, button, hideCircle, vertical, disabled }) => {
return (
<div className="selecte-check-box-wrapper" style={vertical && { display: 'flex', gap: '20px' }}>
{selectOptions.map((value) => {
Expand All @@ -25,11 +25,11 @@ const SelectCheckBox = ({ selectOptions, selectedOption, allowEdit = true, handl
className={
selectedOption === value.value
? 'option-wrapper selected'
: !value.disabled && allowEdit
: !value.disabled && allowEdit && !disabled
? 'option-wrapper allowed'
: 'option-wrapper not-allowed'
}
onClick={() => handleOnClick(value)}
onClick={() => !disabled && handleOnClick(value)}
style={{ width: vertical && '100%' }}
>
<div className="check-and-content">
Expand Down
10 changes: 9 additions & 1 deletion ui_src/src/components/table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import './style.scss';
import { Table as CustomTable } from 'antd';
import React, { useEffect, useState } from 'react';

const Table = ({ columns, data, title, tableRowClassname, className }) => {
const Table = ({ columns, data, title, tableRowClassname, className, onSelectRow }) => {
const [windowHeight, setWindowHeight] = useState(window.innerHeight);
const [numRows, setNumRows] = useState(10);

useEffect(() => {
const handleResize = () => {
setWindowHeight(window.innerHeight);
Expand Down Expand Up @@ -60,6 +61,13 @@ const Table = ({ columns, data, title, tableRowClassname, className }) => {
{...fieldProps}
pagination={{ pageSize: numRows, itemRender: itemRender, hideOnSinglePage: true, responsive: false }}
rowKey={(record) => record.id}
onRow={(record, rowIndex) => {
return {
onClick: (event) => {
onSelectRow(record, rowIndex);
}
};
}}
/>
);
};
Expand Down
24 changes: 24 additions & 0 deletions ui_src/src/connectors/assets/memphisIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions ui_src/src/connectors/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import S3LogoIcon from './assets/s3LogoIcon.svg';
import KafkaIcon from './assets/kafkaIcon.svg';
import RedisIcon from './assets/redisIcon.svg';
import MemphisIcon from './assets/memphisIcon.svg';

import { kafka } from './kafka';
import { redis } from './redis';
import { memphis } from './memphis';

export const connectorTypesSource = [
{ name: 'Kafka', icon: KafkaIcon, comment: 'Supported version: 0.9 and above', inputs: kafka },
Expand All @@ -13,5 +15,6 @@ export const connectorTypesSource = [
export const connectorTypesSink = [
{ name: 'Kafka', icon: KafkaIcon, comment: 'Supported version: 0.9 and above', inputs: kafka },
{ name: 'Redis', icon: RedisIcon, inputs: redis },
{ name: 'Memphis',icon: MemphisIcon, inputs: memphis },
{ name: 'S3', icon: S3LogoIcon, disabled: true, soon: true }
];
96 changes: 96 additions & 0 deletions ui_src/src/connectors/memphis.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
export const memphis = {
Sink: [
{
name: 'name',
display: 'Connector name',
type: 'string',
required: true,
description: 'Note that the sink connector name is also consumer group name'
},
{
name: 'route_strategy',
display: 'Route Strategy',
type: 'select',
options: ['Station Name', 'Header'],
required: true,
children: true,
'Station Name': [
{
name: 'station_name',
display: 'Station Name',
type: 'string',
required: true,
description: 'The name of the station to route messages to (all messages will be routed to the station)'
}
],
Header: [
{
name: 'header_name',
display: 'Header Name',
type: 'string',
required: true,
description: 'The name of the header in Memphis message, to take the station name from. for multiple stations use comma separated values ex. station1,station2'
}
]
},
{
name: 'dest_station_config',
display: 'Destination Station Config',
type: 'select',
options: ['Default Station', 'Custom Station'],
required: true,
description: 'if a station dose not exist, it will be created with the chosen configuration - Default / Custom',
children: true,
'Default Station': [],
'Custom Station': [
{
name: 'partition_number',
display: 'Partition Number',
type: 'string',
required: true,
description: 'The number of partitions in the station'
},
{
name : 'retention_policy',
display : 'Retention Policy',
type : 'select',
options : ['Time', 'Size', 'Messages', 'Ack'],
required : true,
description : 'choose retention policy',
children : true,
Time : [
{
name: 'retention_value',
display: 'Value',
type: 'string',
required: true,
description: 'retention time value in seconds',
placeholder: 0
}
],
Size : [
{
name: 'retention_value',
display: 'Value',
type: 'string',
required: true,
description: 'retentnion size in bytes',
placeholder: 0
}
],
Messages : [
{
name: 'retention_value',
display: 'Value',
type: 'string',
required: true,
description: 'retention messages number',
placeholder: 0
}
],
Ack: []
}
]
}
]
};
40 changes: 30 additions & 10 deletions ui_src/src/connectors/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,36 @@ export const redis = {
children: false
},
{
name: 'username',
display: 'Username',
type: 'string',
required: false
},
{
name: 'password',
display: 'Password',
type: 'string',
required: false
name: 'authentication',
display: 'Authentication',
type: 'select',
options: ['No authentication', 'Username and Password', 'Password Only'],
required: true,
description: 'No Authentication, Username and Password, Password Only',
children: true,
'Username and Password': [
{
name: 'username',
display: 'Username',
type: 'string',
required: true
},
{
name: 'password',
display: 'Password',
type: 'string',
required: true
}
],
'Password Only': [
{
name: 'password',
display: 'Password',
type: 'string',
required: true
}
],
'No authentication': []
},
{
name: 'db',
Expand Down
Loading

0 comments on commit 65a3948

Please sign in to comment.