aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-03 09:04:30 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-03 05:51:51 +0000
commita9c1abc6f11cb193388fad505c0304f1efe60a30 (patch)
treedfb685527f9dc44b6245213a0c3e437ecb272132 /src
parentChanged the cron for the ferdi build to run at 12:15 am UTC since the time de... (diff)
downloadferdium-app-a9c1abc6f11cb193388fad505c0304f1efe60a30.tar.gz
ferdium-app-a9c1abc6f11cb193388fad505c0304f1efe60a30.tar.zst
ferdium-app-a9c1abc6f11cb193388fad505c0304f1efe60a30.zip
Removed straggling code related to 'popular services'.
Diffstat (limited to 'src')
-rw-r--r--src/api/server/ServerApi.js3
-rw-r--r--src/components/settings/recipes/RecipesDashboard.js4
-rw-r--r--src/containers/auth/WelcomeScreen.js2
-rw-r--r--src/containers/settings/RecipesScreen.js10
-rw-r--r--src/internal-server/app/Controllers/Http/StaticController.js168
-rw-r--r--src/internal-server/start/routes.js1
-rw-r--r--src/stores/RecipePreviewsStore.js6
7 files changed, 5 insertions, 189 deletions
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js
index bc1d665b1..c60d64197 100644
--- a/src/api/server/ServerApi.js
+++ b/src/api/server/ServerApi.js
@@ -357,12 +357,11 @@ export default class ServerApi {
357 } 357 }
358 358
359 async getFeaturedRecipePreviews() { 359 async getFeaturedRecipePreviews() {
360 // TODO: If we are hitting the internal-server, we need to return an empty list, else we can hit the remote server and get the data
360 const request = await sendAuthRequest(`${apiBase()}/recipes/popular`); 361 const request = await sendAuthRequest(`${apiBase()}/recipes/popular`);
361 if (!request.ok) throw request; 362 if (!request.ok) throw request;
362 363
363 const data = await request.json(); 364 const data = await request.json();
364 // data = this._addLocalRecipesToPreviews(data);
365
366 const recipePreviews = this._mapRecipePreviewModel(data); 365 const recipePreviews = this._mapRecipePreviewModel(data);
367 debug('ServerApi::getFeaturedRecipes resolves', recipePreviews); 366 debug('ServerApi::getFeaturedRecipes resolves', recipePreviews);
368 return recipePreviews; 367 return recipePreviews;
diff --git a/src/components/settings/recipes/RecipesDashboard.js b/src/components/settings/recipes/RecipesDashboard.js
index 2f625aada..4d0a0daf1 100644
--- a/src/components/settings/recipes/RecipesDashboard.js
+++ b/src/components/settings/recipes/RecipesDashboard.js
@@ -103,7 +103,6 @@ export default @injectSheet(styles) @observer class RecipesDashboard extends Com
103 recipes: MobxPropTypes.arrayOrObservableArray.isRequired, 103 recipes: MobxPropTypes.arrayOrObservableArray.isRequired,
104 customWebsiteRecipe: PropTypes.instanceOf(RecipePreview).isRequired, 104 customWebsiteRecipe: PropTypes.instanceOf(RecipePreview).isRequired,
105 isLoading: PropTypes.bool.isRequired, 105 isLoading: PropTypes.bool.isRequired,
106 hasLoadedRecipes: PropTypes.bool.isRequired,
107 showAddServiceInterface: PropTypes.func.isRequired, 106 showAddServiceInterface: PropTypes.func.isRequired,
108 searchRecipes: PropTypes.func.isRequired, 107 searchRecipes: PropTypes.func.isRequired,
109 resetSearch: PropTypes.func.isRequired, 108 resetSearch: PropTypes.func.isRequired,
@@ -130,7 +129,6 @@ export default @injectSheet(styles) @observer class RecipesDashboard extends Com
130 recipes, 129 recipes,
131 customWebsiteRecipe, 130 customWebsiteRecipe,
132 isLoading, 131 isLoading,
133 hasLoadedRecipes,
134 showAddServiceInterface, 132 showAddServiceInterface,
135 searchRecipes, 133 searchRecipes,
136 resetSearch, 134 resetSearch,
@@ -235,7 +233,7 @@ export default @injectSheet(styles) @observer class RecipesDashboard extends Com
235 <H3>{intl.formatMessage(messages.headlineCommunityRecipes)}</H3> 233 <H3>{intl.formatMessage(messages.headlineCommunityRecipes)}</H3>
236 )} 234 )}
237 <div className="recipes__list"> 235 <div className="recipes__list">
238 {hasLoadedRecipes && recipes.length === 0 && recipeFilter !== 'dev' && ( 236 {recipes.length === 0 && recipeFilter !== 'dev' && (
239 <div className="align-middle settings__empty-state"> 237 <div className="align-middle settings__empty-state">
240 <span className="emoji"> 238 <span className="emoji">
241 <img src="./assets/images/emoji/dontknow.png" alt="" /> 239 <img src="./assets/images/emoji/dontknow.png" alt="" />
diff --git a/src/containers/auth/WelcomeScreen.js b/src/containers/auth/WelcomeScreen.js
index 6f2d0eee6..bfcc880d0 100644
--- a/src/containers/auth/WelcomeScreen.js
+++ b/src/containers/auth/WelcomeScreen.js
@@ -15,7 +15,7 @@ export default @inject('stores', 'actions') @observer class LoginScreen extends
15 loginRoute={user.loginRoute} 15 loginRoute={user.loginRoute}
16 signupRoute={user.signupRoute} 16 signupRoute={user.signupRoute}
17 changeServerRoute={user.changeServerRoute} 17 changeServerRoute={user.changeServerRoute}
18 recipes={recipePreviews.featured} 18 recipes={recipePreviews.all}
19 /> 19 />
20 ); 20 );
21 } 21 }
diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js
index dc1534ed7..93503fb0e 100644
--- a/src/containers/settings/RecipesScreen.js
+++ b/src/containers/settings/RecipesScreen.js
@@ -55,8 +55,6 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
55 55
56 if (filter === 'all' && currentFilter !== 'all') { 56 if (filter === 'all' && currentFilter !== 'all') {
57 this.setState({ currentFilter: 'all' }); 57 this.setState({ currentFilter: 'all' });
58 } else if (filter === 'featured' && currentFilter !== 'featured') {
59 this.setState({ currentFilter: 'featured' });
60 } else if (filter === 'dev' && currentFilter !== 'dev') { 58 } else if (filter === 'dev' && currentFilter !== 'dev') {
61 this.setState({ currentFilter: 'dev' }); 59 this.setState({ currentFilter: 'dev' });
62 } 60 }
@@ -114,7 +112,7 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
114 service: serviceActions, 112 service: serviceActions,
115 } = this.props.actions; 113 } = this.props.actions;
116 114
117 const { filter } = this.props.params; 115 const { filter } = { filter: 'all', ...this.props.params };
118 let recipeFilter; 116 let recipeFilter;
119 117
120 if (filter === 'all') { 118 if (filter === 'all') {
@@ -124,8 +122,6 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
124 ]); 122 ]);
125 } else if (filter === 'dev') { 123 } else if (filter === 'dev') {
126 recipeFilter = communityRecipesStore.communityRecipes; 124 recipeFilter = communityRecipesStore.communityRecipes;
127 } else {
128 recipeFilter = recipePreviews.featured;
129 } 125 }
130 126
131 const allRecipes = this.state.needle ? this.prepareRecipes([ 127 const allRecipes = this.state.needle ? this.prepareRecipes([
@@ -140,8 +136,7 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
140 136
141 const customWebsiteRecipe = recipePreviews.all.find((service) => service.id === CUSTOM_WEBSITE_RECIPE_ID); 137 const customWebsiteRecipe = recipePreviews.all.find((service) => service.id === CUSTOM_WEBSITE_RECIPE_ID);
142 138
143 const isLoading = recipePreviews.featuredRecipePreviewsRequest.isExecuting 139 const isLoading = recipePreviews.allRecipePreviewsRequest.isExecuting
144 || recipePreviews.allRecipePreviewsRequest.isExecuting
145 || recipes.installRecipeRequest.isExecuting 140 || recipes.installRecipeRequest.isExecuting
146 || recipePreviews.searchRecipePreviewsRequest.isExecuting; 141 || recipePreviews.searchRecipePreviewsRequest.isExecuting;
147 142
@@ -154,7 +149,6 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
154 customWebsiteRecipe={customWebsiteRecipe} 149 customWebsiteRecipe={customWebsiteRecipe}
155 isLoading={isLoading} 150 isLoading={isLoading}
156 addedServiceCount={services.all.length} 151 addedServiceCount={services.all.length}
157 hasLoadedRecipes={recipePreviews.featuredRecipePreviewsRequest.wasExecuted}
158 showAddServiceInterface={serviceActions.showAddServiceInterface} 152 showAddServiceInterface={serviceActions.showAddServiceInterface}
159 searchRecipes={(e) => this.searchRecipes(e)} 153 searchRecipes={(e) => this.searchRecipes(e)}
160 resetSearch={() => this.resetSearch()} 154 resetSearch={() => this.resetSearch()}
diff --git a/src/internal-server/app/Controllers/Http/StaticController.js b/src/internal-server/app/Controllers/Http/StaticController.js
index 69dfee0a3..b9a145061 100644
--- a/src/internal-server/app/Controllers/Http/StaticController.js
+++ b/src/internal-server/app/Controllers/Http/StaticController.js
@@ -26,174 +26,6 @@ class StaticController {
26 return response.send([]); 26 return response.send([]);
27 } 27 }
28 28
29 // Return list of popular recipes (copy of the response Franz's API is returning)
30 popularRecipes({
31 response,
32 }) {
33 return response.send([{
34 // TODO: Why is this list hardcoded?
35 author: 'Stefan Malzner <stefan@adlk.io>',
36 featured: false,
37 id: 'slack',
38 name: 'Slack',
39 version: '1.0.4',
40 icons: {
41 png: 'https://cdn.franzinfra.com/recipes/dist/slack/src/icon.png',
42 svg: 'https://cdn.franzinfra.com/recipes/dist/slack/src/icon.svg',
43 },
44 }, {
45 author: 'Stefan Malzner <stefan@adlk.io>',
46 featured: false,
47 id: 'whatsapp',
48 name: 'WhatsApp',
49 version: '1.0.1',
50 icons: {
51 png: 'https://cdn.franzinfra.com/recipes/dist/whatsapp/src/icon.png',
52 svg: 'https://cdn.franzinfra.com/recipes/dist/whatsapp/src/icon.svg',
53 },
54 }, {
55 author: 'Stefan Malzner <stefan@adlk.io>',
56 featured: false,
57 id: 'messenger',
58 name: 'Messenger',
59 version: '1.0.6',
60 icons: {
61 png: 'https://cdn.franzinfra.com/recipes/dist/messenger/src/icon.png',
62 svg: 'https://cdn.franzinfra.com/recipes/dist/messenger/src/icon.svg',
63 },
64 }, {
65 author: 'Stefan Malzner <stefan@adlk.io>',
66 featured: false,
67 id: 'telegram',
68 name: 'Telegram',
69 version: '1.0.0',
70 icons: {
71 png: 'https://cdn.franzinfra.com/recipes/dist/telegram/src/icon.png',
72 svg: 'https://cdn.franzinfra.com/recipes/dist/telegram/src/icon.svg',
73 },
74 }, {
75 author: 'Stefan Malzner <stefan@adlk.io>',
76 featured: false,
77 id: 'gmail',
78 name: 'Gmail',
79 version: '1.0.0',
80 icons: {
81 png: 'https://cdn.franzinfra.com/recipes/dist/gmail/src/icon.png',
82 svg: 'https://cdn.franzinfra.com/recipes/dist/gmail/src/icon.svg',
83 },
84 }, {
85 author: 'Stefan Malzner <stefan@adlk.io>',
86 featured: false,
87 id: 'skype',
88 name: 'Skype',
89 version: '1.0.0',
90 icons: {
91 png: 'https://cdn.franzinfra.com/recipes/dist/skype/src/icon.png',
92 svg: 'https://cdn.franzinfra.com/recipes/dist/skype/src/icon.svg',
93 },
94 }, {
95 author: 'Stefan Malzner <stefan@adlk.io>',
96 featured: false,
97 id: 'hangouts',
98 name: 'Hangouts',
99 version: '1.0.0',
100 icons: {
101 png: 'https://cdn.franzinfra.com/recipes/dist/hangouts/src/icon.png',
102 svg: 'https://cdn.franzinfra.com/recipes/dist/hangouts/src/icon.svg',
103 },
104 }, {
105 author: 'Stefan Malzner <stefan@adlk.io>',
106 featured: false,
107 id: 'discord',
108 name: 'Discord',
109 version: '1.0.0',
110 icons: {
111 png: 'https://cdn.franzinfra.com/recipes/dist/discord/src/icon.png',
112 svg: 'https://cdn.franzinfra.com/recipes/dist/discord/src/icon.svg',
113 },
114 }, {
115 author: 'Stefan Malzner <stefan@adlk.io>',
116 featured: false,
117 id: 'tweetdeck',
118 name: 'Tweetdeck',
119 version: '1.0.1',
120 icons: {
121 png: 'https://cdn.franzinfra.com/recipes/dist/tweetdeck/src/icon.png',
122 svg: 'https://cdn.franzinfra.com/recipes/dist/tweetdeck/src/icon.svg',
123 },
124 }, {
125 author: 'Stefan Malzner <stefan@adlk.io>',
126 featured: false,
127 id: 'hipchat',
128 name: 'HipChat',
129 version: '1.0.1',
130 icons: {
131 png: 'https://cdn.franzinfra.com/recipes/dist/hipchat/src/icon.png',
132 svg: 'https://cdn.franzinfra.com/recipes/dist/hipchat/src/icon.svg',
133 },
134 }, {
135 author: 'Stefan Malzner <stefan@adlk.io>',
136 featured: false,
137 id: 'gmailinbox',
138 name: 'Inbox by Gmail',
139 version: '1.0.0',
140 icons: {
141 png: 'https://cdn.franzinfra.com/recipes/dist/gmailinbox/src/icon.png',
142 svg: 'https://cdn.franzinfra.com/recipes/dist/gmailinbox/src/icon.svg',
143 },
144 }, {
145 author: 'Stefan Malzner <stefan@adlk.io>',
146 featured: false,
147 id: 'rocketchat',
148 name: 'Rocket.Chat',
149 version: '1.0.1',
150 icons: {
151 png: 'https://cdn.franzinfra.com/recipes/dist/rocketchat/src/icon.png',
152 svg: 'https://cdn.franzinfra.com/recipes/dist/rocketchat/src/icon.svg',
153 },
154 }, {
155 author: 'Brian Gilbert <brian@briangilbert.net>',
156 featured: false,
157 id: 'gitter',
158 name: 'Gitter',
159 version: '1.0.0',
160 icons: {
161 png: 'https://cdn.franzinfra.com/recipes/dist/gitter/src/icon.png',
162 svg: 'https://cdn.franzinfra.com/recipes/dist/gitter/src/icon.svg',
163 },
164 }, {
165 author: 'Stefan Malzner <stefan@adlk.io>',
166 featured: false,
167 id: 'mattermost',
168 name: 'Mattermost',
169 version: '1.0.0',
170 icons: {
171 png: 'https://cdn.franzinfra.com/recipes/dist/mattermost/src/icon.png',
172 svg: 'https://cdn.franzinfra.com/recipes/dist/mattermost/src/icon.svg',
173 },
174 }, {
175 author: 'Franz <recipe@meetfranz.com>',
176 featured: false,
177 id: 'toggl',
178 name: 'toggl',
179 version: '1.0.0',
180 icons: {
181 png: 'https://cdn.franzinfra.com/recipes/dist/toggl/src/icon.png',
182 svg: 'https://cdn.franzinfra.com/recipes/dist/toggl/src/icon.svg',
183 },
184 }, {
185 author: 'Stuart Clark <stuart@realityloop.com>',
186 featured: false,
187 id: 'twist',
188 name: 'twist',
189 version: '1.0.0',
190 icons: {
191 png: 'https://cdn.franzinfra.com/recipes/dist/twist/src/icon.png',
192 svg: 'https://cdn.franzinfra.com/recipes/dist/twist/src/icon.svg',
193 },
194 }]);
195 }
196
197 // Show announcements 29 // Show announcements
198 announcement({ 30 announcement({
199 response, 31 response,
diff --git a/src/internal-server/start/routes.js b/src/internal-server/start/routes.js
index 63ac42c47..6668f3062 100644
--- a/src/internal-server/start/routes.js
+++ b/src/internal-server/start/routes.js
@@ -54,7 +54,6 @@ Route.group(() => {
54 Route.get('recipes', 'RecipeController.list'); 54 Route.get('recipes', 'RecipeController.list');
55 Route.get('recipes/download/:recipe', 'RecipeController.download'); 55 Route.get('recipes/download/:recipe', 'RecipeController.download');
56 Route.get('recipes/search', 'RecipeController.search'); 56 Route.get('recipes/search', 'RecipeController.search');
57 Route.get('recipes/popular', 'StaticController.popularRecipes');
58 Route.get('recipes/update', 'StaticController.emptyArray'); 57 Route.get('recipes/update', 'StaticController.emptyArray');
59 58
60 // Workspaces 59 // Workspaces
diff --git a/src/stores/RecipePreviewsStore.js b/src/stores/RecipePreviewsStore.js
index 10c170e81..f4e39306c 100644
--- a/src/stores/RecipePreviewsStore.js
+++ b/src/stores/RecipePreviewsStore.js
@@ -7,8 +7,6 @@ import Request from './lib/Request';
7export default class RecipePreviewsStore extends Store { 7export default class RecipePreviewsStore extends Store {
8 @observable allRecipePreviewsRequest = new CachedRequest(this.api.recipePreviews, 'all'); 8 @observable allRecipePreviewsRequest = new CachedRequest(this.api.recipePreviews, 'all');
9 9
10 @observable featuredRecipePreviewsRequest = new CachedRequest(this.api.recipePreviews, 'featured');
11
12 @observable searchRecipePreviewsRequest = new Request(this.api.recipePreviews, 'search'); 10 @observable searchRecipePreviewsRequest = new Request(this.api.recipePreviews, 'search');
13 11
14 constructor(...args) { 12 constructor(...args) {
@@ -22,10 +20,6 @@ export default class RecipePreviewsStore extends Store {
22 return this.allRecipePreviewsRequest.execute().result || []; 20 return this.allRecipePreviewsRequest.execute().result || [];
23 } 21 }
24 22
25 @computed get featured() {
26 return this.featuredRecipePreviewsRequest.execute().result || [];
27 }
28
29 @computed get searchResults() { 23 @computed get searchResults() {
30 return this.searchRecipePreviewsRequest.result || []; 24 return this.searchRecipePreviewsRequest.result || [];
31 } 25 }