Skip to content

Commit b0f1eae

Browse files
Merge pull request #553 from zenml-io/UAT
Uat
2 parents 188e4eb + 42dbfa9 commit b0f1eae

File tree

51 files changed

+4923
-2585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4923
-2585
lines changed

appserverSchema.d.ts

Lines changed: 4600 additions & 2475 deletions
Large diffs are not rendered by default.

src/api/organizations/inviteApi.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import { apiUrl } from '../apiUrl';
66
const inviteApi = ({
77
authenticationToken,
88
name,
9+
is_admin,
910
}: {
1011
authenticationToken: string;
1112
name: string;
13+
is_admin: boolean;
1214
}): Promise<void> =>
1315
fetchApiWithAuthRequest({
1416
url: apiUrl(`${endpoints.organizations.invite}?assign_default_role=false`),
@@ -19,6 +21,7 @@ const inviteApi = ({
1921
},
2022
data: JSON.stringify({
2123
name,
24+
is_admin,
2225
}),
2326
});
2427

src/redux/actions/organizations/inviteAction.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import inviteApi from '../../../api/organizations/inviteApi';
33

44
export const inviteAction = ({
55
name,
6+
is_admin,
67
onFailure,
78
onSuccess,
89
}: {
910
name: string;
11+
is_admin: boolean;
1012
onFailure?: (err: any) => void;
1113
onSuccess?: (res: any) => void;
1214
}): TRequestAction => ({
@@ -16,7 +18,7 @@ export const inviteAction = ({
1618
isAuthenticated: true,
1719
failureActionType: organizationActionTypes.invite.failure,
1820
successActionType: organizationActionTypes.invite.success,
19-
params: { name },
21+
params: { name, is_admin },
2022
onFailure,
2123
onSuccess,
2224
},

src/redux/persistedReducers.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,15 @@ export const persisted = combineReducers({
130130

131131
export default (state: any, action: any) => {
132132
if (action.type === ACCOUNT_LOGOUT) {
133-
if (state.serverInfo.authScheme === 'EXTERNAL') {
134-
axios
135-
.get(`${process.env.REACT_APP_BASE_API_URL}${endpoints.logout}`)
136-
.then(() => {
137-
return persisted(initialState as any, action);
138-
});
139-
}
133+
axios
134+
.get(`${process.env.REACT_APP_BASE_API_URL}${endpoints.logout}`)
135+
.then(() => {
136+
return persisted(initialState as any, action);
137+
})
138+
.catch(() => {
139+
return persisted(initialState as any, action);
140+
});
141+
140142
return persisted(initialState as any, action);
141143
}
142144

src/ui/layouts/common/CustomConnectorBox/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
22
import { Box, FlexBox, Paragraph } from '../../../components';
33
import ReactTooltip from 'react-tooltip';
44
import styles from './index.module.scss';
5+
import { sanitizeUrl } from '../../../../utils/url';
56

67
export const CustomConnectorBox: React.FC<{
78
connectorName: string;
@@ -60,7 +61,7 @@ export const CustomConnectorBox: React.FC<{
6061
{resourceTypes?.map((e: any) => (
6162
<Box marginLeft="sm" className={styles.resourceImages}>
6263
<div data-tip data-for={e?.name}>
63-
<img src={e?.logo_url} alt={e?.name} />
64+
<img src={sanitizeUrl(e?.logo_url)} alt={e?.name} />
6465
</div>
6566
<ReactTooltip id={e?.name} place="top" effect="solid">
6667
<Paragraph color="white">{e?.name}</Paragraph>

src/ui/layouts/common/SidePopup/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
import styles from './index.module.scss';
1414
import { replaceVersion } from '../../../../utils/string';
1515
import { checkUrlStatus } from '../../../../utils/checkUrlStatus';
16+
import { sanitizeUrl } from '../../../../utils/url';
1617

1718
const Dimmer: React.FC = () => <Box className={styles.dimmer}></Box>;
1819

@@ -77,7 +78,11 @@ export const SidePopup: React.FC<{
7778
style={{
7879
paddingBottom: '270px',
7980
}}
80-
src={is404 ? updatedSdkDocsUrl : defaultSdkDocsUrl}
81+
src={
82+
is404
83+
? sanitizeUrl(updatedSdkDocsUrl)
84+
: sanitizeUrl(defaultSdkDocsUrl)
85+
}
8186
></iframe>
8287
</Box>
8388

src/ui/layouts/common/layouts/AuthenticatedLayout/AuthenticatedHeader.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { WorkspacePopup } from './workspacePopup';
4040
import ReactTooltip from 'react-tooltip';
4141
import { Breadcrumbs } from '../../Breadcrumbs';
4242
import DeploymentBanner from './DeploymentBanner';
43+
import DashboardBanner from './DashboardBanner';
4344

4445
export const AuthenticatedHeader: React.FC<{
4546
breadcrumb?: Array<any>;
@@ -55,6 +56,8 @@ export const AuthenticatedHeader: React.FC<{
5556
const [popupOpen, setPopupOpen] = useState<boolean>(false);
5657
const [createPopupOpen, setCreatePopupOpen] = useState<boolean>(false);
5758

59+
const authScheme = useSelector(serverInfoSelectors.getAuthScheme);
60+
5861
const dispatch = useDispatch();
5962

6063
const { push } = usePushRoute();
@@ -144,7 +147,8 @@ export const AuthenticatedHeader: React.FC<{
144147

145148
return (
146149
<>
147-
{deploymentType === 'local' && <DeploymentBanner />}
150+
{deploymentType === 'local' && <DeploymentBanner />}{' '}
151+
{authScheme !== 'EXTERNAL' && <DashboardBanner />}
148152
{createPopupOpen && <WorkspacePopup setPopupOpen={setCreatePopupOpen} />}
149153
<FlexBox
150154
paddingHorizontal="lg"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React, { useState } from 'react';
2+
import styles from './styles.module.scss';
3+
import { dashboardKey } from './service';
4+
import { icons } from '../../../../../components';
5+
6+
function DashboardBanner() {
7+
const [isDashboardBannerDismissed, setDashboardDismissed] = useState(
8+
!!sessionStorage.getItem(dashboardKey),
9+
);
10+
11+
if (isDashboardBannerDismissed) return null;
12+
return (
13+
<aside className={styles.deploymentBanner}>
14+
<p className={styles.deploymentBanner__paragraph}>
15+
This dashboard interface will soon be updated. Click{' '}
16+
<a
17+
target="_blank"
18+
rel="noopener noreferrer"
19+
href="https://www.zenml.io/cloud"
20+
>
21+
here
22+
</a>{' '}
23+
for a preview!
24+
</p>
25+
<button
26+
className={styles.deploymentBanner__close}
27+
onClick={() => {
28+
sessionStorage.setItem(dashboardKey, 'true');
29+
setDashboardDismissed(true);
30+
}}
31+
>
32+
<icons.close />
33+
</button>
34+
</aside>
35+
);
36+
}
37+
38+
export default DashboardBanner;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const dashboardKey = 'dashboard-banner-dismissed';
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@import '../../../../../globalStyles';
2+
3+
.deploymentBanner {
4+
width: 100%;
5+
background-color: #f1ebfe;
6+
font-size: 16px;
7+
display: flex;
8+
color: #0d061d;
9+
font-family: Rubik;
10+
padding: 0.5rem 16px;
11+
justify-content: space-between;
12+
align-items: center;
13+
14+
&__paragraph {
15+
text-align: center;
16+
margin: 0;
17+
flex: 1;
18+
}
19+
&__close {
20+
padding: 0;
21+
margin: 0;
22+
border: none;
23+
background: none;
24+
font: inherit;
25+
color: inherit;
26+
cursor: pointer;
27+
outline: none;
28+
}
29+
}
30+
31+
@media (max-width: $md-breakpoint) {
32+
.deploymentBanner {
33+
padding: 0.5rem 1rem;
34+
font-size: 14px;
35+
}
36+
}

0 commit comments

Comments
 (0)