feeds-fun 1.22.5 → 1.22.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feeds-fun",
3
- "version": "1.22.5",
3
+ "version": "1.22.7",
4
4
  "author": "Aliaksei Yaletski (Tiendil) <a.eletsky@gmail.com> (https://tiendil.org/)",
5
5
  "description": "Frontend for the Feeds Fun — web-based news reader",
6
6
  "keywords": [
@@ -24,6 +24,7 @@
24
24
  v-for="tag of rule.tags"
25
25
  :key="tag"
26
26
  :uid="tag"
27
+ :excluded="rule.excludedTags.includes(tag)"
27
28
  :css-modifier="cssModifiers[tag]" />
28
29
  </div>
29
30
  </div>
@@ -80,11 +81,11 @@
80
81
 
81
82
  const cssModifiers: {[key: string]: string} = {};
82
83
 
84
+ const modifier = properties.rule.score > 0 ? "positive" : "negative";
85
+
86
+ console.log("score", properties.rule.score, "modifier", modifier);
87
+
83
88
  for (const tag of properties.rule.tags) {
84
- if (properties.rule.excludedTags.includes(tag)) {
85
- cssModifiers[tag] = "negative";
86
- continue;
87
- }
88
- cssModifiers[tag] = "positive";
89
+ cssModifiers[tag] = modifier;
89
90
  }
90
91
  </script>
@@ -73,6 +73,14 @@
73
73
  Privacy Policy
74
74
  </a>
75
75
 
76
+ <a
77
+ v-if="settings.crmImpressum"
78
+ :href="router.resolve({name: 'impressum'}).href"
79
+ class="ffun-normal-link"
80
+ @click.prevent="router.push({name: 'impressum'})">
81
+ Impressum
82
+ </a>
83
+
76
84
  <a
77
85
  v-if="!globalState.isSingleUserMode"
78
86
  href="#"
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <strong v-if="excluded">not </strong>
2
3
  <span>
3
4
  {{ tagInfo.name }}
4
5
 
@@ -26,5 +27,6 @@
26
27
 
27
28
  const properties = defineProps<{
28
29
  tagInfo: t.TagInfo;
30
+ excluded?: boolean;
29
31
  }>();
30
32
  </script>
@@ -2,7 +2,9 @@
2
2
  <div
3
3
  :class="classes"
4
4
  @click.prevent="onClick()">
5
- <tag-base :tag-info="tagInfo" />
5
+ <tag-base
6
+ :tag-info="tagInfo"
7
+ :excluded="excluded" />
6
8
  </div>
7
9
  </template>
8
10
 
@@ -26,6 +28,7 @@
26
28
  const properties = defineProps<{
27
29
  uid: string;
28
30
  cssModifier: string;
31
+ excluded: boolean;
29
32
  }>();
30
33
 
31
34
  const tagInfo = computed(() => {
@@ -4,7 +4,7 @@ export const version = __APP_VERSION__;
4
4
 
5
5
  export const authRefreshInterval = import.meta.env.VITE_FFUN_AUTH_REFRESH_INTERVAL || 10 * 60 * 1000;
6
6
 
7
- export const blog = import.meta.env.VITE_FFUN_BLOG || "https://blog.feeds.fun";
7
+ export const blog = import.meta.env.VITE_FFUN_BLOG || "https://feeds.fun/blog";
8
8
  export const roadmap = import.meta.env.VITE_FFUN_ROADMAP || "https://github.com/users/Tiendil/projects/1";
9
9
  export const githubRepo = import.meta.env.VITE_FFUN_GITHUB_REPO || "https://github.com/Tiendil/feeds.fun";
10
10
  export const discordInvite = import.meta.env.VITE_FFUN_DISCORD_INVITE || "https://discord.gg/C5RVusHQXy";
@@ -20,6 +20,7 @@ export const utmLifetime = import.meta.env.VITE_FFUN_UTM_LIFETIME || 7; // days
20
20
 
21
21
  export const crmTerms = import.meta.env.VITE_FFUN_CRM_TERMS || null;
22
22
  export const crmPrivacy = import.meta.env.VITE_FFUN_CRM_PRIVACY || null;
23
+ export const crmImpressum = import.meta.env.VITE_FFUN_CRM_IMPRESSUM || null;
23
24
 
24
25
  export const hasCollections = import.meta.env.VITE_FFUN_HAS_COLLECTIONS == "true" || false;
25
26
 
@@ -137,7 +137,7 @@ export function chooseTagByUsage({
137
137
  exclude = [];
138
138
  }
139
139
 
140
- const tags = _.toPairs(tagsCount).sort((a, b) => {
140
+ const tags = _.toPairs(tagsCount).sort((a: [string, number], b: [string, number]) => {
141
141
  if (a[1] === b[1]) {
142
142
  return a[0].localeCompare(b[0]);
143
143
  }
@@ -69,6 +69,12 @@ const router = createRouter({
69
69
  component: CRMView,
70
70
  props: {content: settings.crmPrivacy, kind: "privacy"}
71
71
  },
72
+ {
73
+ path: "/impressum",
74
+ name: "impressum",
75
+ component: CRMView,
76
+ props: {content: settings.crmImpressum, kind: "impressum"}
77
+ },
72
78
  {
73
79
  path: "/:pathMatch(.*)*",
74
80
  redirect: "/"
@@ -139,19 +139,22 @@ export const useGlobalSettingsStore = defineStore("globalSettings", () => {
139
139
  );
140
140
  }
141
141
 
142
- function enumBackendSettings(kind: string, enumProperties: any) {
143
- const defaultEntry = _.find([...enumProperties], ([, prop]) => prop.default);
142
+ function enumBackendSettings<TValue extends t.UserSettingsValue, TProperty extends {default?: boolean}>(
143
+ kind: string,
144
+ enumProperties: Map<TValue, TProperty>
145
+ ) {
146
+ const defaultEntry = _.find([...enumProperties], ([, prop]: [TValue, TProperty]) => prop.default === true);
144
147
 
145
148
  if (!defaultEntry) {
146
149
  throw new Error(`No default entry found for enum "${kind}"`);
147
150
  }
148
151
 
149
- let defaultValue = defaultEntry[0];
152
+ let defaultValue: TValue = defaultEntry[0];
150
153
 
151
154
  return backendSettings(
152
155
  kind,
153
156
  (rawValue: t.UserSettingsValue) => {
154
- return enumProperties.has(rawValue);
157
+ return enumProperties.has(rawValue as TValue);
155
158
  },
156
159
  defaultValue
157
160
  );
package/vitest.config.ts CHANGED
@@ -8,6 +8,7 @@ export default mergeConfig(
8
8
  defineConfig({
9
9
  test: {
10
10
  environment: 'jsdom',
11
+ dir: 'src',
11
12
  exclude: [...configDefaults.exclude, 'e2e/*'],
12
13
  root: fileURLToPath(new URL('./', import.meta.url))
13
14
  }