Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Frontend
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
384
Merge Requests
62
CI / CD
Security & Compliance
Packages
Analytics
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
5f026303
Commit
5f026303
authored
2 hours ago
by
Emiliano Balbuena
Browse files
Options
Download
(wip): Get request URL
parent
f82801a4
fix/ssr-email-confirmation
1 merge request
!761
WIP: Fix email confirmation on SSR
Pipeline
#114984559
failed with stages
in 6 minutes and 33 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
15 deletions
+33
-15
src/app/common/common.module.ts
View file @
5f026303
import
{
NgModule
,
inject
}
from
'
@angular/core
'
;
import
{
NgModule
,
Optional
}
from
'
@angular/core
'
;
import
{
CommonModule
as
NgCommonModule
,
isPlatformServer
,
...
...
@@ -144,6 +144,7 @@ import { MediaProxyService } from './services/media-proxy.service';
import
{
HorizontalFeedService
}
from
'
./services/horizontal-feed.service
'
;
import
{
FormInputCheckboxComponent
}
from
'
./components/forms/checkbox/checkbox.component
'
;
import
{
AttachmentPasteDirective
}
from
'
./directives/paste/attachment-paste.directive
'
;
import
{
RequestUrlService
}
from
'
./services/request-url.service
'
;
const
routes
:
Routes
=
[
{
...
...
@@ -432,8 +433,9 @@ const routes: Routes = [
},
{
provide
:
ConfigsService
,
useFactory
:
client
=>
new
ConfigsService
(
client
),
deps
:
[
Client
],
useFactory
:
(
client
,
requestUrl
)
=>
new
ConfigsService
(
client
,
requestUrl
),
deps
:
[
Client
,
RequestUrlService
],
},
{
provide
:
MetaService
,
...
...
@@ -460,6 +462,7 @@ const routes: Routes = [
useFactory
:
SidebarMarkersService
.
_
,
},
HorizontalFeedService
,
RequestUrlService
,
],
entryComponents
:
[
NotificationsToasterComponent
,
...
...
This diff is collapsed.
src/app/common/services/configs.service.ts
View file @
5f026303
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Client
}
from
'
../api/client.service
'
;
import
{
Inject
,
Injectable
,
Optional
,
PLATFORM_ID
}
from
'
@angular/core
'
;
import
{
isPlatformServer
}
from
'
@angular/common
'
;
import
{
RequestUrlService
}
from
'
./request-url.service
'
;
@
Injectable
()
export
class
ConfigsService
{
private
configs
=
{};
constructor
(
private
client
:
Client
,
@
Inject
(
'
REQUEST_URL
'
)
@
Optional
()
private
requestUrl
:
string
)
{}
constructor
(
private
client
:
Client
,
private
requestUrl
:
RequestUrlService
)
{}
async
loadFromRemote
()
{
const
url
=
isPlatformServer
(
PLATFORM_ID
)
?
this
.
requestUrl
:
window
.
location
;
console
.
log
({
isPlatformServer
:
isPlatformServer
(
PLATFORM_ID
),
url
});
console
.
log
(
this
.
requestUrl
.
get
());
try
{
this
.
configs
=
await
this
.
client
.
get
(
'
api/v1/minds/config
'
);
...
...
This diff is collapsed.
src/app/common/services/request-url.service.ts
0 → 100644
View file @
5f026303
import
{
Inject
,
Injectable
,
Optional
,
PLATFORM_ID
}
from
'
@angular/core
'
;
import
{
isPlatformServer
}
from
'
@angular/common
'
;
@
Injectable
()
export
class
RequestUrlService
{
constructor
(
@
Inject
(
'
REQUEST_URL
'
)
@
Optional
()
protected
requestUrl
:
string
)
{}
get
()
{
console
.
log
({
isPlatformServer
:
isPlatformServer
(
PLATFORM_ID
),
requestUrl
:
this
.
requestUrl
,
});
return
isPlatformServer
(
PLATFORM_ID
)
?
this
.
requestUrl
:
window
.
location
.
toString
();
}
}
This diff is collapsed.
src/app/services/providers.ts
View file @
5f026303
...
...
@@ -50,6 +50,7 @@ import { ConfigsService } from '../common/services/configs.service';
import
{
TransferHttpInterceptorService
}
from
'
./transfer-http-interceptor.service
'
;
import
{
CookieHttpInterceptorService
}
from
'
./api/cookie-http-interceptor.service
'
;
import
{
CookieService
}
from
'
../common/services/cookie.service
'
;
import
{
RequestUrlService
}
from
'
../common/services/request-url.service
'
;
export
const
MINDS_PROVIDERS
:
any
[]
=
[
SiteService
,
...
...
@@ -187,7 +188,7 @@ export const MINDS_PROVIDERS: any[] = [
{
provide
:
ConfigsService
,
useFactory
:
(
client
,
requestUrl
)
=>
new
ConfigsService
(
client
,
requestUrl
),
deps
:
[
Client
,
'
REQUEST_URL
'
],
deps
:
[
Client
,
RequestUrlService
],
},
{
provide
:
FeaturesService
,
...
...
@@ -235,4 +236,5 @@ export const MINDS_PROVIDERS: any[] = [
DiagnosticsService
,
AuthService
,
FormToastService
,
RequestUrlService
,
];
This diff is collapsed.
Please
register
or
sign in
to comment