Skip to content

Commit 9369ed8

Browse files
committed
fixes
1 parent 73f4bb4 commit 9369ed8

File tree

10 files changed

+93
-20
lines changed

10 files changed

+93
-20
lines changed

CONTRIBUTING.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22

33
This is a WIP file.
44

5-
If you want to contribute now, please reach out! Create an issue and lets discuss about it! (:
5+
If you want to contribute now, please reach out! Create an issue and lets discuss about it! (:
6+
7+
## Backoffice
8+
9+
Checkout our [doc](https://matheusmr13.github.io/create-micro-react-app/docs/backoffice/developing).
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
id: developing
3+
title: Developing
4+
---
5+
6+
### Setup your environment
7+
8+
First of all, you will need a postgresql server to connect to.
9+
10+
If you are using aws s3 as your artifact's host, login in into aws cli and then startup your backoffice
11+
12+
Create a .env.development.local with some envs:
13+
14+
```
15+
# Core configs
16+
17+
database_config='{"host":"my.host", "port": 5432, "username": "my-user", "password": "my-password", "database": "my-db}'
18+
firebase_admin_config='FIREBASE_ADMIN_CONFIG_JSON' # https://firebase.google.com/docs/admin/setup#initialize_the_sdk
19+
firebase_config='FIREBASE_CONFIG_JSON' # https://firebase.google.com/docs/web/setup#config-object
20+
21+
# AWS (needed only if you will use aws s3 as your artifact manager or to deploy some application)
22+
aws_profile='my-profile'
23+
AWS_SDK_LOAD_CONFIG=1 # needed to use a profile
24+
AWS_ARTIFACTS_BUCKET='some-bucket-with-all-artifacts'
25+
```
26+
27+
Run a script:
28+
29+
`./scripts/start.js`
30+
31+
Access your backoffice: http://localhost:3333/

packages/doc/docs/backoffice/namespace.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ id: namespace
33
title: Namespace
44
---
55

6-
asd
6+
import { WipTag } from './components/tag';
7+
8+
<WipTag />

packages/doc/sidebars.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ module.exports = {
44
Core: ['core', 'core/examples'],
55
'How it works': ['how-it-works'],
66
'Command line interface': ['cli', 'cli/create', 'cli/start', 'cli/build'],
7-
Backoffice: ['backoffice', 'backoffice/setup-environment', 'backoffice/setup-application', 'backoffice/namespace'],
7+
Backoffice: [
8+
'backoffice',
9+
'backoffice/setup-environment',
10+
'backoffice/setup-application',
11+
'backoffice/namespace',
12+
'backoffice/namespace',
13+
],
814
Support: ['support'],
915
},
1016
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import {MigrationInterface, QueryRunner} from "typeorm";
2+
3+
export class PostRefactorin1598384168452 implements MigrationInterface {
4+
name = 'PostRefactorin1598384168452'
5+
6+
public async up(queryRunner: QueryRunner): Promise<void> {
7+
await queryRunner.query(`CREATE TABLE "user" ("id" character varying NOT NULL, "githubToken" character varying NOT NULL, "slackToken" character varying NOT NULL, CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id"))`);
8+
await queryRunner.query(`CREATE TABLE "version" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, "createdAt" character varying NOT NULL, "microfrontendId" character varying NOT NULL, "sha" character varying NOT NULL, "path" character varying NOT NULL, "status" character varying NOT NULL, CONSTRAINT "PK_4fb5fbb15a43da9f35493107b1d" PRIMARY KEY ("id"))`);
9+
await queryRunner.query(`CREATE TABLE "microfrontend" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, "ownerId" character varying NOT NULL, "createdAt" character varying NOT NULL, "packageName" character varying NOT NULL, "projectLink" character varying NOT NULL, "integrationType" character varying, "originId" character varying, "applicationId" character varying NOT NULL, "approvalType" character varying NOT NULL, "type" character varying NOT NULL, CONSTRAINT "PK_7a5b9f984737f28b20d8bf54bc0" PRIMARY KEY ("id"))`);
10+
await queryRunner.query(`CREATE TABLE "deploy" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, "ownerId" character varying NOT NULL, "createdAt" character varying NOT NULL, "versions" text NOT NULL, "applicationId" character varying NOT NULL, "namespaceId" character varying NOT NULL, "status" character varying NOT NULL, CONSTRAINT "PK_e515d996a39c08335939905ca2b" PRIMARY KEY ("id"))`);
11+
await queryRunner.query(`CREATE TABLE "namespace" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, "ownerId" character varying NOT NULL, "createdAt" character varying NOT NULL, "path" character varying NOT NULL, "applicationId" character varying NOT NULL, "isMain" boolean NOT NULL, "currentDeployId" character varying NOT NULL, "nextDeployId" character varying NOT NULL, CONSTRAINT "PK_155557f16b1d166388d7308086a" PRIMARY KEY ("id"))`);
12+
await queryRunner.query(`CREATE TABLE "application" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, "ownerId" character varying NOT NULL, "createdAt" character varying NOT NULL, "integrationType" character varying, "destinationId" character varying, "slackChannelId" character varying, CONSTRAINT "PK_569e0c3e863ebdf5f2408ee1670" PRIMARY KEY ("id"))`);
13+
await queryRunner.query(`CREATE TABLE "destination" ("id" uuid NOT NULL, "type" character varying NOT NULL, "config" text NOT NULL, CONSTRAINT "PK_e45b5ee5788eb3c7f0ae41746e7" PRIMARY KEY ("id"))`);
14+
}
15+
16+
public async down(queryRunner: QueryRunner): Promise<void> {
17+
await queryRunner.query(`DROP TABLE "destination"`);
18+
await queryRunner.query(`DROP TABLE "application"`);
19+
await queryRunner.query(`DROP TABLE "namespace"`);
20+
await queryRunner.query(`DROP TABLE "deploy"`);
21+
await queryRunner.query(`DROP TABLE "microfrontend"`);
22+
await queryRunner.query(`DROP TABLE "version"`);
23+
await queryRunner.query(`DROP TABLE "user"`);
24+
}
25+
26+
}

packages/server/ormconfig.json

-13
This file was deleted.

packages/server/src/entity/microfrontend.ts

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class Microfrontend extends BaseEntity {
4343
@Column()
4444
public packageName: string = '';
4545

46+
@Column()
47+
public projectLink: string = '';
48+
4649
@Column({ nullable: true })
4750
public integrationType?: INTEGRATION_TYPE;
4851

packages/webapp/src/app/home/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function FullApp() {
121121
))}
122122
</Switch>
123123
</Content>
124-
<Footer style={{ textAlign: 'center' }}>Copyright © 2020 Matheus Martins</Footer>
124+
<Footer style={{ textAlign: 'center' }}><a href="https://matheusmr13.github.io/create-micro-react-app/docs/">Create Micro React App</a></Footer>
125125
</Layout>
126126
</Layout>
127127
);

packages/webapp/src/modules/application/details/microfrontend-list.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect } from 'react';
2-
import { Card, Col, Row } from 'antd';
2+
import { Card, Col, Row, Tag, Space } from 'antd';
33
import { useLoggedApiRequest } from 'base/hooks/request';
44
import { Link } from 'react-router-dom';
55
import Section from 'base/components/section';
@@ -21,7 +21,10 @@ const MicrofrontendList: React.FunctionComponent<IMicrofrontendListProps> = ({ a
2121
microfrontends.map((microfrontend: any) => (
2222
<Col span={6} key={microfrontend.id}>
2323
<Card title={microfrontend.name} extra={<Link to={`../microfrontend/${microfrontend.id}`}>Edit</Link>}>
24-
{microfrontend.name}
24+
<Space direction="vertical">
25+
<Tag color="blue">package: {microfrontend.packageName}</Tag>
26+
<Tag color={microfrontend.type === 'CONTAINER' ? 'red' : 'orange'}>type: {microfrontend.type}</Tag>
27+
</Space>
2528
</Card>
2629
</Col>
2730
))}

packages/webapp/src/modules/microfrontend/form.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState, FC } from 'react';
22
import { useLoggedApiRequest } from 'base/hooks/request';
33

44
import { useHistory } from 'react-router-dom';
5-
import { Form, Input, Button, Typography, Timeline, Select, AutoComplete } from 'antd';
5+
import { Form, Input, Button, Typography, Timeline, Select, AutoComplete, Switch } from 'antd';
66
import Page from 'base/components/page';
77
import useQuery from 'base/hooks/query-param';
88
const { Title } = Typography;
@@ -105,6 +105,17 @@ const NewMicrofrontend: React.FC<{
105105
<Input />
106106
</Form.Item>
107107

108+
<Form.Item label="Project link" name="projectLink">
109+
<Input />
110+
</Form.Item>
111+
112+
<Form.Item label="Type" name="type">
113+
<Select>
114+
<Select.Option value="MICROFRONTEND">Microfrontend</Select.Option>
115+
<Select.Option value="CONTAINER">Container</Select.Option>
116+
</Select>
117+
</Form.Item>
118+
108119
{!loadingIntegrations && (
109120
<Form.Item label="Integration type" name="integrationType">
110121
<Select>

0 commit comments

Comments
 (0)