Skip to content
Merged

Dev #151

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d41c640
Test Migration and Settings new design changes
sayalijoshi27 Jun 19, 2024
c421188
Merge branch 'dev' of https://github.com/contentstack/migration-v2-no…
sayalijoshi27 Jun 19, 2024
bc9c955
refactor:modified validated api props
AishDani Jun 19, 2024
21f5a82
Merge pull request #145 from contentstack/feature/legacy-cms
v1shalpatel Jun 19, 2024
53ab528
Merge branch 'dev' of https://github.com/contentstack/migration-v2-no…
sayalijoshi27 Jun 19, 2024
a32b0cb
solved issues on destination stack
snehalsankhe Jun 19, 2024
4380efa
merge from dev
snehalsankhe Jun 19, 2024
3376021
Merge pull request #146 from contentstack/layout-changes
sreeneshkini Jun 19, 2024
4c8cfc0
Content Mapper changes
sayalijoshi27 Jun 19, 2024
949de18
Merge branch 'dev' of https://github.com/contentstack/migration-v2-no…
sayalijoshi27 Jun 19, 2024
c3a515b
Merge pull request #147 from contentstack/feature/CMG-57
sreeneshkini Jun 19, 2024
03d4ee0
feat:added search functionality in getAllStack api
AishDani Jun 19, 2024
03f6876
refactor:handled empty stack getting even if stack is present
AishDani Jun 19, 2024
1558603
Merge pull request #148 from contentstack/feature/legacy-cms
sreeneshkini Jun 19, 2024
6ad0601
Design corrections
sayalijoshi27 Jun 20, 2024
6472e75
Merge pull request #149 from contentstack/feature/CMG-57
v1shalpatel Jun 20, 2024
8b4a6ff
refactor:resolved not getting group and refernce options in mapper dr…
AishDani Jun 20, 2024
7d3601c
Merge branch 'dev' of github.com:contentstack/migration-v2-node-serve…
AishDani Jun 20, 2024
230371b
Merge pull request #150 from contentstack/feature/legacy-cms
v1shalpatel 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
2 changes: 1 addition & 1 deletion api/src/routes/org.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import validator from "../validators/index.js";
const router = express.Router({ mergeParams: true });

// GET all org stacks route
router.get("/stacks", asyncRouter(orgController.getAllStacks));
router.get("/stacks/:searchText?", asyncRouter(orgController.getAllStacks));

