Content-Length: 411870 | pFad | http://github.com/lowcoder-org/lowcoder/pull/1712/commits/130b7625898c2a0563cb97497058081dc008dace

2C [Feat] Add Environments Manually by iamfaran · Pull Request #1712 · lowcoder-org/lowcoder · GitHub
Skip to content

[Feat] Add Environments Manually #1712

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

Merged
merged 11 commits into from
May 26, 2025
Prev Previous commit
Next Next commit
Add contact modal for unlicense environment
  • Loading branch information
iamfaran committed May 26, 2025
commit 130b7625898c2a0563cb97497058081dc008dace
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import React, { useEffect } from 'react';
import { Modal, Card, Row, Col, Typography, Divider } from 'antd';
import { CustomerServiceOutlined, CloudServerOutlined } from '@ant-design/icons';
import { useSelector, useDispatch } from 'react-redux';
import { getDeploymentId } from 'redux/selectors/configSelectors';
import { fetchDeploymentIdAction } from 'redux/reduxActions/configActions';
import { Environment } from '../types/environment.types';

const { Title, Text } = Typography;

interface ContactLowcoderModalProps {
visible: boolean;
onClose: () => void;
environment: Environment;
}

/**
* Professional modal for contacting Lowcoder team with HubSpot form integration
*/
const ContactLowcoderModal: React.FC<ContactLowcoderModalProps> = ({
visible,
onClose,
environment
}) => {
// Get deploymentId from Redux config provider
const deploymentId = useSelector(getDeploymentId);
const dispatch = useDispatch();

// Fetch deployment ID when modal opens if not already available
useEffect(() => {
if (visible && !deploymentId) {
dispatch(fetchDeploymentIdAction());
}
}, [visible, deploymentId, dispatch]);

return (
<Modal
title={
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
<CustomerServiceOutlined style={{ fontSize: '20px', color: '#1890ff' }} />
<span style={{ fontSize: '18px', fontWeight: 600 }}>Contact Lowcoder Team</span>
</div>
}
open={visible}
onCancel={onClose}
footer={null}
width={800}
centered
style={{ top: 20 }}
bodyStyle={{ padding: '24px' }}
>
{/* Environment Context Section */}
<Card
style={{
marginBottom: '24px',
borderRadius: '8px',
background: '#fafafa',
border: '1px solid #f0f0f0'
}}
bodyStyle={{ padding: '16px' }}
>
<Row gutter={[16, 8]} align="middle">
<Col>
<CloudServerOutlined style={{ fontSize: '24px', color: '#1890ff' }} />
</Col>
<Col flex={1}>
<div>
<Text strong style={{ fontSize: '16px', color: '#262626' }}>
Environment: {environment.environmentName || 'Unnamed Environment'}
</Text>
<br />
<Text style={{ fontSize: '14px', color: '#8c8c8c', fontFamily: 'monospace' }}>
Environment ID: {environment.environmentId}
</Text>
<br />
<Text style={{ fontSize: '14px', color: '#8c8c8c', fontFamily: 'monospace' }}>
Deployment ID: {deploymentId || 'Loading...'}
</Text>
</div>
</Col>
</Row>
</Card>

<Divider style={{ margin: '16px 0' }} />

{/* HubSpot Form Integration Section */}
<div style={{ minHeight: '400px', padding: '20px 0' }}>
<Title level={4} style={{ textAlign: 'center', marginBottom: '24px', color: '#262626' }}>
Get in Touch
</Title>

<Text style={{
textAlign: 'center',
display: 'block',
marginBottom: '32px',
fontSize: '16px',
color: '#595959',
lineHeight: '1.6'
}}>
Our team is here to help you resolve licensing issues and get your environment up and running.
</Text>

{/* HubSpot Form Container */}
<div style={{
minHeight: '300px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
background: '#fdfdfd',
borderRadius: '8px',
border: '1px solid #f0f0f0'
}}>
{/* HubSpot form will be integrated here */}
<div style={{
textAlign: 'center',
color: '#8c8c8c',
fontSize: '14px'
}}>
<CustomerServiceOutlined style={{ fontSize: '48px', marginBottom: '16px', color: '#d9d9d9' }} />
<div>Contact form will be integrated here</div>
</div>
</div>

{/* Environment data is available for form pre-filling */}
{/* Data available: environment.environmentName, environment.environmentId, deploymentId,
environment.licenseStatus, environment.environmentType, environment.licenseError */}
</div>
</Modal>
);
};

export default ContactLowcoderModal;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState } from 'react';
import { Button, Card, Space, Typography, Row, Col } from 'antd';
import {
CustomerServiceOutlined,
Expand All @@ -9,6 +9,7 @@ import {
WarningOutlined
} from '@ant-design/icons';
import { Environment } from '../types/environment.types';
import ContactLowcoderModal from './ContactLowcoderModal';
import history from "@lowcoder-ee/util/history";

const { Title, Text } = Typography;
Expand All @@ -25,6 +26,8 @@ const UnlicensedEnvironmentView: React.FC<UnlicensedEnvironmentViewProps> = ({
environment,
onEditClick
}) => {
const [isContactModalVisible, setIsContactModalVisible] = useState(false);

const getLicenseIcon = () => {
switch (environment.licenseStatus) {
case 'unlicensed':
Expand Down Expand Up @@ -144,6 +147,7 @@ const UnlicensedEnvironmentView: React.FC<UnlicensedEnvironmentViewProps> = ({
type="primary"
size="large"
icon={<CustomerServiceOutlined />}
onClick={() => setIsContactModalVisible(true)}
style={{
width: '100%',
height: '48px',
Expand All @@ -154,7 +158,6 @@ const UnlicensedEnvironmentView: React.FC<UnlicensedEnvironmentViewProps> = ({
border: 'none',
boxShadow: '0 4px 12px rgba(24, 144, 255, 0.3)'
}}
// onClick will be handled later when modal is ready
>
Contact Lowcoder Team
</Button>
Expand Down Expand Up @@ -208,6 +211,13 @@ const UnlicensedEnvironmentView: React.FC<UnlicensedEnvironmentViewProps> = ({
</div>
</Col>
</Row>

{/* Contact Lowcoder Modal */}
<ContactLowcoderModal
visible={isContactModalVisible}
onClose={() => setIsContactModalVisible(false)}
environment={environment}
/>
</div>
);
};
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/lowcoder-org/lowcoder/pull/1712/commits/130b7625898c2a0563cb97497058081dc008dace

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy