diff --git a/sapl-frontend/.browserslistrc b/sapl-frontend/.browserslistrc new file mode 100644 index 000000000..9dee64646 --- /dev/null +++ b/sapl-frontend/.browserslistrc @@ -0,0 +1,3 @@ +> 1% +last 2 versions +not ie <= 8 diff --git a/sapl-frontend/.eslintrc.js b/sapl-frontend/.eslintrc.js new file mode 100644 index 000000000..5cc3e5896 --- /dev/null +++ b/sapl-frontend/.eslintrc.js @@ -0,0 +1,31 @@ +module.exports = { + root: true, + env: { + browser: true, + node: true, + jquery: true + }, + extends: [ + 'plugin:vue/essential', + 'standard' + ], + rules: { + 'generator-star-spacing': 'off', + //'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + camelcase: 0 + }, + // required to lint *.vue files + plugins: [ + 'vue' + ], + parserOptions: { + parser: 'babel-eslint' + }, + + globals: { + $: true, + jQuery: true, + _: true + } +} diff --git a/sapl-frontend/.gitignore b/sapl-frontend/.gitignore new file mode 100644 index 000000000..f172d31e9 --- /dev/null +++ b/sapl-frontend/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules +/dist +webpack-stats.json +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + + +# Editor directories and files +theme-dev +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw* diff --git a/sapl-frontend/Dockerfile.dev b/sapl-frontend/Dockerfile.dev new file mode 100644 index 000000000..f072807ba --- /dev/null +++ b/sapl-frontend/Dockerfile.dev @@ -0,0 +1,6 @@ +FROM node:lts-alpine +RUN apk add --no-cache bash +WORKDIR /sapl-frontend-dev +COPY package*.json ./ +RUN npm install +EXPOSE 8080 diff --git a/sapl-frontend/README.md b/sapl-frontend/README.md new file mode 100644 index 000000000..6cd515874 --- /dev/null +++ b/sapl-frontend/README.md @@ -0,0 +1,29 @@ +# sapl-frontend + +## Project setup +``` +yarn install +``` + +### Compiles and hot-reloads for development +``` +yarn run serve +``` + +### Compiles and minifies for production +``` +yarn run build +``` + +### Run your tests +``` +yarn run test +``` + +### Lints and fixes files +``` +yarn run lint +``` + +### Customize configuration +See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/sapl-frontend/babel.config.js b/sapl-frontend/babel.config.js new file mode 100644 index 000000000..df151586e --- /dev/null +++ b/sapl-frontend/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ['@vue/app'] +} diff --git a/sapl-frontend/docker-compose-dev.yml b/sapl-frontend/docker-compose-dev.yml new file mode 100644 index 000000000..690f4acf1 --- /dev/null +++ b/sapl-frontend/docker-compose-dev.yml @@ -0,0 +1,24 @@ +version: '3.5' + +services: + sapl-frontend-dev: + container_name: sapl-frontend-dev + restart: always + image: sapl:dev + build: + context: . + dockerfile: Dockerfile.dev + volumes: + - .:/sapl-frontend-dev + - /sapl-frontend-dev/node_modules + ports: + - "8080:8080" + networks: + - sapl-net-dev + command: sh -c """yarn install && + yarn run serve""" + +networks: + sapl-net-dev: + name: sapl-net-dev + driver: bridge \ No newline at end of file diff --git a/sapl-frontend/package.json b/sapl-frontend/package.json new file mode 100644 index 000000000..fa77a321e --- /dev/null +++ b/sapl-frontend/package.json @@ -0,0 +1,57 @@ +{ + "name": "sapl-frontend", + "version": "0.1.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint" + }, + "dependencies": { + "@fortawesome/fontawesome-free": "^5.13.0", + "axios": "^0.19.2", + "axios-progress-bar": "^1.2.0", + "bootstrap": "^4.4.1", + "bootstrap-vue": "^2.12.0", + "diff": "^4.0.1", + "dotenv": "^6.2.0", + "exports-loader": "^0.7.0", + "imports-loader": "^0.8.0", + "jquery": "^3.5.1", + "jquery-mask-plugin": "^1.14.16", + "jquery-ui-themes": "^1.12.0", + "lodash": "^4.17.15", + "moment": "^2.24.0", + "moment-locales-webpack-plugin": "^1.1.2", + "popper.js": "^1.16.1", + "serialize-javascript": "^2.1.2", + "terser": "^4.6.11", + "tinymce": "^4.9.9", + "tinymce-light-skin": "^1.3.1", + "vue": "^2.6.11", + "webpack": "^4.43.0", + "webpack-jquery-ui": "^2.0.1", + "websocket-extensions": "^0.1.4" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "^4.3.1", + "@vue/cli-plugin-eslint": "^4.3.1", + "@vue/cli-service": "^4.3.1", + "babel-eslint": "^10.1.0", + "compression-webpack-plugin": "^3.1.0", + "css-loader": "^3.5.2", + "eslint": "^6.8.0", + "eslint-config-standard": "^14.1.1", + "eslint-friendly-formatter": "^4.0.1", + "eslint-loader": "^4.0.0", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", + "eslint-plugin-vue": "^6.2.2", + "node-sass": "^4.13.1", + "sass-loader": "^8.0.2", + "vue-template-compiler": "^2.6.11", + "webpack-bundle-tracker": "^0.4.3" + } +} diff --git a/sapl-frontend/postcss.config.js b/sapl-frontend/postcss.config.js new file mode 100644 index 000000000..961986e2b --- /dev/null +++ b/sapl-frontend/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + autoprefixer: {} + } +} diff --git a/sapl-frontend/public/audio/ring.mp3 b/sapl-frontend/public/audio/ring.mp3 new file mode 100644 index 000000000..97d8fc2d3 Binary files /dev/null and b/sapl-frontend/public/audio/ring.mp3 differ diff --git a/sapl-frontend/public/img/arrow.png b/sapl-frontend/public/img/arrow.png new file mode 100644 index 000000000..1f1a6e5a1 Binary files /dev/null and b/sapl-frontend/public/img/arrow.png differ diff --git a/sapl-frontend/public/img/authenticated.png b/sapl-frontend/public/img/authenticated.png new file mode 100644 index 000000000..872718490 Binary files /dev/null and b/sapl-frontend/public/img/authenticated.png differ diff --git a/sapl-frontend/public/img/avatar.png b/sapl-frontend/public/img/avatar.png new file mode 100644 index 000000000..959c168a5 Binary files /dev/null and b/sapl-frontend/public/img/avatar.png differ diff --git a/sapl-frontend/public/img/beta.png b/sapl-frontend/public/img/beta.png new file mode 100644 index 000000000..fe23d0e6d Binary files /dev/null and b/sapl-frontend/public/img/beta.png differ diff --git a/sapl-frontend/public/img/brasao_transp.gif b/sapl-frontend/public/img/brasao_transp.gif new file mode 100644 index 000000000..2d9ac82c6 Binary files /dev/null and b/sapl-frontend/public/img/brasao_transp.gif differ diff --git a/sapl-frontend/public/img/down_arrow_select.jpg b/sapl-frontend/public/img/down_arrow_select.jpg new file mode 100644 index 000000000..a3a75352d Binary files /dev/null and b/sapl-frontend/public/img/down_arrow_select.jpg differ diff --git a/sapl-frontend/public/img/etiqueta.png b/sapl-frontend/public/img/etiqueta.png new file mode 100644 index 000000000..28db5a89e Binary files /dev/null and b/sapl-frontend/public/img/etiqueta.png differ diff --git a/sapl-frontend/public/img/favicon.ico b/sapl-frontend/public/img/favicon.ico new file mode 100644 index 000000000..b81629808 Binary files /dev/null and b/sapl-frontend/public/img/favicon.ico differ diff --git a/sapl-frontend/public/img/file.png b/sapl-frontend/public/img/file.png new file mode 100644 index 000000000..9bcae6c88 Binary files /dev/null and b/sapl-frontend/public/img/file.png differ diff --git a/sapl-frontend/public/img/hand-note.png b/sapl-frontend/public/img/hand-note.png new file mode 100644 index 000000000..43c757bf1 Binary files /dev/null and b/sapl-frontend/public/img/hand-note.png differ diff --git a/sapl-frontend/public/img/icon_comissoes.png b/sapl-frontend/public/img/icon_comissoes.png new file mode 100644 index 000000000..8ec70e7e1 Binary files /dev/null and b/sapl-frontend/public/img/icon_comissoes.png differ diff --git a/sapl-frontend/public/img/icon_delete_white.png b/sapl-frontend/public/img/icon_delete_white.png new file mode 100644 index 000000000..f06892bff Binary files /dev/null and b/sapl-frontend/public/img/icon_delete_white.png differ diff --git a/sapl-frontend/public/img/icon_materia_legislativa.png b/sapl-frontend/public/img/icon_materia_legislativa.png new file mode 100644 index 000000000..18cdd81f9 Binary files /dev/null and b/sapl-frontend/public/img/icon_materia_legislativa.png differ diff --git a/sapl-frontend/public/img/icon_mesa_diretora.png b/sapl-frontend/public/img/icon_mesa_diretora.png new file mode 100644 index 000000000..12a1b9f13 Binary files /dev/null and b/sapl-frontend/public/img/icon_mesa_diretora.png differ diff --git a/sapl-frontend/public/img/icon_normas_juridicas.png b/sapl-frontend/public/img/icon_normas_juridicas.png new file mode 100644 index 000000000..147681ef8 Binary files /dev/null and b/sapl-frontend/public/img/icon_normas_juridicas.png differ diff --git a/sapl-frontend/public/img/icon_parlamentares.png b/sapl-frontend/public/img/icon_parlamentares.png new file mode 100644 index 000000000..fe9f91ac7 Binary files /dev/null and b/sapl-frontend/public/img/icon_parlamentares.png differ diff --git a/sapl-frontend/public/img/icon_pautas.png b/sapl-frontend/public/img/icon_pautas.png new file mode 100644 index 000000000..8d554f4e4 Binary files /dev/null and b/sapl-frontend/public/img/icon_pautas.png differ diff --git a/sapl-frontend/public/img/icon_plenarias.png b/sapl-frontend/public/img/icon_plenarias.png new file mode 100644 index 000000000..b5fdaa97d Binary files /dev/null and b/sapl-frontend/public/img/icon_plenarias.png differ diff --git a/sapl-frontend/public/img/icon_relatorios.png b/sapl-frontend/public/img/icon_relatorios.png new file mode 100644 index 000000000..3bd71c94d Binary files /dev/null and b/sapl-frontend/public/img/icon_relatorios.png differ diff --git a/sapl-frontend/public/img/icon_save_white.png b/sapl-frontend/public/img/icon_save_white.png new file mode 100644 index 000000000..8f9ccbbf1 Binary files /dev/null and b/sapl-frontend/public/img/icon_save_white.png differ diff --git a/sapl-frontend/public/img/lexml.gif b/sapl-frontend/public/img/lexml.gif new file mode 100644 index 000000000..193f9cb55 Binary files /dev/null and b/sapl-frontend/public/img/lexml.gif differ diff --git a/sapl-frontend/public/img/logo.png b/sapl-frontend/public/img/logo.png new file mode 100644 index 000000000..cc8619f2f Binary files /dev/null and b/sapl-frontend/public/img/logo.png differ diff --git a/sapl-frontend/public/img/logo_cc.png b/sapl-frontend/public/img/logo_cc.png new file mode 100644 index 000000000..7301d05b1 Binary files /dev/null and b/sapl-frontend/public/img/logo_cc.png differ diff --git a/sapl-frontend/public/img/logo_interlegis.png b/sapl-frontend/public/img/logo_interlegis.png new file mode 100644 index 000000000..19591933c Binary files /dev/null and b/sapl-frontend/public/img/logo_interlegis.png differ diff --git a/sapl-frontend/public/img/manual.png b/sapl-frontend/public/img/manual.png new file mode 100644 index 000000000..27a2d87c1 Binary files /dev/null and b/sapl-frontend/public/img/manual.png differ diff --git a/sapl-frontend/public/img/pdflogo.png b/sapl-frontend/public/img/pdflogo.png new file mode 100644 index 000000000..ae28bf428 Binary files /dev/null and b/sapl-frontend/public/img/pdflogo.png differ diff --git a/sapl-frontend/public/img/perfil.png b/sapl-frontend/public/img/perfil.png new file mode 100644 index 000000000..d1c4b77ed Binary files /dev/null and b/sapl-frontend/public/img/perfil.png differ diff --git a/sapl-frontend/public/img/search-gray.png b/sapl-frontend/public/img/search-gray.png new file mode 100644 index 000000000..1f1c1c6c9 Binary files /dev/null and b/sapl-frontend/public/img/search-gray.png differ diff --git a/sapl-frontend/public/img/search.png b/sapl-frontend/public/img/search.png new file mode 100644 index 000000000..442814ed8 Binary files /dev/null and b/sapl-frontend/public/img/search.png differ diff --git a/sapl-frontend/public/img/user.png b/sapl-frontend/public/img/user.png new file mode 100644 index 000000000..e8811bcb4 Binary files /dev/null and b/sapl-frontend/public/img/user.png differ diff --git a/sapl-frontend/run-yarn.sh b/sapl-frontend/run-yarn.sh new file mode 100755 index 000000000..b6e6b9e85 --- /dev/null +++ b/sapl-frontend/run-yarn.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +verifica_git() { + if [[ ! -d ".git" ]]; then + echo -e "\033[31mERRO\033[0m Diretório atual não é um repositório git!" + exit 1 + fi +} + +verifica_diretorio() { + DIR=$(pwd | rev | cut -d'/' -f1 | rev) + + if [[ "$DIR" != "$1" ]]; then + echo -e "\033[31mERRO\033[0m Diretório atual não é o \033[1m$1\033[0m!" + exit 1 + fi + + verifica_git +} + +retorna_branch() { + # shellcheck disable=SC2155 + local branch=$(git branch | grep '^*' | cut -d ' ' -f2) + if [[ -z "$branch" ]]; then + echo -e "\033[31mERRO\033[0m Não foi possivel configurar a variável \033[1m$1\033[0m!" + exit 1 + else + echo "$branch" + fi +} + +if [[ ! (( "$1" == "build" ) || ( "$1" == "serve" )) ]]; then + echo -e "\033[31mERRO\033[0m Parâmetro inválido!" + echo -e " Coloque \033[1mbuild\033[0m ou \033[1mserve\033[0m." + exit 1 +fi + +verifica_diretorio "sapl-frontend" + +BRANCH_FRONTEND="$(retorna_branch "BRANCH_FRONTEND")" + +# shellcheck disable=SC2164 +cd ../sapl > /dev/null 2>&1 +if [[ ! $? -eq 0 ]]; then + echo "\033[31mERRO\033[0m Os diretórios \033[1msapl\033[0m e \033[1msapl-frontend\033[0m devem ter o mesmo diretório raiz." + exit 1 +fi + +verifica_diretorio "sapl" + +BRANCH_BACKEND="$(retorna_branch "BRANCH_BACKEND")" + +cd ../sapl-frontend > /dev/null 2>&1 + +if [[ "$BRANCH_FRONTEND" == "$BRANCH_BACKEND" ]]; then + echo -e "\033[33mEXECUTANDO\033[0m \033[1myarn run $1\033[1m." + yarn run "$1" + echo -e "\033[32mSUCESSO\033[0m $1 realizado com sucesso." +else + echo -e "\033[31mERRO\033[0m $1 não realizada porque as branchs dos dois repositórios são diferentes." + echo -e " Branch do Frontend: \033[1m$BRANCH_FRONTEND\033[0m" + echo -e " Branch do Backend: \033[1m$BRANCH_BACKEND\033[0m" + echo -e " Para que a operação seja feita, coloque os dois repositórios na mesma branch." +fi diff --git a/sapl-frontend/src/__apps/compilacao/js/old/compilacao.js b/sapl-frontend/src/__apps/compilacao/js/old/compilacao.js new file mode 100644 index 000000000..f7176c473 --- /dev/null +++ b/sapl-frontend/src/__apps/compilacao/js/old/compilacao.js @@ -0,0 +1,331 @@ +const _$ = window.$ + +function SetCookie (cookieName, cookieValue, nDays) { + const today = new Date() + const expire = new Date() + if (nDays === null || nDays === 0) nDays = 1 + expire.setTime(today.getTime() + 3600000 * 24 * nDays) + document.cookie = cookieName + '=' + escape(cookieValue) + + ';expires=' + expire.toGMTString() +} + +function ReadCookie (cookieName) { + const theCookie = ' ' + document.cookie + let ind = theCookie.indexOf(' ' + cookieName + '=') + if (ind === -1) ind = theCookie.indexOf(';' + cookieName + '=') + if (ind === -1 || cookieName === '') return '' + let ind1 = theCookie.indexOf(';', ind + 1) + if (ind1 === -1) ind1 = theCookie.length + return unescape(theCookie.substring(ind + cookieName.length + 2, ind1)) +} + +function insertWaitAjax (element) { + // jQuery(element).append('
') + _$(element).append('