// Create a new stack route
router.post(
Expand Down
2 changes: 1 addition & 1 deletion api/src/services/migration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const createTestStack = async (req: Request): Promise<LoginServiceType> => {

await ProjectModelLowdb.read();
const projectData = ProjectModelLowdb.chain.get("projects").value();
const testStackCount = projectData[0].test_stacks.length + 1;
const testStackCount = projectData[0]?.test_stacks?.length + 1;
const newName = name + "-" + testStackCount;

const [err, res] = await safePromise(
Expand Down
13 changes: 11 additions & 2 deletions api/src/services/org.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const getAllStacks = async (req: Request): Promise<LoginServiceType> => {
const srcFun = "getAllStacks";
const orgId = req?.params?.orgId;
const { token_payload } = req.body;
const search: string = req?.params?.searchText?.toLowerCase();

try {
const authtoken = await getAuthtoken(
Expand Down Expand Up @@ -42,13 +43,21 @@ const getAllStacks = async (req: Request): Promise<LoginServiceType> => {
err.response.data
)
);

return {
data: err.response.data,
status: err.response.status,
};
}
let locale = await getStackLocal(token_payload, res.data.stacks);
let stacks = res?.data?.stacks;
if(search){
stacks = stacks.filter((stack:{name: string, description:string})=>{
const stackName = stack?.name?.toLowerCase();
const stackDescription = stack?.description?.toLowerCase();
return stackName?.includes(search) || stackDescription?.includes(search);

})
}
const locale = await getStackLocal(token_payload, stacks);
return {
data: {
stacks: locale,
Expand Down
15 changes: 9 additions & 6 deletions ui/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
// Libraries
import { Suspense } from 'react';
import { Provider} from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import { FullPageLoader } from '@contentstack/venus-components';

import { persistor, store } from './store';

// Components
import AppRouter from './components/Common/router';
import ErrorBoundary from './components/ErrorBoundary';
import AppContextProvider from './context/app/app.provider';
import AppLayout from './components/layout/AppLayout';
import { Suspense, useEffect } from 'react';
import { FullPageLoader } from '@contentstack/venus-components';
import { persistor, store } from './store';

// Styles
import '@contentstack/venus-components/build/main.css';
import './scss/App.scss';
import { Provider} from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';

function App() {

Expand Down
102 changes: 50 additions & 52 deletions ui/src/components/Common/Settings/Settings.scss
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
@import '../../../scss/variables';

.icon-wrapper {
background-color: $color-base-white-10 !important;
}
.setting-wrapper {
width: 100%;
margin: 0 !important;
}
#setting-page {
display: flex;
width: 100%;
.SectionHeader {
color: $color-stepper-title;
font-weight: $font-weight-semi-bold;
margin-bottom: 2rem;
}
.PageLayout {
width: 100%;
}
.PageLayout__head {
border-left: 0 none;
.PageLayout__head, .PageLayout__leftSidebar {
border-top: 0 none;
}
.PageLayout--primary {
.PageLayout__content {
.PageLayout__body {
background: none;
margin-left: 15rem;
padding-top: $px-8;
}
}
}
.action-component-title {
justify-content: space-between;
width: calc(100vw - 326px);
}
.content-block {
margin-right: 0;
padding: 1.5rem;
width: 100%;
}
}
.deleteButton {
position: fixed !important;
right: $px-40;
top: $px-80;
}

.Field {
margin-bottom: $px-40;
}
.settings-body {
padding-left: 120px !important;
}

#page_header {
margin-left: 50px !important;
}

.pagehead-wrapper {
margin-left: 240px;
width: calc(100% - 15rem) !important ;
z-index: 10 !important;
}
.PageLayout__leftSidebar--hide {
display: none;
}
Expand All @@ -47,16 +45,16 @@
margin-top: 0 !important;
}

.content-body .white-box-container {
background-color: $color-brand-white-base;
padding: 20px;
margin-top: 50px !important;
margin-left: 240px;
margin-right: auto;
position: relative;
z-index: 10;
height: 600px;
}
// .content-body .white-box-container {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete comments that are not necessary.

// background-color: $color-brand-white-base;
// padding: 20px;
// margin-top: 50px !important;
// margin-left: 240px;
// margin-right: auto;
// position: relative;
// z-index: 10;
// height: 600px;
// }

.stack-settings__heading {
color: $color-base-black-base;
Expand All @@ -67,22 +65,22 @@
margin-bottom: $px-20;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete comments that are not necessary.

.toggle-class {
width: calc(100% - 18.4375rem) !important;
}
.layout-container.specific-context .PageLayout__head {
z-index: 10 !important;
margin-left: 240px;
width: 100% !important;
}
.SaveButton {
padding: 30px 10px;
}
// .toggle-class {
// width: calc(100% - 18.4375rem) !important;
// }
// .layout-container.specific-context .PageLayout__head {
// z-index: 10 !important;
// margin-left: 240px;
// width: 100% !important;
// }
// .SaveButton {
// padding: 30px 10px;
// }

.layout-container.content-body .PageLayout__body {
margin-top: 90px !important;
margin-left: 227px !important;
}
// .layout-container.content-body .PageLayout__body {
// margin-top: 90px !important;
// margin-left: 227px !important;
// }

.PageLayout__leftSidebar {
background-color: #f7f9fc !important;
Expand Down
85 changes: 18 additions & 67 deletions ui/src/components/Common/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,22 @@ const Settings = () => {
const pageActions = [
{
label: (
<div className="actions flex-v-center deleteButton">
<div className="mr-16">
<Button
class="Button Button--secondary Button--size-large Button--icon-alignment-left Button--v2"
aria-label="Delete Project for deleting project"
type="button"
onClick={handleClick}
>
<div className="flex-center">
<div className="flex-v-center Button__mt-regular Button__visible">
<Icon
icon="Delete"
version="v2"
data={cmsData?.project?.delete_project?.title}
></Icon>
</div>
</div>
</Button>
<Button
class="Button Button--secondary Button--size-large Button--icon-alignment-left Button--v2"
aria-label="Delete Project for deleting project"
type="button"
onClick={handleClick}
>
<div className="flex-center">
<div className="flex-v-center Button__mt-regular Button__visible">
<Icon
icon="Delete"
version="v2"
data={cmsData?.project?.delete_project?.title}
></Icon>
</div>
</div>
</div>
</Button>
)
}
];
Expand All @@ -170,7 +166,7 @@ const Settings = () => {
component: (
<div>
{active === cmsData?.project?.title && (
<div className="stack-settings__section-wrapper">
<div className="content-block">
<div data-test-id="cs-stack-setting-general" className="stack-settings__heading">
{cmsData?.project?.general}
</div>
Expand Down Expand Up @@ -207,28 +203,6 @@ const Settings = () => {
</div>
</div>
</div>

<div className="stack-settings__section__fields">
<div className="Field Field--full" data-test-id="cs-field"></div>
<FieldLabel className="FieldLabel" htmlFor="projectDescription">
{cmsData?.project?.email}
</FieldLabel>
<div className="flex-v-center">
<div className="TextInput TextInput--large TextInput--disabled TextInput__read-only TextInput__read-only-disabled">
<TextInput
aria-label="email"
version="v2"
value={user?.email}
disabled={true}
></TextInput>
<span className="TextInput__read-only__wrapper">
<div className="tippy-wrapper">
<Icon icon="Lock" size="small" version="v2" />
</div>
</span>
</div>
</div>
</div>
<div className="SaveButton">
<Button
buttonType="primary"
Expand All @@ -248,17 +222,7 @@ const Settings = () => {
)}
{active === cmsData?.execution_logs?.title && (
<div>
{/* <InfiniteScrollTable
loading={loading}
data={tableData}
columns={columns}
uniqueKey={'uid'}
canRefresh
itemStatusMap={itemStatusMap}
fetchTableData={fetchData}
tableHeight={472}
equalWidthColumns={true}
/> */}

</div>
)}
</div>
Expand All @@ -267,7 +231,7 @@ const Settings = () => {

const leftSidebar = {
component: (
<div style={{ textAlign: 'left' }}>
<div>
<div
data-testid="cs-section-header"
className="SectionHeader SectionHeader--extra-bold SectionHeader--medium SectionHeader--black SectionHeader--v2"
Expand All @@ -288,19 +252,6 @@ const Settings = () => {
}}
version="v2"
/>
<div>
<ListRow
rightArrow={true}
active={active === cmsData?.execution_logs?.title}
content={cmsData?.execution_logs?.title}
leftIcon={<Icon icon="Stacks" version="v2" />}
onClick={() => {
setActive(cmsData?.execution_logs?.title);
setCurrentHeader(cmsData?.execution_logs?.title);
}}
version="v2"
/>
</div>
</div>
)
};
Expand Down
5 changes: 3 additions & 2 deletions ui/src/components/Common/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const LoginLazyLoad = lazy(() => import('../../pages/Login'));
const RegionalLoginLazyLoad = lazy(() => import('../../pages/RegionalLogin'));
const MigrationLazyLoad = lazy(() => import('../../pages/Migration'));
const ProjectsLazyLoad = lazy(() => import('../../pages/Projects'));
const SettingsLazyLoad = lazy(() => import ('../Common/Settings'))

const AppRouter = () => {
return (
Expand All @@ -34,9 +35,9 @@ const AppRouter = () => {
<Route
path="/projects/:projectId/migration/steps/:stepId"
element={<MigrationLazyLoad />}
>
/>

</Route>
<Route path="/projects/:projectId/settings" element={<SettingsLazyLoad />} />
</Route>

<Route path="*" element={<ErrorPage contentType={CS_ENTRIES.NOT_FOUND_ERROR} />} />
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/ContentMapper/contentMapper.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export interface FieldMetadata {
export interface ContentTypesSchema {
uid?: string;
display_name?: string;
data_type?: 'text' | 'number' | 'isodate' | 'json' | 'file';
data_type?: 'text' | 'number' | 'isodate' | 'json' | 'file' | 'reference' | 'group';
field_metadata?: FieldMetadata;
enum?: any;
}
Expand Down
1 change: 1 addition & 0 deletions ui/src/components/ContentMapper/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
border-bottom: 1px solid $color-brand-secondary-lightest;
padding: $px-8 $px-12;
.Search__v2 {
background-color: $color-brand-white-base;
height: 2.5rem;
width: 100%!important;
.Search-input-show {
Expand Down
Loading