diff --git a/.gitignore b/.gitignore
index de893d0f1..753389d1a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,46 +1,45 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-node_modules
-.pnp
-.pnp.js
-.pnpm-store
-package-lock.json
-
-# testing
-/coverage
-
-# next.js
-/.next
-/out
-
-# production
-/build
-/public/script.js
-/geo
-/dist
-/generated
-/src/generated
-pm2.yml
-
-# misc
-.DS_Store
-.idea
-.yarn
-*.iml
-*.log
-.vscode
-.tool-versions
-
-# debug
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-
-# local env files
-.env
-.env.*
-*.env.*
-
-*.dev.yml
-
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+node_modules
+.pnp
+.pnp.js
+.pnpm-store
+package-lock.json
+
+# testing
+/coverage
+
+# next.js
+/.next
+/out
+
+# production
+/build
+/public/script.js
+/geo
+/dist
+/generated
+/src/generated
+
+# misc
+.DS_Store
+.idea
+.yarn
+*.iml
+*.log
+.vscode
+.tool-versions
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env
+.env.*
+*.env.*
+
+*.dev.yml
+
diff --git a/next.config.ts b/next.config.ts
index 1a4e2e0ec..99dcca0d8 100644
--- a/next.config.ts
+++ b/next.config.ts
@@ -8,7 +8,6 @@ const cloudMode = process.env.CLOUD_MODE || '';
const cloudUrl = process.env.CLOUD_URL || '';
const collectApiEndpoint = process.env.COLLECT_API_ENDPOINT || '';
const corsMaxAge = process.env.CORS_MAX_AGE || '';
-const defaultCurrency = process.env.DEFAULT_CURRENCY || '';
const defaultLocale = process.env.DEFAULT_LOCALE || '';
const forceSSL = process.env.FORCE_SSL || '';
const frameAncestors = process.env.ALLOWED_FRAME_URLS || '';
@@ -171,7 +170,6 @@ export default {
cloudMode,
cloudUrl,
currentVersion: pkg.version,
- defaultCurrency,
defaultLocale,
},
basePath,
diff --git a/public/intl/messages/zh-CN.json b/public/intl/messages/zh-CN.json
index a4ad51fa5..b3d2f3c00 100644
--- a/public/intl/messages/zh-CN.json
+++ b/public/intl/messages/zh-CN.json
@@ -5,18 +5,6 @@
"value": "访问代码"
}
],
- "label.account": [
- {
- "type": 0,
- "value": "账户"
- }
- ],
- "label.action": [
- {
- "type": 0,
- "value": "行为"
- }
- ],
"label.actions": [
{
"type": 0,
@@ -47,24 +35,12 @@
"value": "添加描述"
}
],
- "label.add-link": [
- {
- "type": 0,
- "value": "添加链接"
- }
- ],
"label.add-member": [
{
"type": 0,
"value": "添加成员"
}
],
- "label.add-pixel": [
- {
- "type": 0,
- "value": "添加像素"
- }
- ],
"label.add-step": [
{
"type": 0,
@@ -107,24 +83,12 @@
"value": "所有时间段"
}
],
- "label.analysis": [
- {
- "type": 0,
- "value": "分析"
- }
- ],
"label.analytics": [
{
"type": 0,
"value": "分析"
}
],
- "label.application": [
- {
- "type": 0,
- "value": "应用"
- }
- ],
"label.apply": [
{
"type": 0,
@@ -143,12 +107,6 @@
"value": "查看用户如何与您的营销互动,以及是什么促成了转化。"
}
],
- "label.audience": [
- {
- "type": 0,
- "value": "受众"
- }
- ],
"label.average": [
{
"type": 0,
@@ -167,12 +125,6 @@
"value": "之前"
}
],
- "label.behavior": [
- {
- "type": 0,
- "value": "行为"
- }
- ],
"label.boards": [
{
"type": 0,
@@ -221,24 +173,12 @@
"value": "修改密码"
}
],
- "label.channel": [
- {
- "type": 0,
- "value": "渠道"
- }
- ],
"label.channels": [
{
"type": 0,
"value": "渠道"
}
],
- "label.chart": [
- {
- "type": 0,
- "value": "图表"
- }
- ],
"label.cities": [
{
"type": 0,
@@ -263,12 +203,6 @@
"value": "队列"
}
],
- "label.cohorts": [
- {
- "type": 0,
- "value": "队列"
- }
- ],
"label.compare": [
{
"type": 0,
@@ -383,12 +317,6 @@
"value": "创建者"
}
],
- "label.criteria": [
- {
- "type": 0,
- "value": "条件"
- }
- ],
"label.currency": [
{
"type": 0,
@@ -491,12 +419,6 @@
"value": "台式机"
}
],
- "label.destination-url": [
- {
- "type": 0,
- "value": "目标URL"
- }
- ],
"label.details": [
{
"type": 0,
@@ -533,12 +455,6 @@
"value": "唯一ID"
}
],
- "label.documentation": [
- {
- "type": 0,
- "value": "文档"
- }
- ],
"label.does-not-contain": [
{
"type": 0,
@@ -563,12 +479,6 @@
"value": "域名"
}
],
- "label.download": [
- {
- "type": 0,
- "value": "下载"
- }
- ],
"label.dropoff": [
{
"type": 0,
@@ -596,7 +506,7 @@
"label.email": [
{
"type": 0,
- "value": "邮箱"
+ "value": "Email"
}
],
"label.enable-share-url": [
@@ -617,12 +527,6 @@
"value": "入口 URL"
}
],
- "label.environment": [
- {
- "type": 0,
- "value": "环境"
- }
- ],
"label.event": [
{
"type": 0,
@@ -767,12 +671,6 @@
"value": "分组"
}
],
- "label.growth": [
- {
- "type": 0,
- "value": "增长"
- }
- ],
"label.hostname": [
{
"type": 0,
@@ -803,12 +701,6 @@
"value": "通过使用筛选器和划分时间段来更深入地研究数据。"
}
],
- "label.invalid-url": [
- {
- "type": 0,
- "value": "无效URL"
- }
- ],
"label.is": [
{
"type": 0,
@@ -971,24 +863,12 @@
"value": "少于等于"
}
],
- "label.link": [
- {
- "type": 0,
- "value": "链接"
- }
- ],
"label.links": [
{
"type": 0,
"value": "链接"
}
],
- "label.location": [
- {
- "type": 0,
- "value": "位置"
- }
- ],
"label.login": [
{
"type": 0,
@@ -1140,7 +1020,7 @@
"label.online": [
{
"type": 0,
- "value": "在线"
+ "value": "Online"
}
],
"label.organic-search": [
@@ -1285,12 +1165,6 @@
"value": "路径"
}
],
- "label.pixel": [
- {
- "type": 0,
- "value": "像素"
- }
- ],
"label.pixels": [
{
"type": 0,
@@ -1311,12 +1185,6 @@
"value": " 提供支持"
}
],
- "label.preferences": [
- {
- "type": 0,
- "value": "偏好"
- }
- ],
"label.previous": [
{
"type": 0,
@@ -1341,12 +1209,6 @@
"value": "个人资料"
}
],
- "label.profiles": [
- {
- "type": 0,
- "value": "个人资料"
- }
- ],
"label.properties": [
{
"type": 0,
@@ -1386,7 +1248,7 @@
"label.referral": [
{
"type": 0,
- "value": "来源"
+ "value": "Referral"
}
],
"label.referrer": [
@@ -1509,24 +1371,6 @@
"value": "保存"
}
],
- "label.save-cohort": [
- {
- "type": 0,
- "value": "保存为群组"
- }
- ],
- "label.save-segment": [
- {
- "type": 0,
- "value": "保存为细分"
- }
- ],
- "label.screen": [
- {
- "type": 0,
- "value": "屏幕"
- }
- ],
"label.screens": [
{
"type": 0,
@@ -1539,18 +1383,6 @@
"value": "搜索"
}
],
- "label.segment": [
- {
- "type": 0,
- "value": "细分"
- }
- ],
- "label.segments": [
- {
- "type": 0,
- "value": "细分"
- }
- ],
"label.select": [
{
"type": 0,
@@ -1653,24 +1485,6 @@
"value": "总和"
}
],
- "label.support": [
- {
- "type": 0,
- "value": "支持"
- }
- ],
- "label.switch-account": [
- {
- "type": 0,
- "value": "切换账户"
- }
- ],
- "label.table": [
- {
- "type": 0,
- "value": "表格"
- }
- ],
"label.tablet": [
{
"type": 0,
@@ -1821,12 +1635,6 @@
"value": "跟踪代码"
}
],
- "label.traffic": [
- {
- "type": 0,
- "value": "流量"
- }
- ],
"label.transactions": [
{
"type": 0,
@@ -2038,7 +1846,7 @@
"message.bad-request": [
{
"type": 0,
- "value": "请求错误"
+ "value": "Bad request"
}
],
"message.collected-data": [
@@ -2138,7 +1946,7 @@
"message.forbidden": [
{
"type": 0,
- "value": "禁止访问"
+ "value": "Forbidden"
}
],
"message.go-to-settings": [
@@ -2238,13 +2046,13 @@
"message.not-found": [
{
"type": 0,
- "value": "未找到"
+ "value": "Not found"
}
],
"message.nothing-selected": [
{
"type": 0,
- "value": "未选择"
+ "value": "Nothing selected."
}
],
"message.page-not-found": [
@@ -2282,7 +2090,7 @@
"message.sever-error": [
{
"type": 0,
- "value": "服务器错误"
+ "value": "Server error"
}
],
"message.share-url": [
@@ -2350,7 +2158,7 @@
"message.unauthorized": [
{
"type": 0,
- "value": "未授权"
+ "value": "Unauthorized"
}
],
"message.user-deleted": [
diff --git a/public/iso-3166-2.json b/public/iso-3166-2.json
index 2b3b5a802..347313d72 100644
--- a/public/iso-3166-2.json
+++ b/public/iso-3166-2.json
@@ -6,13 +6,13 @@
"AD-06": "Sant Julia de Loria",
"AD-07": "Andorra la Vella",
"AD-08": "Escaldes-Engordany",
- "AE-AJ": "Ajman",
- "AE-AZ": "Abu Dhabi",
- "AE-DU": "Dubai",
- "AE-FU": "Al Fujairah",
- "AE-RK": "Ras al Khaimah",
- "AE-SH": "Sharjah",
- "AE-UQ": "Umm al Quwain",
+ "AE-AJ": "'Ajman",
+ "AE-AZ": "Abu Zaby",
+ "AE-DU": "Dubayy",
+ "AE-FU": "Al Fujayrah",
+ "AE-RK": "Ra's al Khaymah",
+ "AE-SH": "Ash Shariqah",
+ "AE-UQ": "Umm al Qaywayn",
"AF-BAL": "Balkh",
"AF-BAM": "Bamyan",
"AF-BDG": "Badghis",
diff --git a/src/app/(main)/links/LinkEditForm.tsx b/src/app/(main)/links/LinkEditForm.tsx
index e9ad18f4f..6c10c7f0a 100644
--- a/src/app/(main)/links/LinkEditForm.tsx
+++ b/src/app/(main)/links/LinkEditForm.tsx
@@ -4,14 +4,13 @@ import {
Form,
FormField,
FormSubmitButton,
- Grid,
Icon,
Label,
Loading,
Row,
TextField,
} from '@umami/react-zen';
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
import { useConfig, useLinkQuery, useMessages } from '@/components/hooks';
import { useUpdateQuery } from '@/components/hooks/queries/useUpdateQuery';
import { RefreshCw } from '@/components/icons';
@@ -43,7 +42,7 @@ export function LinkEditForm({
const { linksUrl } = useConfig();
const hostUrl = linksUrl || LINKS_URL;
const { data, isLoading } = useLinkQuery(linkId);
- const [defaultSlug] = useState(generateId());
+ const [slug, setSlug] = useState(generateId());
const handleSubmit = async (data: any) => {
await mutateAsync(data, {
@@ -56,6 +55,14 @@ export function LinkEditForm({
});
};
+ const handleSlug = () => {
+ const slug = generateId();
+
+ setSlug(slug);
+
+ return slug;
+ };
+
const checkUrl = (url: string) => {
if (!isValidUrl(url)) {
return formatMessage(labels.invalidUrl);
@@ -63,19 +70,19 @@ export function LinkEditForm({
return true;
};
+ useEffect(() => {
+ if (data) {
+ setSlug(data.slug);
+ }
+ }, [data]);
+
if (linkId && isLoading) {
return