Skip to content

Commit

Permalink
Merge pull request #49 from ExpressApp/feature/ki/bundle3
Browse files Browse the repository at this point in the history
New frontend
  • Loading branch information
ikudinov authored Jul 8, 2024
2 parents 969d76a + 7792f85 commit fe692ab
Show file tree
Hide file tree
Showing 210 changed files with 7,928 additions and 41,853 deletions.
7 changes: 0 additions & 7 deletions frontend/.eslintrc

This file was deleted.

31 changes: 6 additions & 25 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
.eslintcache

npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea/

node_modules
dist
build
build.zip

package-lock.json
yarn.lock
yarn-error.log
79 changes: 6 additions & 73 deletions frontend/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,11 @@
stages:
- styles
- build
- deploy
- lint

cache:
paths:
- node_modules

styles:
stage: styles
image: node:16
tags:
- docker
- web_client
variables:
NODE_ENV: test
before_script:
- |
eval `ssh-agent -s` > /dev/null
chmod 600 ${SSH_PRIVATE_KEY}
ssh-add ${SSH_PRIVATE_KEY}
mkdir -p ~/.ssh
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
script:
- npm config set -- '//gitlab.ccsteam.ru/api/v4/projects/621/packages/npm/:_authToken' "$CI_JOB_TOKEN"
- npm install
- node_modules/.bin/eslint ./src

.deploy:web:
stage: build
image: node:16
lint:
stage: lint
image: node:18
tags:
- docker
- web_client
artifacts:
reports:
dotenv: vars.env
when: manual
before_script:
- export SMARTAPP_TAG=$(node -p "require('./package.json').version")
script:
- npm run build
- tar -cvzf build.tgz ./build/
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file build.tgz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/smartapp.feature-smartapp/${SMARTAPP_TAG}/build.tgz"'
- echo "SMARTAPP_TAG=$SMARTAPP_TAG" > vars.env
- echo "DEPLOY_ENV=$DEPLOY_ENV" >> vars.env

deploy:web:dev:
extends: .deploy:web
variables:
DEPLOY_ENV: dev

deploy:web:prod:
extends: .deploy:web
variables:
DEPLOY_ENV: prod


deploy:bot:dev:
stage: deploy
variables:
SMARTAPP_TAG: $SMARTAPP_TAG
needs:
- deploy:web:dev
trigger:
project: bots/next-feature-smartapp
branch: dev

deploy:bot:prod:
stage: deploy
variables:
SMARTAPP_TAG: $SMARTAPP_TAG
needs:
- deploy:web:prod
trigger:
project: bots/next-feature-smartapp
branch: master
- yarn install
- yarn lint
1 change: 0 additions & 1 deletion frontend/.npmrc

This file was deleted.

21 changes: 0 additions & 21 deletions frontend/.prettierrc

This file was deleted.

14 changes: 14 additions & 0 deletions frontend/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"configurations": [
{
"name": "Attach to Chrome",
"request": "attach",
"type": "chrome",
"webRoot": "${workspaceFolder}",
"port": 9222,
"url": "http://localhost:3000/*",
"sourceMaps": true,
"trace": true
}
]
}
3 changes: 3 additions & 0 deletions frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.workingDirectories": ["../config"]
}
100 changes: 70 additions & 30 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,93 @@
# Getting Started with SmartApp
# mobx-nfs

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:
## Getting started

### `yarn start`
To make it easy for you to get started with GitLab, here's a list of recommended next steps.

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!

The page will reload if you make edits.\
You will also see any lint errors in the console.
## Add your files

### `yarn test`
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
```
cd existing_repo
git remote add origin https://gitlab.ccsteam.ru/ikudinov/mobx-nfs.git
git branch -M main
git push -uf origin main
```

### `yarn build`
## Integrate with your tools

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
- [ ] [Set up project integrations](https://gitlab.ccsteam.ru/ikudinov/mobx-nfs/-/settings/integrations)

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
## Collaborate with your team

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)

### `yarn storybook`
## Test and Deploy

Runs storybook build.\
Browser will automatically opens storybook page.\
The page will reload if you make edits.
Use the built-in continuous integration in GitLab.

### `yarn eject`
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)

***

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
# Editing this README

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
## Suggestions for a good README

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.

## Learn More
## Name
Choose a self-explaining name for your project.

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.

To learn React, check out the [React documentation](https://reactjs.org/).
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.

## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.

## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.

## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.

## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.

## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.

## Contributing
State if you are open to contributions and what your requirements are for accepting them.

For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.

You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.

## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.

## License
For open source projects, say how it is licensed.

## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
56 changes: 56 additions & 0 deletions frontend/app/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React, { FC } from 'react'
import styled from 'styled-components'

const ButtonStyled = styled.button`
margin-top: 10px;
padding: 5px 20px;
height: 40px;
font-size: 14px;
font-weight: 700;
text-align: center;
color: #fff;
line-height: 32px;
text-transform: uppercase;
background: #4799e3;
border: none;
border-radius: 3px;
&:hover {
opacity: 0.8;
cursor: pointer;
}
&:active {
outline: none;
opacity: 0.5;
}
&:disabled {
opacity: 0.5;
background: var(--grey);
cursor: not-allowed;
}
`
const Icon = styled.span.attrs({ className: 'material-icons' })`
position: relative;
bottom: -3px;
font-size: 18px;
padding-right: 8px;
margin-left: -10px;
`

type Props = {
onClick?: () => void
id?: string
icon?: string
title: string
disabled?: boolean
}

const Button: FC<Props> = props => {
return (
<ButtonStyled onClick={props.onClick} type="button" id={props.id} disabled={props.disabled}>
{props.icon && <Icon>{props.icon}</Icon>}
{props.title}
</ButtonStyled>
)
}

export default Button
Loading

0 comments on commit fe692ab

Please sign in to comment.