Skip to content

Commit

Permalink
Release/v0.1.5 (#396)
Browse files Browse the repository at this point in the history
* Fix redirect unix socket vulnerability

* Force https only on production mode

* Upgrade jointJs

* Remove transitive imports

* Upgrade database dependencies

* Upgrade express

* Bump terser from 5.10.0 to 5.14.2

Bumps [terser](https://github.com/terser/terser) from 5.10.0 to 5.14.2.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update yarn packages

* Update issue templates

- Change issue template
- Translate it's contents to pt-br

* Update issue templates

- Fix typo
- Add separators

* Improve login security

* Improve register security

* Improve reset password security

* Hide user from recovery request

* Short reuse refac

* feat(config): Update Dockerfile and docker-compose

* Bump loader-utils from 2.0.2 to 2.0.3

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.3/CHANGELOG.md)
- [Commits](webpack/loader-utils@v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump minimatch from 3.0.4 to 3.1.2

Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](isaacs/minimatch@v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump loader-utils from 2.0.3 to 2.0.4

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.3 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](webpack/loader-utils@v2.0.3...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump qs from 6.5.2 to 6.5.3

Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](ljharb/qs@v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Create delete account rounte

* WIP: Add Preferences page

* Preferences page

- Enable translations,
- Add missing array when exporting app.preferences

* User preferences page markup

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Idmar Ramos Jr. (Id) <idmarjr@gmail.com>
Co-authored-by: João Paulo M Fiumari <joaopaulo_mf@outlook.com>
  • Loading branch information
4 people authored Jan 16, 2023
1 parent 84a8c04 commit 539e0e2
Show file tree
Hide file tree
Showing 30 changed files with 2,868 additions and 2,317 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
API_URL=http://localhost:3000
PORT=3000
MONGODB_LOCAL_URL="mongodb://localhost:27017/brmodeloDB"
MONGODB_LOCAL_URL="mongodb://mongo:27017/brmodeloDB"
SECRET_TOKEN=talkischeapshowmethecode
30 changes: 0 additions & 30 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/eu-preciso-de-ajuda-com---.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Eu preciso de ajuda com...
about: Para qualquer pergunta que você tenha
title: ''
labels: Question
assignees: ''

---

> Antes de fazer sua pergunta, por favor explore a documentação do BRModelo Web:
> https://docs.brmodeloweb.com
>
> Se mesmo assim você não encontrou a resposta que precisa, adicione sua pergunta a seguir:
---

### Pergunta
Adicione aqui sua pergunta
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/i-need-help-with---.md

This file was deleted.

39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/reportar-problema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Reportar Problema
about: Reportar bugs no BRMW
title: ''
labels: Bug
assignees: ''

---

### Link da modelagem
Adicione aqui o link da modelagem na qual você estava trabalhando quando encontrou o problema.

---

### Descreva o problema
Adicione aqui uma breve descrição do problema.

---

### Passos para reproduzir
1. Na tela de...
1. Selecione a opção...
1. Clique em...

---

### Screenshots e/ou video
Adicione aqui imagens ou videos que possam nos ajudar a entender o problema

---

### Sistema operacional e navegador
- Adicione aqui seu sistema operacional (Windows, MacOS, Linux distro, etc...)
- Adicione aqui seu navegador (Firefox, Chrome, Edge, etc) e a versão do mesmo

---

### Informações extras
Aqui você pode adicionar qualquer informação extra que ache relevante pra nos ajudar a entender o problema.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/requisitar-funcionalidade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Requisitar funcionalidade
about: Ideias e sugestões de como melhorar o BRMW
title: ''
labels: Feature request
assignees: ''

---

### Sua sugestão de melhoria é relacionada a algum problema?

Adicione aqui a descrição do problema
_Ex: É muito complicado fazer..._

---

### Descreva sua ideia de como resolver o problema
Adicione aqui como você acha que deveríamos resolver esse problema.
Fique a vontade para adicionar imagens, videos, desenhos ou qualquer material que te ajude a explicar sua proposta de solução

---

### Informações extras
Aqui você pode adicionar qualquer informação extra que ache relevante pra nos ajudar a entender o problema.
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM node:16
FROM node:16-alpine
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
ENV APP_PATH /usr/src/app
COPY package.json $APP_PATH
WORKDIR $APP_PATH
RUN yarn install
COPY . /usr/src/app
EXPOSE 9000
CMD [ "yarn", "start:frontend", "yarn" , "start:dev" ]
COPY . $APP_PATH
# expose port 3000 for server and 9000 for webpack-dev-server
EXPOSE 3000 9000
# run start:frontend and start:dev in parallel
CMD ["yarn", "start:frontend", "start:dev"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ To run this application you'll need:
1. Start server: `yarn start:dev`
1. Access it: [http://localhost:9000/](http://localhost:9000/)

## Running with Docker
## Running with docker-compose

> **Note:** Docker setup is still a work in progress and does not offer a good developer experience. For now we recommend you to run the project locally following the instructions listed above. If you still want to use docker, here's how:
1. Make sure you have [Docker Desktop](https://www.docker.com/get-started) running
1. Start docker: `docker-compose up`
1. Start docker: `docker-compose up` or `docker-compose up -d`
1. Access it: [http://localhost:9000/](http://localhost:9000/)
1. Once your done, finish docker: `docker-compose down`

Expand Down
18 changes: 17 additions & 1 deletion app/angular/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,21 @@ app.config([
},
});

$stateProvider.state("preferences", {
title: "Preferences - BRMW",
url: "/preferences",
component: "preferences",
data: {
requireLogin: true,
},
lazyLoad($transition$) {
const $ocLazyLoad = $transition$.injector().get("$ocLazyLoad");
return import("./preferences/preferences.js").then((mod) =>
$ocLazyLoad.inject(mod.default)
);
},
});

$urlRouterProvider.otherwise("/");
},
]);
Expand All @@ -211,4 +226,5 @@ app.config(function () {
};
});

app.$inject = ["$scope", "$http", "$cookies", "$uibModalInstance"];
app.$inject = ["$scope", "$http", "$cookies", "$uibModalInstance"];

53 changes: 53 additions & 0 deletions app/angular/preferences/preferences.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<section class="view preferences">

<header class="navbar navbar-default navbar-fixed-top">
<div class="container">
<a class="back-button" href="#" data-ui-sref="main">
<i class="fa fa-arrow-left" aria-hidden="true"></i>
</a>
<div class="navbar-header pull-left">
<strong class="navbar-brand">{{ 'BR Modelo Web' | translate }}</strong>
</div><!-- End .navbar-header -->
<div class="nav navbar-nav pull-right nav-icons">
<dropdown-icon title="Options" options="$ctrl.dropdownOptions" on-select=$ctrl.menuOptionSelected(selected)></dropdown-icon>
</div><!-- End .navbar-header -->
</div>
</header>


<section class="mainContent">
<header class="container">
<div class="page-header clearfix">
<h2 class="h2 pull-left">{{ 'Preferences' | translate }}</h2>
</div><!-- End .page-header -->
</header><!-- End .container -->

<div class="container userPreferences">
<img
src="../../img/loading-dots.gif"
alt="Loading"
class="br-loader"
ng-class="{'loading': $ctrl.loading}"
/>

<div class="alert alert-danger" role="alert" data-ng-class="{'hide': !$ctrl.feedback.showing}">
<p>{{ $ctrl.feedback.message }}</p>
</div>

<!-- User information -->
<form class="form-horizontal" role="form" name="userPreferencesForm">

<section class="form-section deleteAccount">
<header>
<h3>{{ 'Delete account' | translate }}</h3>
</header>
<p>{{ 'Remove all your models before removing your account.' | translate }}<br/> <strong>{{ 'Keep in mind this is a destructive action and cannot be undone.' | translate}}</strong></p>
<button type="button" class="br-button destructive" ng-click="$ctrl.deleteAccount()">{{ 'Delete account' | translate }}</button>
</section>

</form>
</div><!-- End .container.projectsList -->

<bug-report-button></bug-report-button>
</section><!-- End .mainContent -->
</section><!-- End .view -->
85 changes: 85 additions & 0 deletions app/angular/preferences/preferences.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import angular from "angular";
import template from "./preferences.html";
import confirmationModal from "../components/confirmationModal";

const preferencesController = function(AuthService, $state, $filter, $uibModal, $timeout){
const ctrl = this;
ctrl.loading = false;
ctrl.feedback = {
message: "",
showing: false
}

ctrl.showFeedback = (show, newMessage) => {
$timeout(() => {
ctrl.feedback.showing = show;
ctrl.feedback.message = $filter('translate')(newMessage);
});
}

const showLoading = (loading) => {
ctrl.loading = loading;
};

const handleDeleteAccountError = (error) => {
if(error.status == 400) {
const errorMessage = $filter('translate')("Delete account model error");
ctrl.showFeedback(true, errorMessage);
} else {
const errorMessage = $filter('translate')("Delete account default error");
ctrl.showFeedback(true, errorMessage);
}
}

ctrl.dropdownOptions = [
{ name: $filter('translate')("Preferences"), type: 'preferences' },
{ name: $filter('translate')("Logout"), type: 'logout' }
];

ctrl.deleteAccount = () => {
const modalInstance = $uibModal.open({
animation: true,
component: "confirmationModal",
resolve: {
modalData: () => ({
title: $filter('translate')("Delete account"),
content: $filter('translate')("Are you sure you want to delete your account?"),
cancelLabel: $filter('translate')("Cancel"),
confirmLabel: $filter('translate')("Delete"),
}),
},
});

modalInstance.result.then(() => {
showLoading(true);
AuthService.deleteAccount().then(() => {
AuthService.logout();
$state.go("login");
}).catch(handleDeleteAccountError)
.finally(() => {
showLoading(false);
});
});
}

ctrl.menuOptionSelected = (option) => {
switch(option.type) {
case "logout": ctrl.doLogout()
break;
case "preferences": $state.go("preferences");
break;
}
}

ctrl.doLogout = () => {
AuthService.logout();
$state.go("login");
}
}

export default angular
.module("app.preferences", [confirmationModal])
.component("preferences", {
template,
controller: preferencesController,
}).name;
Loading

0 comments on commit 539e0e2

Please sign in to comment.