diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml
index 242e30f0..3be47ad0 100644
--- a/.github/workflows/test-and-build.yml
+++ b/.github/workflows/test-and-build.yml
@@ -6,23 +6,33 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
+
- name: Setup Node 18
uses: actions/setup-node@v2
with:
node-version: '18'
+
+ - name: Install system dependencies for canvas
+ run: sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
+
- name: Install dependencies
run: |
- npm install -g yarn
- yarn install
+ npm install -g yarn
+ yarn install
+
- name: Run build translations
run: yarn translations:build
+
- name: Run lint
run: yarn lint
+
- name: Run tests and coverage
run: yarn test:coverage
+
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
+
- name: Build application
- run: yarn build
+ run: yarn build
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 15da1e61..dd05e640 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -17,6 +17,14 @@ ENV VITE_HOTJAR_ID $VITE_HOTJAR_ID
RUN apk --no-cache add git
+RUN apk add --no-cache \
+ build-base \
+ cairo-dev \
+ pango-dev \
+ jpeg-dev \
+ giflib-dev \
+ librsvg-dev
+
COPY package.json yarn.lock ./
RUN --mount=type=cache,target=/root/.yarn \
diff --git a/package.json b/package.json
index 0aaa88df..8c78da3c 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,7 @@
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/test-utils": "^2.4.6",
"@weni/eslint-config": "^1.0.3",
- "canvas": "^2.11.2",
+ "canvas": "^2.10.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.0",
@@ -56,4 +56,4 @@
"resolutions": {
"strip-ansi": "6.0.1"
}
-}
+}
\ No newline at end of file
diff --git a/src/components/insights/Layout/Header.vue b/src/components/insights/Layout/Header.vue
index b2ccf3bf..4d446a7a 100644
--- a/src/components/insights/Layout/Header.vue
+++ b/src/components/insights/Layout/Header.vue
@@ -74,7 +74,7 @@ export default {
crumbs[1] = {
path: this.$route.path,
routePath: 'report',
- name: `Relatório ${currentDashboard.name}`,
+ name: `${this.$t('report')} ${currentDashboard.name}`,
};
}
diff --git a/src/components/insights/Layout/HeaderFilters/index.vue b/src/components/insights/Layout/HeaderFilters/index.vue
index 6777a637..7e1c5549 100644
--- a/src/components/insights/Layout/HeaderFilters/index.vue
+++ b/src/components/insights/Layout/HeaderFilters/index.vue
@@ -11,7 +11,7 @@
v-if="appliedFiltersLength > 0"
type="tertiary"
iconLeft="close"
- text="Limpar"
+ :text="$t('insights_header.clear_filters')"
@click.stop="clearFilters"
/>
diff --git a/src/components/insights/PromptsHistory/index.vue b/src/components/insights/PromptsHistory/index.vue
index 68f243e9..b9de2077 100644
--- a/src/components/insights/PromptsHistory/index.vue
+++ b/src/components/insights/PromptsHistory/index.vue
@@ -9,7 +9,7 @@
class="prompts-history__conversation"
>
({
- name: 'html-transform',
- apply: 'build',
- closeBundle() {
- const indexPath = path.resolve(__dirname, 'dist', 'index.html');
-
- const hash = createHash('md5')
- .update(Date.now().toString())
- .digest('hex')
- .substring(0, 8);
-
- let html = fs.readFileSync(indexPath, 'utf-8');
-
- // Added the query string ?v=[hash] for CSS and JS only
- html = html.replace(/(\/assets\/insights\.(js|css))/g, `$1?v=${hash}`);
-
- fs.writeFileSync(indexPath, html);
- },
-});
-
// https://vitejs.dev/config/
export default defineConfig({
- plugins: [vue(), vueJsx(), htmlTransform()],
+ plugins: [vue(), vueJsx()],
css: {
preprocessorOptions: {
scss: {
@@ -44,18 +21,4 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
- build: {
- rollupOptions: {
- output: {
- entryFileNames: 'assets/insights.js',
- chunkFileNames: 'assets/insights.js',
- assetFileNames: (assetInfo) => {
- if (assetInfo.name.endsWith('.css')) {
- return 'assets/insights.css';
- }
- return 'assets/' + assetInfo.name;
- },
- },
- },
- },
});
diff --git a/yarn.lock b/yarn.lock
index 3e3c8ba7..b7ad3231 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1735,7 +1735,7 @@ caniuse-lite@^1.0.30001646:
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz#52de59529e8b02b1aedcaaf5c05d9e23c0c28138"
integrity sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==
-canvas@^2.11.2:
+canvas@^2.10.0:
version "2.11.2"
resolved "https://registry.yarnpkg.com/canvas/-/canvas-2.11.2.tgz#553d87b1e0228c7ac0fc72887c3adbac4abbd860"
integrity sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==