Merge pull request #38 from HideyoshiNakazone/devel
Devel - Adds License to Project
This commit is contained in:
@@ -1,54 +1,41 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"ignorePatterns": [
|
"ignorePatterns": ["projects/**/*"],
|
||||||
"projects/**/*"
|
"overrides": [
|
||||||
],
|
{
|
||||||
"overrides": [
|
"files": ["*.ts"],
|
||||||
{
|
"parserOptions": {
|
||||||
"files": [
|
"project": ["tsconfig.json"],
|
||||||
"*.ts"
|
"createDefaultProgram": true
|
||||||
],
|
},
|
||||||
"parserOptions": {
|
"extends": [
|
||||||
"project": [
|
"plugin:@angular-eslint/recommended",
|
||||||
"tsconfig.json"
|
"plugin:@angular-eslint/template/process-inline-templates"
|
||||||
],
|
],
|
||||||
"createDefaultProgram": true
|
"rules": {
|
||||||
},
|
"indent": ["error", 4],
|
||||||
"extends": [
|
"@angular-eslint/directive-selector": [
|
||||||
"plugin:@angular-eslint/recommended",
|
"error",
|
||||||
"plugin:@angular-eslint/template/process-inline-templates"
|
{
|
||||||
],
|
"type": "attribute",
|
||||||
"rules": {
|
"prefix": "app",
|
||||||
"indent": [
|
"style": "camelCase"
|
||||||
"error",
|
}
|
||||||
4
|
],
|
||||||
],
|
"@angular-eslint/component-selector": [
|
||||||
"@angular-eslint/directive-selector": [
|
"error",
|
||||||
"error",
|
{
|
||||||
{
|
"type": "element",
|
||||||
"type": "attribute",
|
"prefix": "app",
|
||||||
"prefix": "app",
|
"style": "kebab-case"
|
||||||
"style": "camelCase"
|
}
|
||||||
}
|
]
|
||||||
],
|
}
|
||||||
"@angular-eslint/component-selector": [
|
},
|
||||||
"error",
|
{
|
||||||
{
|
"files": ["*.html"],
|
||||||
"type": "element",
|
"extends": ["plugin:@angular-eslint/template/recommended"],
|
||||||
"prefix": "app",
|
"rules": {}
|
||||||
"style": "kebab-case"
|
}
|
||||||
}
|
]
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"files": [
|
|
||||||
"*.html"
|
|
||||||
],
|
|
||||||
"extends": [
|
|
||||||
"plugin:@angular-eslint/template/recommended"
|
|
||||||
],
|
|
||||||
"rules": {}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
68
.github/workflows/docker-publish.yml
vendored
68
.github/workflows/docker-publish.yml
vendored
@@ -1,46 +1,42 @@
|
|||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'main'
|
- "main"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
build:
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [18.x]
|
||||||
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
cache: "npm"
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run build --if-present
|
||||||
|
|
||||||
strategy:
|
docker:
|
||||||
matrix:
|
needs: [build]
|
||||||
node-version: [18.x]
|
runs-on: ubuntu-latest
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Login to DockerHub
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
uses: docker/login-action@v1
|
||||||
uses: actions/setup-node@v3
|
with:
|
||||||
with:
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
node-version: ${{ matrix.node-version }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
cache: 'npm'
|
|
||||||
- run: npm install
|
|
||||||
- run: npm run build --if-present
|
|
||||||
|
|
||||||
docker:
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
needs: [build]
|
with:
|
||||||
runs-on: ubuntu-latest
|
push: true
|
||||||
|
tags: yoshiunfriendly/frontend-hideyoshi.com:latest
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
tags: yoshiunfriendly/frontend-hideyoshi.com:latest
|
|
||||||
|
|||||||
674
LICENSE
Normal file
674
LICENSE
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
17
angular.json
17
angular.json
@@ -18,9 +18,7 @@
|
|||||||
"main": "src/main.ts",
|
"main": "src/main.ts",
|
||||||
"polyfills": "src/polyfills.ts",
|
"polyfills": "src/polyfills.ts",
|
||||||
"tsConfig": "tsconfig.app.json",
|
"tsConfig": "tsconfig.app.json",
|
||||||
"allowedCommonJsDependencies": [
|
"allowedCommonJsDependencies": ["ts-interface-checker"],
|
||||||
"ts-interface-checker"
|
|
||||||
],
|
|
||||||
"assets": [
|
"assets": [
|
||||||
"src/assets",
|
"src/assets",
|
||||||
"src/manifest.webmanifest",
|
"src/manifest.webmanifest",
|
||||||
@@ -104,28 +102,21 @@
|
|||||||
"src/manifest.webmanifest",
|
"src/manifest.webmanifest",
|
||||||
"src/manifest.webmanifest"
|
"src/manifest.webmanifest"
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": ["src/styles.css"],
|
||||||
"src/styles.css"
|
|
||||||
],
|
|
||||||
"scripts": []
|
"scripts": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@angular-eslint/builder:lint",
|
"builder": "@angular-eslint/builder:lint",
|
||||||
"options": {
|
"options": {
|
||||||
"lintFilePatterns": [
|
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
|
||||||
"src/**/*.ts",
|
|
||||||
"src/**/*.html"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cli": {
|
"cli": {
|
||||||
"schematicCollections": [
|
"schematicCollections": ["@angular-eslint/schematics"],
|
||||||
"@angular-eslint/schematics"
|
|
||||||
],
|
|
||||||
"analytics": false
|
"analytics": false
|
||||||
},
|
},
|
||||||
"schematics": {
|
"schematics": {
|
||||||
|
|||||||
@@ -2,43 +2,43 @@
|
|||||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||||
|
|
||||||
module.exports = function (config) {
|
module.exports = function (config) {
|
||||||
config.set({
|
config.set({
|
||||||
basePath: '',
|
basePath: "",
|
||||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
frameworks: ["jasmine", "@angular-devkit/build-angular"],
|
||||||
plugins: [
|
plugins: [
|
||||||
require('karma-jasmine'),
|
require("karma-jasmine"),
|
||||||
require('karma-chrome-launcher'),
|
require("karma-chrome-launcher"),
|
||||||
require('karma-jasmine-html-reporter'),
|
require("karma-jasmine-html-reporter"),
|
||||||
require('karma-coverage'),
|
require("karma-coverage"),
|
||||||
require('@angular-devkit/build-angular/plugins/karma')
|
require("@angular-devkit/build-angular/plugins/karma"),
|
||||||
],
|
],
|
||||||
client: {
|
client: {
|
||||||
jasmine: {
|
jasmine: {
|
||||||
// you can add configuration options for Jasmine here
|
// you can add configuration options for Jasmine here
|
||||||
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
||||||
// for example, you can disable the random execution with `random: false`
|
// for example, you can disable the random execution with `random: false`
|
||||||
// or set a specific seed with `seed: 4321`
|
// or set a specific seed with `seed: 4321`
|
||||||
},
|
},
|
||||||
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
||||||
},
|
},
|
||||||
jasmineHtmlReporter: {
|
jasmineHtmlReporter: {
|
||||||
suppressAll: true // removes the duplicated traces
|
suppressAll: true, // removes the duplicated traces
|
||||||
},
|
},
|
||||||
coverageReporter: {
|
coverageReporter: {
|
||||||
dir: require('path').join(__dirname, './coverage/frontend-hideyoshi.com'),
|
dir: require("path").join(
|
||||||
subdir: '.',
|
__dirname,
|
||||||
reporters: [
|
"./coverage/frontend-hideyoshi.com",
|
||||||
{ type: 'html' },
|
),
|
||||||
{ type: 'text-summary' }
|
subdir: ".",
|
||||||
]
|
reporters: [{ type: "html" }, { type: "text-summary" }],
|
||||||
},
|
},
|
||||||
reporters: ['progress', 'kjhtml'],
|
reporters: ["progress", "kjhtml"],
|
||||||
port: 9876,
|
port: 9876,
|
||||||
colors: true,
|
colors: true,
|
||||||
logLevel: config.LOG_INFO,
|
logLevel: config.LOG_INFO,
|
||||||
autoWatch: true,
|
autoWatch: true,
|
||||||
browsers: ['Chrome'],
|
browsers: ["Chrome"],
|
||||||
singleRun: false,
|
singleRun: false,
|
||||||
restartOnFileChange: true
|
restartOnFileChange: true,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,30 +1,30 @@
|
|||||||
{
|
{
|
||||||
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
|
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
|
||||||
"index": "/index.html",
|
"index": "/index.html",
|
||||||
"assetGroups": [
|
"assetGroups": [
|
||||||
{
|
{
|
||||||
"name": "app",
|
"name": "app",
|
||||||
"installMode": "prefetch",
|
"installMode": "prefetch",
|
||||||
"resources": {
|
"resources": {
|
||||||
"files": [
|
"files": [
|
||||||
"/favicon.ico",
|
"/favicon.ico",
|
||||||
"/index.html",
|
"/index.html",
|
||||||
"/manifest.webmanifest",
|
"/manifest.webmanifest",
|
||||||
"/*.css",
|
"/*.css",
|
||||||
"/*.js"
|
"/*.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "assets",
|
"name": "assets",
|
||||||
"installMode": "lazy",
|
"installMode": "lazy",
|
||||||
"updateMode": "prefetch",
|
"updateMode": "prefetch",
|
||||||
"resources": {
|
"resources": {
|
||||||
"files": [
|
"files": [
|
||||||
"/assets/**",
|
"/assets/**",
|
||||||
"/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
|
"/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
31885
package-lock.json
generated
31885
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
138
package.json
138
package.json
@@ -1,70 +1,74 @@
|
|||||||
{
|
{
|
||||||
"name": "frontend-hideyoshi.com",
|
"name": "frontend-hideyoshi.com",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node ./server.js",
|
"start": "node ./server.js",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"serve": "ng serve",
|
"serve": "ng serve",
|
||||||
"serve:prod": "ng serve --configuration=production",
|
"serve:prod": "ng serve --configuration=production",
|
||||||
"build:prod": "ng build --configuration=production"
|
"build:prod": "ng build --configuration=production"
|
||||||
},
|
},
|
||||||
"proxy": {
|
"proxy": {
|
||||||
"/callback": {
|
"/callback": {
|
||||||
"target": "http://localhost:8070"
|
"target": "http://localhost:8070"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/animations": "^16.2.2",
|
||||||
|
"@angular/cdk": "^16.2.1",
|
||||||
|
"@angular/common": "^16.2.2",
|
||||||
|
"@angular/compiler": "^16.2.2",
|
||||||
|
"@angular/core": "^16.2.2",
|
||||||
|
"@angular/forms": "^16.2.2",
|
||||||
|
"@angular/material": "^16.2.1",
|
||||||
|
"@angular/platform-browser": "^16.2.2",
|
||||||
|
"@angular/platform-browser-dynamic": "^16.2.2",
|
||||||
|
"@angular/router": "^16.2.2",
|
||||||
|
"@angular/service-worker": "^16.2.2",
|
||||||
|
"@fortawesome/angular-fontawesome": "^0.13.0",
|
||||||
|
"@fortawesome/fontawesome-svg-core": "^6.1.1",
|
||||||
|
"@fortawesome/free-brands-svg-icons": "^6.1.1",
|
||||||
|
"@fortawesome/free-regular-svg-icons": "^6.1.1",
|
||||||
|
"@fortawesome/free-solid-svg-icons": "^6.1.1",
|
||||||
|
"bootstrap": "^4.6.2",
|
||||||
|
"cookieconsent": "^3.1.1",
|
||||||
|
"cors": "^2.8.5",
|
||||||
|
"express": "^4.18.1",
|
||||||
|
"jquery": "^3.6.0",
|
||||||
|
"ngx-cookie-service": "^16.0.1",
|
||||||
|
"ngx-cookieconsent": "^4.0.2",
|
||||||
|
"normalize.css": "^8.0.1",
|
||||||
|
"rxjs": "~7.5.0",
|
||||||
|
"ts-interface-checker": "^1.0.2",
|
||||||
|
"tslib": "^2.3.0",
|
||||||
|
"zone.js": "~0.13.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@angular-devkit/build-angular": "^16.2.0",
|
||||||
|
"@angular-eslint/builder": "^16.1.1",
|
||||||
|
"@angular-eslint/eslint-plugin": "16.1.1",
|
||||||
|
"@angular-eslint/eslint-plugin-template": "16.1.1",
|
||||||
|
"@angular-eslint/schematics": "16.1.1",
|
||||||
|
"@angular-eslint/template-parser": "16.1.1",
|
||||||
|
"@angular/cli": "^16.2.0",
|
||||||
|
"@angular/compiler-cli": "^16.2.2",
|
||||||
|
"@types/jasmine": "~4.0.0",
|
||||||
|
"@types/node": "^18.11.19",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||||
|
"@typescript-eslint/parser": "^5.59.2",
|
||||||
|
"eslint": "^8.39.0",
|
||||||
|
"eslint-config-prettier": "^9.0.0",
|
||||||
|
"eslint-plugin-prettier": "^5.0.1",
|
||||||
|
"jasmine-core": "~4.1.0",
|
||||||
|
"karma": "~6.3.0",
|
||||||
|
"karma-chrome-launcher": "~3.1.0",
|
||||||
|
"karma-coverage": "~2.2.0",
|
||||||
|
"karma-jasmine": "~5.0.0",
|
||||||
|
"karma-jasmine-html-reporter": "~1.7.0",
|
||||||
|
"prettier": "^3.0.3",
|
||||||
|
"prettier-eslint": "^16.1.1",
|
||||||
|
"ts-interface-builder": "^0.3.3",
|
||||||
|
"typescript": "~4.9.5"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"private": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@angular/animations": "^16.2.2",
|
|
||||||
"@angular/cdk": "^16.2.1",
|
|
||||||
"@angular/common": "^16.2.2",
|
|
||||||
"@angular/compiler": "^16.2.2",
|
|
||||||
"@angular/core": "^16.2.2",
|
|
||||||
"@angular/forms": "^16.2.2",
|
|
||||||
"@angular/material": "^16.2.1",
|
|
||||||
"@angular/platform-browser": "^16.2.2",
|
|
||||||
"@angular/platform-browser-dynamic": "^16.2.2",
|
|
||||||
"@angular/router": "^16.2.2",
|
|
||||||
"@angular/service-worker": "^16.2.2",
|
|
||||||
"@fortawesome/angular-fontawesome": "^0.13.0",
|
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.1.1",
|
|
||||||
"@fortawesome/free-brands-svg-icons": "^6.1.1",
|
|
||||||
"@fortawesome/free-regular-svg-icons": "^6.1.1",
|
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.1.1",
|
|
||||||
"bootstrap": "^4.6.2",
|
|
||||||
"cookieconsent": "^3.1.1",
|
|
||||||
"cors": "^2.8.5",
|
|
||||||
"express": "^4.18.1",
|
|
||||||
"jquery": "^3.6.0",
|
|
||||||
"ngx-cookie-service": "^16.0.1",
|
|
||||||
"ngx-cookieconsent": "^4.0.2",
|
|
||||||
"normalize.css": "^8.0.1",
|
|
||||||
"rxjs": "~7.5.0",
|
|
||||||
"ts-interface-checker": "^1.0.2",
|
|
||||||
"tslib": "^2.3.0",
|
|
||||||
"zone.js": "~0.13.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@angular-devkit/build-angular": "^16.2.0",
|
|
||||||
"@angular-eslint/builder": "^16.1.1",
|
|
||||||
"@angular-eslint/eslint-plugin": "16.1.1",
|
|
||||||
"@angular-eslint/eslint-plugin-template": "16.1.1",
|
|
||||||
"@angular-eslint/schematics": "16.1.1",
|
|
||||||
"@angular-eslint/template-parser": "16.1.1",
|
|
||||||
"@angular/cli": "^16.2.0",
|
|
||||||
"@angular/compiler-cli": "^16.2.2",
|
|
||||||
"@types/jasmine": "~4.0.0",
|
|
||||||
"@types/node": "^18.11.19",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
||||||
"@typescript-eslint/parser": "^5.59.2",
|
|
||||||
"eslint": "^8.39.0",
|
|
||||||
"jasmine-core": "~4.1.0",
|
|
||||||
"karma": "~6.3.0",
|
|
||||||
"karma-chrome-launcher": "~3.1.0",
|
|
||||||
"karma-coverage": "~2.2.0",
|
|
||||||
"karma-jasmine": "~5.0.0",
|
|
||||||
"karma-jasmine-html-reporter": "~1.7.0",
|
|
||||||
"ts-interface-builder": "^0.3.3",
|
|
||||||
"typescript": "~4.9.5"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const express = require('express');
|
const express = require("express");
|
||||||
const cors = require('cors');
|
const cors = require("cors");
|
||||||
const path = require('path');
|
const path = require("path");
|
||||||
|
|
||||||
const PKG_NAME = "frontend-hideyoshi.com";
|
const PKG_NAME = "frontend-hideyoshi.com";
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@ app.use(cors());
|
|||||||
|
|
||||||
app.use(express.static(`${__dirname}/dist/${PKG_NAME}`));
|
app.use(express.static(`${__dirname}/dist/${PKG_NAME}`));
|
||||||
|
|
||||||
app.get('/*', (req, res) => {
|
app.get("/*", (req, res) => {
|
||||||
res.sendFile(path.join(`${__dirname}/dist/${PKG_NAME}/index.html`));
|
res.sendFile(path.join(`${__dirname}/dist/${PKG_NAME}/index.html`));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -7,27 +7,22 @@ import { CallbackComponent } from './header/header-popup/callback/callback.compo
|
|||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
redirectTo: '/home',
|
redirectTo: '/home',
|
||||||
pathMatch: 'full'
|
pathMatch: 'full',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'home',
|
path: 'home',
|
||||||
component: HomeComponent
|
component: HomeComponent,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'callback',
|
path: 'callback',
|
||||||
component: CallbackComponent
|
component: CallbackComponent,
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [],
|
declarations: [],
|
||||||
imports: [
|
imports: [CommonModule, RouterModule.forRoot(routes)],
|
||||||
CommonModule,
|
exports: [RouterModule],
|
||||||
RouterModule.forRoot(routes)
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
RouterModule
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class AppRouterModule { }
|
export class AppRouterModule {}
|
||||||
|
|||||||
@@ -3,19 +3,15 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { ServiceWorkerModule } from '@angular/service-worker';
|
import { ServiceWorkerModule } from '@angular/service-worker';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [],
|
declarations: [],
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
ServiceWorkerModule.register('ngsw-worker.js', {
|
ServiceWorkerModule.register('ngsw-worker.js', {
|
||||||
enabled: environment.production,
|
enabled: environment.production,
|
||||||
registrationStrategy: 'registerWhenStable:30000'
|
registrationStrategy: 'registerWhenStable:30000',
|
||||||
})
|
}),
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [ServiceWorkerModule],
|
||||||
ServiceWorkerModule
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class AppServiceWorkerModule { }
|
export class AppServiceWorkerModule {}
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import { AppComponent } from './app.component';
|
|||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [
|
declarations: [AppComponent],
|
||||||
AppComponent
|
|
||||||
],
|
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -26,6 +24,8 @@ describe('AppComponent', () => {
|
|||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const compiled = fixture.nativeElement as HTMLElement;
|
const compiled = fixture.nativeElement as HTMLElement;
|
||||||
expect(compiled.querySelector('.content span')?.textContent).toContain('frontend-hideyoshi.com app is running!');
|
expect(compiled.querySelector('.content span')?.textContent).toContain(
|
||||||
|
'frontend-hideyoshi.com app is running!',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { AuthService } from './shared/auth/auth.service';
|
import { AuthService } from './shared/auth/auth.service';
|
||||||
import {UpdateService} from "./shared/service-worker/update.service";
|
import { UpdateService } from './shared/service-worker/update.service';
|
||||||
import {
|
import {
|
||||||
NgcCookieConsentService,
|
NgcCookieConsentService,
|
||||||
NgcInitializationErrorEvent,
|
NgcInitializationErrorEvent,
|
||||||
NgcInitializingEvent,
|
NgcInitializingEvent,
|
||||||
NgcNoCookieLawEvent, NgcStatusChangeEvent
|
NgcNoCookieLawEvent,
|
||||||
} from "ngx-cookieconsent";
|
NgcStatusChangeEvent,
|
||||||
import {Subscription} from "rxjs";
|
} from 'ngx-cookieconsent';
|
||||||
import {CookieConsertService} from "./shared/cookie-consent/cookie-consert.service";
|
import { Subscription } from 'rxjs';
|
||||||
|
import { CookieConsertService } from './shared/cookie-consent/cookie-consert.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrls: ['./app.component.css']
|
styleUrls: ['./app.component.css'],
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit {
|
export class AppComponent implements OnInit {
|
||||||
|
|
||||||
title = 'frontend-hideyoshi.com';
|
title = 'frontend-hideyoshi.com';
|
||||||
|
|
||||||
cookieStatusChangeSubscription!: Subscription;
|
cookieStatusChangeSubscription!: Subscription;
|
||||||
@@ -25,28 +25,30 @@ export class AppComponent implements OnInit {
|
|||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private ccService: NgcCookieConsentService,
|
private ccService: NgcCookieConsentService,
|
||||||
private cookieConsentService: CookieConsertService,
|
private cookieConsentService: CookieConsertService,
|
||||||
private serviceWorker: UpdateService) {
|
private serviceWorker: UpdateService,
|
||||||
|
) {
|
||||||
this.serviceWorker.checkForUpdates();
|
this.serviceWorker.checkForUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.authService.autoLogin();
|
this.authService.autoLogin();
|
||||||
|
|
||||||
let cookieConsentStatus = this.cookieConsentService.getCookieConsentStatusFromLocalStorage();
|
let cookieConsentStatus =
|
||||||
|
this.cookieConsentService.getCookieConsentStatusFromLocalStorage();
|
||||||
|
|
||||||
if (cookieConsentStatus) {
|
if (cookieConsentStatus) {
|
||||||
this.ccService.destroy();
|
this.ccService.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.cookieStatusChangeSubscription = this.ccService.statusChange$.subscribe(
|
this.cookieStatusChangeSubscription =
|
||||||
(event: NgcStatusChangeEvent) => {
|
this.ccService.statusChange$.subscribe(
|
||||||
if (event.status === 'allow') {
|
(event: NgcStatusChangeEvent) => {
|
||||||
this.cookieConsentService.consent();
|
if (event.status === 'allow') {
|
||||||
} else if (event.status === 'deny') {
|
this.cookieConsentService.consent();
|
||||||
this.cookieConsentService.decline();
|
} else if (event.status === 'deny') {
|
||||||
}
|
this.cookieConsentService.decline();
|
||||||
}
|
}
|
||||||
);
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,14 +10,10 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|||||||
import { AppServiceWorkerModule } from './app-service-worker.module';
|
import { AppServiceWorkerModule } from './app-service-worker.module';
|
||||||
import { ServiceWorkerModule } from '@angular/service-worker';
|
import { ServiceWorkerModule } from '@angular/service-worker';
|
||||||
import { environment } from '../environments/environment';
|
import { environment } from '../environments/environment';
|
||||||
import {FooterComponent} from "./footer/footer.component";
|
import { FooterComponent } from './footer/footer.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [AppComponent, HomeComponent, FooterComponent],
|
||||||
AppComponent,
|
|
||||||
HomeComponent,
|
|
||||||
FooterComponent
|
|
||||||
],
|
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
HeaderModule,
|
HeaderModule,
|
||||||
@@ -27,10 +23,10 @@ import {FooterComponent} from "./footer/footer.component";
|
|||||||
FontAwesomeModule,
|
FontAwesomeModule,
|
||||||
ServiceWorkerModule.register('ngsw-worker.js', {
|
ServiceWorkerModule.register('ngsw-worker.js', {
|
||||||
enabled: environment.production,
|
enabled: environment.production,
|
||||||
registrationStrategy: 'registerWhenStable:30000'
|
registrationStrategy: 'registerWhenStable:30000',
|
||||||
})
|
}),
|
||||||
],
|
],
|
||||||
providers: [],
|
providers: [],
|
||||||
bootstrap: [AppComponent]
|
bootstrap: [AppComponent],
|
||||||
})
|
})
|
||||||
export class AppModule { }
|
export class AppModule {}
|
||||||
|
|||||||
@@ -5,23 +5,27 @@
|
|||||||
<section class="mb-2">
|
<section class="mb-2">
|
||||||
<!-- Twitter -->
|
<!-- Twitter -->
|
||||||
<a class="btn footer-btn" href="https://twitter.com/NakazoneVitor">
|
<a class="btn footer-btn" href="https://twitter.com/NakazoneVitor">
|
||||||
<fa-icon class="input-div-icon"
|
<fa-icon class="input-div-icon" [icon]="_twitterIcon">
|
||||||
[icon]="_twitterIcon">
|
|
||||||
</fa-icon>
|
</fa-icon>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- Linkedin -->
|
<!-- Linkedin -->
|
||||||
<a class="btn footer-btn" href="https://www.linkedin.com/in/vitor-hideyoshi/" role="button">
|
<a
|
||||||
<fa-icon class="input-div-icon"
|
class="btn footer-btn"
|
||||||
[icon]="_linkedinIcon">
|
href="https://www.linkedin.com/in/vitor-hideyoshi/"
|
||||||
|
role="button"
|
||||||
|
>
|
||||||
|
<fa-icon class="input-div-icon" [icon]="_linkedinIcon">
|
||||||
</fa-icon>
|
</fa-icon>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- Github -->
|
<!-- Github -->
|
||||||
<a class="btn footer-btn" href="https://github.com/HideyoshiNakazone" role="button">
|
<a
|
||||||
<fa-icon class="input-div-icon"
|
class="btn footer-btn"
|
||||||
[icon]="_githubIcon">
|
href="https://github.com/HideyoshiNakazone"
|
||||||
</fa-icon>
|
role="button"
|
||||||
|
>
|
||||||
|
<fa-icon class="input-div-icon" [icon]="_githubIcon"> </fa-icon>
|
||||||
</a>
|
</a>
|
||||||
</section>
|
</section>
|
||||||
<!-- Section: Social media -->
|
<!-- Section: Social media -->
|
||||||
@@ -29,9 +33,11 @@
|
|||||||
<!-- Grid container -->
|
<!-- Grid container -->
|
||||||
|
|
||||||
<!-- Copyright -->
|
<!-- Copyright -->
|
||||||
<div class="text-center p-3" style="background-color: #2E2E2E;">
|
<div class="text-center p-3" style="background-color: #2e2e2e">
|
||||||
© 2023 Copyright:
|
© 2023 Copyright:
|
||||||
<a class="text-white" href="https://hideyoshi.com.br/">Hideyoshi Solutions</a>
|
<a class="text-white" href="https://hideyoshi.com.br/"
|
||||||
|
>Hideyoshi Solutions</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<!-- Copyright -->
|
<!-- Copyright -->
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -3,19 +3,19 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { FooterComponent } from './footer.component';
|
import { FooterComponent } from './footer.component';
|
||||||
|
|
||||||
describe('FooterComponent', () => {
|
describe('FooterComponent', () => {
|
||||||
let component: FooterComponent;
|
let component: FooterComponent;
|
||||||
let fixture: ComponentFixture<FooterComponent>;
|
let fixture: ComponentFixture<FooterComponent>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [FooterComponent]
|
declarations: [FooterComponent],
|
||||||
|
});
|
||||||
|
fixture = TestBed.createComponent(FooterComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(FooterComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import {Component} from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import {faGithub, faLinkedinIn, faTwitter} from "@fortawesome/free-brands-svg-icons";
|
import {
|
||||||
|
faGithub,
|
||||||
|
faLinkedinIn,
|
||||||
|
faTwitter,
|
||||||
|
} from '@fortawesome/free-brands-svg-icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-footer',
|
selector: 'app-footer',
|
||||||
templateUrl: './footer.component.html',
|
templateUrl: './footer.component.html',
|
||||||
styleUrls: ['./footer.component.css']
|
styleUrls: ['./footer.component.css'],
|
||||||
})
|
})
|
||||||
export class FooterComponent {
|
export class FooterComponent {
|
||||||
_githubIcon = faGithub;
|
_githubIcon = faGithub;
|
||||||
|
|||||||
@@ -2,19 +2,19 @@
|
|||||||
width: fit-content;
|
width: fit-content;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border: 1px solid rgba(46, 46, 46, .3);
|
border: 1px solid rgba(46, 46, 46, 0.3);
|
||||||
box-sizing: 0 5px 25px rgba(0, 0, 0, 0.1);
|
box-sizing: 0 5px 25px rgba(0, 0, 0, 0.1);
|
||||||
box-shadow: 1px 1px 4px 1px rgba(0, 0, 0, 0.2);
|
box-shadow: 1px 1px 4px 1px rgba(0, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown:before {
|
.dropdown:before {
|
||||||
content: '';
|
content: "";
|
||||||
width: 15px;
|
width: 15px;
|
||||||
height: 15px;
|
height: 15px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border-top: 1px solid rgba(46, 46, 46, .3);
|
border-top: 1px solid rgba(46, 46, 46, 0.3);
|
||||||
border-left: 1px solid rgba(46, 46, 46, .3);
|
border-left: 1px solid rgba(46, 46, 46, 0.3);
|
||||||
transform: translateX(120px) translateY(-50%) rotate(45deg);
|
transform: translateX(120px) translateY(-50%) rotate(45deg);
|
||||||
}
|
}
|
||||||
.info {
|
.info {
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-item {
|
.dropdown-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 8px 30px;
|
padding: 8px 30px;
|
||||||
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
||||||
@@ -59,14 +59,14 @@
|
|||||||
.dropdown-item:hover .icon-box fa-icon {
|
.dropdown-item:hover .icon-box fa-icon {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
color: #f44336;
|
color: #f44336;
|
||||||
transition: .5s;
|
transition: 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-item p {
|
.dropdown-item p {
|
||||||
color: #555555;
|
color: #555555;
|
||||||
font-family: 'Montserrat', sans-serif;
|
font-family: "Montserrat", sans-serif;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,12 @@
|
|||||||
[ignoreElementList]="ignoreClickOutside"
|
[ignoreElementList]="ignoreClickOutside"
|
||||||
[@dropdownState]="dropDownState"
|
[@dropdownState]="dropDownState"
|
||||||
(@dropdownState.start)="$event.element.style.display = 'block'"
|
(@dropdownState.start)="$event.element.style.display = 'block'"
|
||||||
(@dropdownState.done)="$event.element.style.display = (state ? 'block' : 'none')">
|
(@dropdownState.done)="
|
||||||
|
$event.element.style.display = state ? 'block' : 'none'
|
||||||
|
"
|
||||||
|
>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<h3>{{ this.user ? this.user.username : 'User Account' }}</h3>
|
<h3>{{ this.user ? this.user.username : "User Account" }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div #management>
|
<div #management>
|
||||||
<ul class="user-management" *ngIf="!this.user">
|
<ul class="user-management" *ngIf="!this.user">
|
||||||
@@ -34,13 +37,19 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="dropdown-item" (click)="onHelpClicked()">
|
<li class="dropdown-item" (click)="onHelpClicked()">
|
||||||
<div class="icon-box">
|
<div class="icon-box">
|
||||||
<fa-icon class="fas fa-question-circle" [icon]="questionCircleIcon"></fa-icon>
|
<fa-icon
|
||||||
|
class="fas fa-question-circle"
|
||||||
|
[icon]="questionCircleIcon"
|
||||||
|
></fa-icon>
|
||||||
</div>
|
</div>
|
||||||
<p>Help</p>
|
<p>Help</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown-item" (click)="onLogout()">
|
<li class="dropdown-item" (click)="onLogout()">
|
||||||
<div class="icon-box">
|
<div class="icon-box">
|
||||||
<fa-icon class="fas fa-sign-out-alt" [icon]="signOutAltIcon"></fa-icon>
|
<fa-icon
|
||||||
|
class="fas fa-sign-out-alt"
|
||||||
|
[icon]="signOutAltIcon"
|
||||||
|
></fa-icon>
|
||||||
</div>
|
</div>
|
||||||
<p>Logout</p>
|
<p>Logout</p>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('HeaderDropdownComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ HeaderDropdownComponent ]
|
declarations: [HeaderDropdownComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(HeaderDropdownComponent);
|
fixture = TestBed.createComponent(HeaderDropdownComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,12 +1,32 @@
|
|||||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
import {
|
||||||
import {Component, ComponentRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewContainerRef} from '@angular/core';
|
animate,
|
||||||
import { faEdit, faQuestionCircle, faSignOutAlt, faUser } from '@fortawesome/free-solid-svg-icons';
|
state,
|
||||||
|
style,
|
||||||
|
transition,
|
||||||
|
trigger,
|
||||||
|
} from '@angular/animations';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentRef,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
ViewContainerRef,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
faEdit,
|
||||||
|
faQuestionCircle,
|
||||||
|
faSignOutAlt,
|
||||||
|
faUser,
|
||||||
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { AuthService } from 'src/app/shared/auth/auth.service';
|
import { AuthService } from 'src/app/shared/auth/auth.service';
|
||||||
import {User} from "../../shared/model/user/user.model";
|
import { User } from '../../shared/model/user/user.model';
|
||||||
import UserChecker from "../../shared/model/user/user.checker";
|
import UserChecker from '../../shared/model/user/user.checker';
|
||||||
import {HelpComponent} from "../header-popup/help/help.component";
|
import { HelpComponent } from '../header-popup/help/help.component';
|
||||||
import {MyProfileComponent} from "../header-popup/my-profile/my-profile.component";
|
import { MyProfileComponent } from '../header-popup/my-profile/my-profile.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header-dropdown',
|
selector: 'app-header-dropdown',
|
||||||
@@ -14,19 +34,24 @@ import {MyProfileComponent} from "../header-popup/my-profile/my-profile.componen
|
|||||||
styleUrls: ['./header-dropdown.component.css'],
|
styleUrls: ['./header-dropdown.component.css'],
|
||||||
animations: [
|
animations: [
|
||||||
trigger('dropdownState', [
|
trigger('dropdownState', [
|
||||||
state('hide', style({
|
state(
|
||||||
'opacity': '0'
|
'hide',
|
||||||
})),
|
style({
|
||||||
state('show', style({
|
opacity: '0',
|
||||||
'opacity': '1'
|
}),
|
||||||
})),
|
),
|
||||||
|
state(
|
||||||
|
'show',
|
||||||
|
style({
|
||||||
|
opacity: '1',
|
||||||
|
}),
|
||||||
|
),
|
||||||
transition('hide => show', animate('20ms ease-in')),
|
transition('hide => show', animate('20ms ease-in')),
|
||||||
transition('show => hide', animate('5ms ease-out'))
|
transition('show => hide', animate('5ms ease-out')),
|
||||||
])
|
]),
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class HeaderDropdownComponent implements OnInit, OnDestroy {
|
export class HeaderDropdownComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
userIcon = faUser;
|
userIcon = faUser;
|
||||||
|
|
||||||
editIcon = faEdit;
|
editIcon = faEdit;
|
||||||
@@ -40,38 +65,41 @@ export class HeaderDropdownComponent implements OnInit, OnDestroy {
|
|||||||
private userSubscription!: Subscription;
|
private userSubscription!: Subscription;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
state: boolean = false;
|
state: boolean = false;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
ignoreClickOutside!: HTMLDivElement[];
|
ignoreClickOutside!: HTMLDivElement[];
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
clickOutside = new EventEmitter();
|
clickOutside = new EventEmitter();
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
loginPopupState: EventEmitter<boolean> = new EventEmitter();
|
loginPopupState: EventEmitter<boolean> = new EventEmitter();
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
signupPopupState: EventEmitter<boolean> = new EventEmitter();
|
signupPopupState: EventEmitter<boolean> = new EventEmitter();
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
helpPopupState: EventEmitter<boolean> = new EventEmitter();
|
helpPopupState: EventEmitter<boolean> = new EventEmitter();
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
myProfilePopupState: EventEmitter<boolean> = new EventEmitter();
|
myProfilePopupState: EventEmitter<boolean> = new EventEmitter();
|
||||||
|
|
||||||
constructor(private viewContainerRef: ViewContainerRef, private authService: AuthService) { }
|
constructor(
|
||||||
|
private viewContainerRef: ViewContainerRef,
|
||||||
|
private authService: AuthService,
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.userSubscription = this.authService.authSubject.subscribe(
|
this.userSubscription = this.authService.authSubject.subscribe(
|
||||||
res => {
|
(res) => {
|
||||||
if (res && UserChecker.test(res)) {
|
if (res && UserChecker.test(res)) {
|
||||||
this.user = <User>res;
|
this.user = <User>res;
|
||||||
} else {
|
} else {
|
||||||
this.user = null;
|
this.user = null;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
|||||||
@@ -3,21 +3,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { CallbackComponent } from './callback.component';
|
import { CallbackComponent } from './callback.component';
|
||||||
|
|
||||||
describe('CallbackComponent', () => {
|
describe('CallbackComponent', () => {
|
||||||
let component: CallbackComponent;
|
let component: CallbackComponent;
|
||||||
let fixture: ComponentFixture<CallbackComponent>;
|
let fixture: ComponentFixture<CallbackComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ CallbackComponent ]
|
declarations: [CallbackComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(CallbackComponent);
|
fixture = TestBed.createComponent(CallbackComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,35 +5,32 @@ import { AuthService } from 'src/app/shared/auth/auth.service';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-callback',
|
selector: 'app-callback',
|
||||||
templateUrl: './callback.component.html',
|
templateUrl: './callback.component.html',
|
||||||
styleUrls: ['./callback.component.css']
|
styleUrls: ['./callback.component.css'],
|
||||||
})
|
})
|
||||||
export class CallbackComponent implements OnInit {
|
export class CallbackComponent implements OnInit {
|
||||||
|
constructor(
|
||||||
constructor(private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private authService: AuthService) { }
|
private authService: AuthService,
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.route.queryParams.subscribe((p) => {
|
||||||
this.route.queryParams.subscribe(p => {
|
|
||||||
|
|
||||||
let auth: 'google' | 'github' = p['auth'];
|
let auth: 'google' | 'github' = p['auth'];
|
||||||
|
|
||||||
switch (auth) {
|
switch (auth) {
|
||||||
case "github":
|
case 'github':
|
||||||
this.authService.loginGithubUser(p)
|
this.authService.loginGithubUser(p);
|
||||||
break;
|
break;
|
||||||
case "google":
|
case 'google':
|
||||||
this.authService.loginGoogleUser(p)
|
this.authService.loginGoogleUser(p);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log(`Unimplemented auth: ${auth}`)
|
console.log(`Unimplemented auth: ${auth}`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.router.navigate(['/home'])
|
this.router.navigate(['/home']);
|
||||||
|
});
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<div class="error-box" *ngIf="errorMessage">
|
<div class="error-box" *ngIf="errorMessage">
|
||||||
{{errorMessage}}
|
{{ errorMessage }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,21 +3,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { ErrorBoxComponent } from './error-box.component';
|
import { ErrorBoxComponent } from './error-box.component';
|
||||||
|
|
||||||
describe('ErrorBoxComponent', () => {
|
describe('ErrorBoxComponent', () => {
|
||||||
let component: ErrorBoxComponent;
|
let component: ErrorBoxComponent;
|
||||||
let fixture: ComponentFixture<ErrorBoxComponent>;
|
let fixture: ComponentFixture<ErrorBoxComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ ErrorBoxComponent ]
|
declarations: [ErrorBoxComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ErrorBoxComponent);
|
fixture = TestBed.createComponent(ErrorBoxComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
import {Component, Input} from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-error-box',
|
selector: 'app-error-box',
|
||||||
templateUrl: './error-box.component.html',
|
templateUrl: './error-box.component.html',
|
||||||
styleUrls: ['./error-box.component.css']
|
styleUrls: ['./error-box.component.css'],
|
||||||
})
|
})
|
||||||
export class ErrorBoxComponent {
|
export class ErrorBoxComponent {
|
||||||
@Input()
|
@Input()
|
||||||
errorMessage: string|null = "Error, please try again later."
|
errorMessage: string | null = 'Error, please try again later.';
|
||||||
|
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
|
constructor() {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,32 @@
|
|||||||
<app-popup [state]="state"
|
<app-popup
|
||||||
(stateChange)="onStateChange($event)"
|
[state]="state"
|
||||||
[ignoreClickOutside]="ignoreClickOutside">
|
(stateChange)="onStateChange($event)"
|
||||||
|
[ignoreClickOutside]="ignoreClickOutside"
|
||||||
|
>
|
||||||
<div class="help-container container m-0 overflow-hidden">
|
<div class="help-container container m-0 overflow-hidden">
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This is a simple example project to demonstrate
|
This is a simple example project to demonstrate User Authentication
|
||||||
User Authentication and Authorization using
|
and Authorization using
|
||||||
<a href="https://spring.io/projects/spring-security" target="_blank">Spring Security</a>
|
<a href="https://spring.io/projects/spring-security" target="_blank"
|
||||||
|
>Spring Security</a
|
||||||
|
>
|
||||||
and
|
and
|
||||||
<a href="https://docs.spring.io/spring-security/reference/servlet/oauth2/" target="_blank">OAuth2</a>.
|
<a
|
||||||
|
href="https://docs.spring.io/spring-security/reference/servlet/oauth2/"
|
||||||
|
target="_blank"
|
||||||
|
>OAuth2</a
|
||||||
|
>.
|
||||||
|
|
||||||
<br/><br/>
|
<br /><br />
|
||||||
|
|
||||||
The only data stored is your email address, username and name.
|
The only data stored is your email address, username and name. This
|
||||||
This data is stored in a database and is used to authenticate you
|
data is stored in a database and is used to authenticate you and
|
||||||
and will not be used for any other purpose.
|
will not be used for any other purpose.
|
||||||
|
|
||||||
<br/><br/>
|
<br /><br />
|
||||||
|
|
||||||
All data can be deleted by clicking the "Delete Account" button
|
All data can be deleted by clicking the "Delete Account" button on
|
||||||
on the "My Profile" option.
|
the "My Profile" option.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</app-popup>
|
</app-popup>
|
||||||
|
|||||||
@@ -3,21 +3,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { HelpComponent } from './help.component';
|
import { HelpComponent } from './help.component';
|
||||||
|
|
||||||
describe('HelpComponent', () => {
|
describe('HelpComponent', () => {
|
||||||
let component: HelpComponent;
|
let component: HelpComponent;
|
||||||
let fixture: ComponentFixture<HelpComponent>;
|
let fixture: ComponentFixture<HelpComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ HelpComponent ]
|
declarations: [HelpComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(HelpComponent);
|
fixture = TestBed.createComponent(HelpComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-help',
|
selector: 'app-help',
|
||||||
templateUrl: './help.component.html',
|
templateUrl: './help.component.html',
|
||||||
styleUrls: ['./help.component.css']
|
styleUrls: ['./help.component.css'],
|
||||||
})
|
})
|
||||||
export class HelpComponent {
|
export class HelpComponent {
|
||||||
|
@Input()
|
||||||
|
state: boolean = false;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
state: boolean = false;
|
ignoreClickOutside!: HTMLDivElement[];
|
||||||
|
|
||||||
@Input()
|
|
||||||
ignoreClickOutside!: HTMLDivElement[];
|
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
stateChange = new EventEmitter<boolean>();
|
stateChange = new EventEmitter<boolean>();
|
||||||
|
|
||||||
constructor() { }
|
constructor() {}
|
||||||
|
|
||||||
onStateChange(state: boolean) {
|
onStateChange(state: boolean) {
|
||||||
this.stateChange.emit(state);
|
this.stateChange.emit(state);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.authentication-body .btn {
|
.authentication-body .btn {
|
||||||
background-color: #D8291C !important;
|
background-color: #d8291c !important;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
border-bottom: 2px solid #7676769b;
|
border-bottom: 2px solid #7676769b;
|
||||||
}
|
}
|
||||||
.input-div:after {
|
.input-div:after {
|
||||||
content: '';
|
content: "";
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
@@ -81,11 +81,12 @@
|
|||||||
.input-div:hover:after,
|
.input-div:hover:after,
|
||||||
.input-div:has(input.form-control:focus):after {
|
.input-div:has(input.form-control:focus):after {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
transition: .4s;
|
transition: 0.4s;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-div > .form-control, .input-div > .form-control:hover{
|
.input-div > .form-control,
|
||||||
|
.input-div > .form-control:hover {
|
||||||
border: none;
|
border: none;
|
||||||
border-color: inherit;
|
border-color: inherit;
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
@@ -98,7 +99,7 @@
|
|||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
color: #767676;
|
color: #767676;
|
||||||
}
|
}
|
||||||
.input-div >.form-control:-webkit-autofill {
|
.input-div > .form-control:-webkit-autofill {
|
||||||
-webkit-text-fill-color: #767676;
|
-webkit-text-fill-color: #767676;
|
||||||
box-shadow: 0 0 0px 1000px #ffffff inset;
|
box-shadow: 0 0 0px 1000px #ffffff inset;
|
||||||
-webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
|
-webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
|
||||||
@@ -108,19 +109,16 @@
|
|||||||
.input-div:hover > .form-control::placeholder,
|
.input-div:hover > .form-control::placeholder,
|
||||||
.input-div:hover > .input-div-icon,
|
.input-div:hover > .input-div-icon,
|
||||||
.input-div:has(input.form-control:focus) > .input-div-icon {
|
.input-div:has(input.form-control:focus) > .input-div-icon {
|
||||||
color: #D8291C;
|
color: #d8291c;
|
||||||
transition: .3s;
|
transition: 0.3s;
|
||||||
}
|
}
|
||||||
.input-div:hover > .form-control::placeholder,
|
.input-div:hover > .form-control::placeholder,
|
||||||
.input-div:has(input.form-control:focus) > .form-control::placeholder {
|
.input-div:has(input.form-control:focus) > .form-control::placeholder {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
transition: .3s;
|
transition: 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (min-width: 767px) {
|
||||||
|
|
||||||
@media (min-width:767px) {
|
|
||||||
|
|
||||||
.authentication-container {
|
.authentication-container {
|
||||||
min-width: 630px;
|
min-width: 630px;
|
||||||
}
|
}
|
||||||
@@ -150,5 +148,4 @@
|
|||||||
border-right: 2px solid #80808076;
|
border-right: 2px solid #80808076;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,41 +1,56 @@
|
|||||||
<app-popup [state]="state"
|
<app-popup
|
||||||
|
[state]="state"
|
||||||
(stateChange)="onStateChange($event)"
|
(stateChange)="onStateChange($event)"
|
||||||
[ignoreClickOutside]="ignoreClickOutside">
|
[ignoreClickOutside]="ignoreClickOutside"
|
||||||
|
>
|
||||||
<div class="container m-0 overflow-hidden"
|
<div
|
||||||
[@resizeContainerForErrorMessage]="hideErrorMessage()">
|
class="container m-0 overflow-hidden"
|
||||||
|
[@resizeContainerForErrorMessage]="hideErrorMessage()"
|
||||||
<app-error-box [errorMessage]="errorMessage"
|
>
|
||||||
[@showErrorMessage]="showErrorMessage()">
|
<app-error-box
|
||||||
|
[errorMessage]="errorMessage"
|
||||||
|
[@showErrorMessage]="showErrorMessage()"
|
||||||
|
>
|
||||||
</app-error-box>
|
</app-error-box>
|
||||||
|
|
||||||
<div class="container authentication-container"
|
<div
|
||||||
[@hideAuthContainer]="hideErrorMessage()"
|
class="container authentication-container"
|
||||||
(@hideAuthContainer.done)="hideAuthContainer($event)">
|
[@hideAuthContainer]="hideErrorMessage()"
|
||||||
|
(@hideAuthContainer.done)="hideAuthContainer($event)"
|
||||||
|
>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 authentication-body">
|
<div class="col-lg-6 authentication-body">
|
||||||
<form [formGroup]="loginForm" (ngSubmit)="onLogin()">
|
<form [formGroup]="loginForm" (ngSubmit)="onLogin()">
|
||||||
<div class="input-div">
|
<div class="input-div">
|
||||||
<fa-icon class="input-div-icon"
|
<fa-icon class="input-div-icon" [icon]="_userIcon">
|
||||||
[icon]="_userIcon">
|
|
||||||
</fa-icon>
|
</fa-icon>
|
||||||
<input type="text" id="username"
|
<input
|
||||||
formControlName="username"
|
type="text"
|
||||||
class="form-control"
|
id="username"
|
||||||
placeholder="Username">
|
formControlName="username"
|
||||||
|
class="form-control"
|
||||||
|
placeholder="Username"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-div">
|
<div class="input-div">
|
||||||
<fa-icon class="input-div-icon"
|
<fa-icon
|
||||||
[icon]="_passwordIcon">
|
class="input-div-icon"
|
||||||
|
[icon]="_passwordIcon"
|
||||||
|
>
|
||||||
</fa-icon>
|
</fa-icon>
|
||||||
<input type="password" id="password"
|
<input
|
||||||
formControlName="password"
|
type="password"
|
||||||
class="form-control"
|
id="password"
|
||||||
placeholder="Password">
|
formControlName="password"
|
||||||
|
class="form-control"
|
||||||
|
placeholder="Password"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn"
|
<button
|
||||||
[disabled]="loginForm.invalid"
|
class="btn"
|
||||||
type="submit">
|
[disabled]="loginForm.invalid"
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
Login
|
Login
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -44,30 +59,38 @@
|
|||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6 authentication-body">
|
<div class="col-lg-6 authentication-body">
|
||||||
<button mat-button
|
<button
|
||||||
class="oauth-button d-flex justify-content-center align-items-center"
|
mat-button
|
||||||
[disabled]="isCookieBlocked"
|
class="oauth-button d-flex justify-content-center align-items-center"
|
||||||
(click)="onGoogleLogin()">
|
[disabled]="isCookieBlocked"
|
||||||
<mat-icon *ngIf="!isCookieBlocked"
|
(click)="onGoogleLogin()"
|
||||||
style="width: 50px; height:30px"
|
>
|
||||||
svgIcon="google-logo"></mat-icon>
|
<mat-icon
|
||||||
<mat-icon *ngIf="isCookieBlocked"
|
*ngIf="!isCookieBlocked"
|
||||||
style="width: 50px; height:30px"
|
style="width: 50px; height: 30px"
|
||||||
svgIcon="google-disabled-logo"></mat-icon>
|
svgIcon="google-logo"
|
||||||
|
></mat-icon>
|
||||||
|
<mat-icon
|
||||||
|
*ngIf="isCookieBlocked"
|
||||||
|
style="width: 50px; height: 30px"
|
||||||
|
svgIcon="google-disabled-logo"
|
||||||
|
></mat-icon>
|
||||||
Login With Google
|
Login With Google
|
||||||
</button>
|
</button>
|
||||||
<button mat-button
|
<button
|
||||||
class="oauth-button d-flex justify-content-center align-items-center"
|
mat-button
|
||||||
[disabled]="isCookieBlocked"
|
class="oauth-button d-flex justify-content-center align-items-center"
|
||||||
(click)="onGithubLogin()">
|
[disabled]="isCookieBlocked"
|
||||||
<mat-icon style="width: 50px; height:30px"
|
(click)="onGithubLogin()"
|
||||||
svgIcon="github-logo"></mat-icon>
|
>
|
||||||
|
<mat-icon
|
||||||
|
style="width: 50px; height: 30px"
|
||||||
|
svgIcon="github-logo"
|
||||||
|
></mat-icon>
|
||||||
Login With Github
|
Login With Github
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</app-popup>
|
</app-popup>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('LoginComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ LoginComponent ]
|
declarations: [LoginComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(LoginComponent);
|
fixture = TestBed.createComponent(LoginComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,24 +1,44 @@
|
|||||||
import { AfterViewInit, ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
|
import {
|
||||||
|
AfterViewInit,
|
||||||
|
ChangeDetectorRef,
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
} from '@angular/core';
|
||||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { MatIconRegistry } from '@angular/material/icon';
|
import { MatIconRegistry } from '@angular/material/icon';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { faLock, faUser } from '@fortawesome/free-solid-svg-icons';
|
import { faLock, faUser } from '@fortawesome/free-solid-svg-icons';
|
||||||
import {Subscription} from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { AuthService } from 'src/app/shared/auth/auth.service';
|
import { AuthService } from 'src/app/shared/auth/auth.service';
|
||||||
import { HttpError } from 'src/app/shared/model/httpError/httpError.model';
|
import { HttpError } from 'src/app/shared/model/httpError/httpError.model';
|
||||||
import HttpErrorChecker from 'src/app/shared/model/httpError/httpErrorChecker';
|
import HttpErrorChecker from 'src/app/shared/model/httpError/httpErrorChecker';
|
||||||
import UserChecker from 'src/app/shared/model/user/user.checker';
|
import UserChecker from 'src/app/shared/model/user/user.checker';
|
||||||
import { User } from 'src/app/shared/model/user/user.model';
|
import { User } from 'src/app/shared/model/user/user.model';
|
||||||
import {animate, animateChild, group, query, state, style, transition, trigger} from "@angular/animations";
|
import {
|
||||||
import {ValidatePasswordValidator} from "../../../shared/validators/validate-password.validator";
|
animate,
|
||||||
import {ValidateNotEmptyValidator} from "../../../shared/validators/validate-not-empty.validator";
|
animateChild,
|
||||||
import {NgcCookieConsentService, NgcStatusChangeEvent} from "ngx-cookieconsent";
|
group,
|
||||||
import {CookieConsertService} from "../../../shared/cookie-consent/cookie-consert.service";
|
query,
|
||||||
|
state,
|
||||||
|
style,
|
||||||
|
transition,
|
||||||
|
trigger,
|
||||||
|
} from '@angular/animations';
|
||||||
|
import { ValidatePasswordValidator } from '../../../shared/validators/validate-password.validator';
|
||||||
|
import { ValidateNotEmptyValidator } from '../../../shared/validators/validate-not-empty.validator';
|
||||||
|
import {
|
||||||
|
NgcCookieConsentService,
|
||||||
|
NgcStatusChangeEvent,
|
||||||
|
} from 'ngx-cookieconsent';
|
||||||
|
import { CookieConsertService } from '../../../shared/cookie-consent/cookie-consert.service';
|
||||||
|
|
||||||
|
const GOOGLE_LOGO_SVG = 'assets/img/providers/google.svg';
|
||||||
const GOOGLE_LOGO_SVG = "assets/img/providers/google.svg";
|
const GOOGLE_DISABLED_LOGO_SVG = 'assets/img/providers/google-disabled.svg';
|
||||||
const GOOGLE_DISABLED_LOGO_SVG = "assets/img/providers/google-disabled.svg";
|
const GITHUB_LOGO_SVG = 'assets/img/providers/github.svg';
|
||||||
const GITHUB_LOGO_SVG = "assets/img/providers/github.svg";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
@@ -26,78 +46,66 @@ const GITHUB_LOGO_SVG = "assets/img/providers/github.svg";
|
|||||||
styleUrls: ['./login.component.css'],
|
styleUrls: ['./login.component.css'],
|
||||||
animations: [
|
animations: [
|
||||||
trigger('resizeContainerForErrorMessage', [
|
trigger('resizeContainerForErrorMessage', [
|
||||||
state('hide',
|
state(
|
||||||
|
'hide',
|
||||||
style({
|
style({
|
||||||
height: '100px',
|
height: '100px',
|
||||||
width: '320px',
|
width: '320px',
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
transition(
|
transition(
|
||||||
'show => hide',
|
'show => hide',
|
||||||
group([
|
group([
|
||||||
query(
|
query('@*', animateChild(), { optional: true }),
|
||||||
"@*",
|
animate('1s ease'),
|
||||||
animateChild(),
|
]),
|
||||||
{ optional: true }
|
),
|
||||||
),
|
|
||||||
animate('1s ease')
|
|
||||||
])
|
|
||||||
)
|
|
||||||
]),
|
]),
|
||||||
trigger('showErrorMessage', [
|
trigger('showErrorMessage', [
|
||||||
state('show',
|
state(
|
||||||
|
'show',
|
||||||
style({
|
style({
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
height: '100px',
|
height: '100px',
|
||||||
width: '320px',
|
width: '320px',
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
state('hide',
|
state(
|
||||||
|
'hide',
|
||||||
style({
|
style({
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
height: '0px',
|
height: '0px',
|
||||||
width: '0px',
|
width: '0px',
|
||||||
})
|
}),
|
||||||
),
|
|
||||||
transition(
|
|
||||||
'* => show',
|
|
||||||
animate(
|
|
||||||
'500ms ease-in'
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
transition('* => show', animate('500ms ease-in')),
|
||||||
]),
|
]),
|
||||||
trigger('hideAuthContainer', [
|
trigger('hideAuthContainer', [
|
||||||
state('hide',
|
state(
|
||||||
|
'hide',
|
||||||
style({
|
style({
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
transition(
|
transition(
|
||||||
'show => hide',
|
'show => hide',
|
||||||
group([
|
group([
|
||||||
query(
|
query('@*', animateChild(), { optional: true }),
|
||||||
"@*",
|
animate('250ms ease-out'),
|
||||||
animateChild(),
|
]),
|
||||||
{ optional: true }
|
),
|
||||||
),
|
|
||||||
animate(
|
|
||||||
'250ms ease-out'
|
|
||||||
)
|
|
||||||
])
|
|
||||||
)
|
|
||||||
]),
|
]),
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class LoginComponent implements OnInit, AfterViewInit, OnDestroy {
|
export class LoginComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||||
|
@Input()
|
||||||
|
state: boolean = false;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
state: boolean = false;
|
ignoreClickOutside!: HTMLDivElement[];
|
||||||
|
|
||||||
@Input()
|
|
||||||
ignoreClickOutside!: HTMLDivElement[];
|
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
stateChange = new EventEmitter<boolean>();
|
stateChange = new EventEmitter<boolean>();
|
||||||
|
|
||||||
loginForm!: FormGroup;
|
loginForm!: FormGroup;
|
||||||
|
|
||||||
@@ -121,39 +129,47 @@ export class LoginComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private cookieConsentService: CookieConsertService,
|
private cookieConsentService: CookieConsertService,
|
||||||
private changeDetectorRef: ChangeDetectorRef,
|
private changeDetectorRef: ChangeDetectorRef,
|
||||||
private matIconRegistry: MatIconRegistry,
|
private matIconRegistry: MatIconRegistry,
|
||||||
private domSanitizer: DomSanitizer) {
|
private domSanitizer: DomSanitizer,
|
||||||
|
) {
|
||||||
this.matIconRegistry.addSvgIcon(
|
this.matIconRegistry.addSvgIcon(
|
||||||
"google-logo",
|
'google-logo',
|
||||||
this.domSanitizer.bypassSecurityTrustResourceUrl(GOOGLE_LOGO_SVG)
|
this.domSanitizer.bypassSecurityTrustResourceUrl(GOOGLE_LOGO_SVG),
|
||||||
);
|
);
|
||||||
this.matIconRegistry.addSvgIcon(
|
this.matIconRegistry.addSvgIcon(
|
||||||
"google-disabled-logo",
|
'google-disabled-logo',
|
||||||
this.domSanitizer.bypassSecurityTrustResourceUrl(GOOGLE_DISABLED_LOGO_SVG)
|
this.domSanitizer.bypassSecurityTrustResourceUrl(
|
||||||
)
|
GOOGLE_DISABLED_LOGO_SVG,
|
||||||
|
),
|
||||||
|
);
|
||||||
this.matIconRegistry.addSvgIcon(
|
this.matIconRegistry.addSvgIcon(
|
||||||
"github-logo",
|
'github-logo',
|
||||||
this.domSanitizer.bypassSecurityTrustResourceUrl(GITHUB_LOGO_SVG)
|
this.domSanitizer.bypassSecurityTrustResourceUrl(GITHUB_LOGO_SVG),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.loginForm = new FormGroup({
|
this.loginForm = new FormGroup({
|
||||||
'username': new FormControl(null, [Validators.required, ValidateNotEmptyValidator]),
|
username: new FormControl(null, [
|
||||||
'password': new FormControl(null, [Validators.required, ValidatePasswordValidator])
|
Validators.required,
|
||||||
|
ValidateNotEmptyValidator,
|
||||||
|
]),
|
||||||
|
password: new FormControl(null, [
|
||||||
|
Validators.required,
|
||||||
|
ValidatePasswordValidator,
|
||||||
|
]),
|
||||||
});
|
});
|
||||||
this.errorMessage = null;
|
this.errorMessage = null;
|
||||||
this.authSubject = this.authService.authSubject.subscribe(
|
this.authSubject = this.authService.authSubject.subscribe((res) => {
|
||||||
res => {
|
this.validateLogin(res);
|
||||||
this.validateLogin(res);
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
this.cookieStatusChangeSubscription = this.cookieConsentService.cookieStatusChangeSubscription.subscribe(
|
this.cookieStatusChangeSubscription =
|
||||||
(status: boolean) => {
|
this.cookieConsentService.cookieStatusChangeSubscription.subscribe(
|
||||||
this.isCookieBlocked = !status;
|
(status: boolean) => {
|
||||||
console.log("Cookie status: " + status);
|
this.isCookieBlocked = !status;
|
||||||
}
|
console.log('Cookie status: ' + status);
|
||||||
);
|
},
|
||||||
|
);
|
||||||
|
|
||||||
if (this.isCookieBlocked) {
|
if (this.isCookieBlocked) {
|
||||||
this.ccService.fadeIn();
|
this.ccService.fadeIn();
|
||||||
@@ -176,8 +192,8 @@ export class LoginComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
onLogin() {
|
onLogin() {
|
||||||
let user: User = {
|
let user: User = {
|
||||||
username: this.loginForm.controls['username'].value,
|
username: this.loginForm.controls['username'].value,
|
||||||
password: this.loginForm.controls['password'].value
|
password: this.loginForm.controls['password'].value,
|
||||||
}
|
};
|
||||||
this.authService.login(user);
|
this.authService.login(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,11 +207,11 @@ export class LoginComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
private validateLogin(res: User | HttpError | null) {
|
private validateLogin(res: User | HttpError | null) {
|
||||||
if (res && UserChecker.test(res)) {
|
if (res && UserChecker.test(res)) {
|
||||||
this.closePopup()
|
this.closePopup();
|
||||||
} if (HttpErrorChecker.test(res)) {
|
}
|
||||||
|
if (HttpErrorChecker.test(res)) {
|
||||||
this.errorMessage = (<HttpError>res).details;
|
this.errorMessage = (<HttpError>res).details;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private closePopup() {
|
private closePopup() {
|
||||||
@@ -205,23 +221,22 @@ export class LoginComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
public showErrorMessage(): string {
|
public showErrorMessage(): string {
|
||||||
if (this.isShowErrorMessage) {
|
if (this.isShowErrorMessage) {
|
||||||
return "show";
|
return 'show';
|
||||||
}
|
}
|
||||||
return "hide";
|
return 'hide';
|
||||||
}
|
}
|
||||||
|
|
||||||
public hideErrorMessage(): string {
|
public hideErrorMessage(): string {
|
||||||
if (!!this.errorMessage) {
|
if (!!this.errorMessage) {
|
||||||
return "hide";
|
return 'hide';
|
||||||
}
|
}
|
||||||
return "show";
|
return 'show';
|
||||||
}
|
}
|
||||||
|
|
||||||
hideAuthContainer(event: any) {
|
hideAuthContainer(event: any) {
|
||||||
if (event.toState === "hide") {
|
if (event.toState === 'hide') {
|
||||||
event.element.style.display = "none";
|
event.element.style.display = 'none';
|
||||||
this.isShowErrorMessage = true;
|
this.isShowErrorMessage = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.profile-options-container button {
|
.profile-options-container button {
|
||||||
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
@@ -55,9 +54,7 @@
|
|||||||
background-color: rgba(216, 41, 28, 0.7) !important;
|
background-color: rgba(216, 41, 28, 0.7) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (min-width: 767px) {
|
||||||
@media (min-width:767px) {
|
|
||||||
|
|
||||||
.profile-options-container {
|
.profile-options-container {
|
||||||
all: unset;
|
all: unset;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
@@ -96,5 +93,4 @@
|
|||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,28 @@
|
|||||||
<app-popup [state]="state"
|
<app-popup
|
||||||
(stateChange)="onStateChange($event)"
|
[state]="state"
|
||||||
[ignoreClickOutside]="ignoreClickOutside">
|
(stateChange)="onStateChange($event)"
|
||||||
|
[ignoreClickOutside]="ignoreClickOutside"
|
||||||
<div class="container m-0 overflow-hidden"
|
>
|
||||||
[@resizeContainerForErrorMessage]="hideErrorMessage()">
|
<div
|
||||||
|
class="container m-0 overflow-hidden"
|
||||||
<app-error-box [errorMessage]="errorMessage"
|
[@resizeContainerForErrorMessage]="hideErrorMessage()"
|
||||||
[@showErrorMessage]="showErrorMessage()">
|
>
|
||||||
|
<app-error-box
|
||||||
|
[errorMessage]="errorMessage"
|
||||||
|
[@showErrorMessage]="showErrorMessage()"
|
||||||
|
>
|
||||||
</app-error-box>
|
</app-error-box>
|
||||||
|
|
||||||
<div class="container profile-options-container"
|
<div
|
||||||
[@hideAuthContainer]="hideErrorMessage()"
|
class="container profile-options-container"
|
||||||
(@hideAuthContainer.done)="hideAuthContainer($event)">
|
[@hideAuthContainer]="hideErrorMessage()"
|
||||||
|
(@hideAuthContainer.done)="hideAuthContainer($event)"
|
||||||
|
>
|
||||||
<div class="row profile-options-row">
|
<div class="row profile-options-row">
|
||||||
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<app-profile-picture-picker
|
<app-profile-picture-picker
|
||||||
(imageSent)="onProfilePictureSent($event)">
|
(imageSent)="onProfilePictureSent($event)"
|
||||||
|
>
|
||||||
</app-profile-picture-picker>
|
</app-profile-picture-picker>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -26,16 +31,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<button class="delete-btn"
|
<button class="delete-btn" (click)="onDeleteAccount()">
|
||||||
(click)="onDeleteAccount()">
|
|
||||||
Delete Account
|
Delete Account
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</app-popup>
|
</app-popup>
|
||||||
|
|||||||
@@ -3,21 +3,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { MyProfileComponent } from './my-profile.component';
|
import { MyProfileComponent } from './my-profile.component';
|
||||||
|
|
||||||
describe('MyProfileComponent', () => {
|
describe('MyProfileComponent', () => {
|
||||||
let component: MyProfileComponent;
|
let component: MyProfileComponent;
|
||||||
let fixture: ComponentFixture<MyProfileComponent>;
|
let fixture: ComponentFixture<MyProfileComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ MyProfileComponent ]
|
declarations: [MyProfileComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(MyProfileComponent);
|
fixture = TestBed.createComponent(MyProfileComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,18 +1,33 @@
|
|||||||
import {ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
import {
|
||||||
import {AuthService} from "../../../shared/auth/auth.service";
|
ChangeDetectorRef,
|
||||||
import {User} from "../../../shared/model/user/user.model";
|
Component,
|
||||||
import {animate, animateChild, group, query, state, style, transition, trigger} from "@angular/animations";
|
EventEmitter,
|
||||||
import {MatIconRegistry} from "@angular/material/icon";
|
Input,
|
||||||
import {DomSanitizer} from "@angular/platform-browser";
|
OnInit,
|
||||||
import {FormControl, FormGroup, Validators} from "@angular/forms";
|
Output,
|
||||||
import {ValidateNotEmptyValidator} from "../../../shared/validators/validate-not-empty.validator";
|
} from '@angular/core';
|
||||||
import {ValidatePasswordValidator} from "../../../shared/validators/validate-password.validator";
|
import { AuthService } from '../../../shared/auth/auth.service';
|
||||||
import {first, take} from "rxjs";
|
import { User } from '../../../shared/model/user/user.model';
|
||||||
import UserChecker from "../../../shared/model/user/user.checker";
|
import {
|
||||||
import HttpErrorChecker from "../../../shared/model/httpError/httpErrorChecker";
|
animate,
|
||||||
import {HttpError} from "../../../shared/model/httpError/httpError.model";
|
animateChild,
|
||||||
import {faFileUpload} from "@fortawesome/free-solid-svg-icons";
|
group,
|
||||||
|
query,
|
||||||
|
state,
|
||||||
|
style,
|
||||||
|
transition,
|
||||||
|
trigger,
|
||||||
|
} from '@angular/animations';
|
||||||
|
import { MatIconRegistry } from '@angular/material/icon';
|
||||||
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
|
import { ValidateNotEmptyValidator } from '../../../shared/validators/validate-not-empty.validator';
|
||||||
|
import { ValidatePasswordValidator } from '../../../shared/validators/validate-password.validator';
|
||||||
|
import { first, take } from 'rxjs';
|
||||||
|
import UserChecker from '../../../shared/model/user/user.checker';
|
||||||
|
import HttpErrorChecker from '../../../shared/model/httpError/httpErrorChecker';
|
||||||
|
import { HttpError } from '../../../shared/model/httpError/httpError.model';
|
||||||
|
import { faFileUpload } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-my-profile',
|
selector: 'app-my-profile',
|
||||||
@@ -20,81 +35,69 @@ import {faFileUpload} from "@fortawesome/free-solid-svg-icons";
|
|||||||
styleUrls: ['./my-profile.component.css'],
|
styleUrls: ['./my-profile.component.css'],
|
||||||
animations: [
|
animations: [
|
||||||
trigger('resizeContainerForErrorMessage', [
|
trigger('resizeContainerForErrorMessage', [
|
||||||
state('hide',
|
state(
|
||||||
|
'hide',
|
||||||
style({
|
style({
|
||||||
height: '100px',
|
height: '100px',
|
||||||
width: '320px',
|
width: '320px',
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
transition(
|
transition(
|
||||||
'show => hide',
|
'show => hide',
|
||||||
group([
|
group([
|
||||||
query(
|
query('@*', animateChild(), { optional: true }),
|
||||||
"@*",
|
animate('1s ease'),
|
||||||
animateChild(),
|
]),
|
||||||
{ optional: true }
|
),
|
||||||
),
|
|
||||||
animate('1s ease')
|
|
||||||
])
|
|
||||||
)
|
|
||||||
]),
|
]),
|
||||||
trigger('showErrorMessage', [
|
trigger('showErrorMessage', [
|
||||||
state('show',
|
state(
|
||||||
|
'show',
|
||||||
style({
|
style({
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
height: '100px',
|
height: '100px',
|
||||||
width: '320px',
|
width: '320px',
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
state('hide',
|
state(
|
||||||
|
'hide',
|
||||||
style({
|
style({
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
height: '0px',
|
height: '0px',
|
||||||
width: '0px',
|
width: '0px',
|
||||||
})
|
}),
|
||||||
),
|
|
||||||
transition(
|
|
||||||
'* => show',
|
|
||||||
animate(
|
|
||||||
'500ms ease-in'
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
transition('* => show', animate('500ms ease-in')),
|
||||||
]),
|
]),
|
||||||
trigger('hideAuthContainer', [
|
trigger('hideAuthContainer', [
|
||||||
state('hide',
|
state(
|
||||||
|
'hide',
|
||||||
style({
|
style({
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
transition(
|
transition(
|
||||||
'show => hide',
|
'show => hide',
|
||||||
group([
|
group([
|
||||||
query(
|
query('@*', animateChild(), { optional: true }),
|
||||||
"@*",
|
animate('250ms ease-out'),
|
||||||
animateChild(),
|
]),
|
||||||
{ optional: true }
|
),
|
||||||
),
|
|
||||||
animate(
|
|
||||||
'250ms ease-out'
|
|
||||||
)
|
|
||||||
])
|
|
||||||
)
|
|
||||||
]),
|
]),
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class MyProfileComponent implements OnInit {
|
export class MyProfileComponent implements OnInit {
|
||||||
|
@Input()
|
||||||
|
state: boolean = false;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
state: boolean = false;
|
user!: User | null;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
user!: User | null;
|
ignoreClickOutside!: HTMLDivElement[];
|
||||||
|
|
||||||
@Input()
|
|
||||||
ignoreClickOutside!: HTMLDivElement[];
|
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
stateChange = new EventEmitter<boolean>();
|
stateChange = new EventEmitter<boolean>();
|
||||||
|
|
||||||
alterForm!: FormGroup;
|
alterForm!: FormGroup;
|
||||||
|
|
||||||
@@ -102,15 +105,20 @@ export class MyProfileComponent implements OnInit {
|
|||||||
|
|
||||||
isShowErrorMessage = false;
|
isShowErrorMessage = false;
|
||||||
|
|
||||||
_fileIcon = faFileUpload
|
_fileIcon = faFileUpload;
|
||||||
|
|
||||||
constructor(private authService: AuthService) {
|
constructor(private authService: AuthService) {}
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.alterForm = new FormGroup({
|
this.alterForm = new FormGroup({
|
||||||
'username': new FormControl(null, [Validators.required, ValidateNotEmptyValidator]),
|
username: new FormControl(null, [
|
||||||
'password': new FormControl(null, [Validators.required, ValidatePasswordValidator])
|
Validators.required,
|
||||||
|
ValidateNotEmptyValidator,
|
||||||
|
]),
|
||||||
|
password: new FormControl(null, [
|
||||||
|
Validators.required,
|
||||||
|
ValidatePasswordValidator,
|
||||||
|
]),
|
||||||
});
|
});
|
||||||
this.errorMessage = null;
|
this.errorMessage = null;
|
||||||
}
|
}
|
||||||
@@ -121,30 +129,30 @@ export class MyProfileComponent implements OnInit {
|
|||||||
|
|
||||||
showErrorMessage(): string {
|
showErrorMessage(): string {
|
||||||
if (this.isShowErrorMessage) {
|
if (this.isShowErrorMessage) {
|
||||||
return "show";
|
return 'show';
|
||||||
}
|
}
|
||||||
return "hide";
|
return 'hide';
|
||||||
}
|
}
|
||||||
|
|
||||||
hideErrorMessage(): string {
|
hideErrorMessage(): string {
|
||||||
if (!!this.errorMessage) {
|
if (!!this.errorMessage) {
|
||||||
return "hide";
|
return 'hide';
|
||||||
}
|
}
|
||||||
return "show";
|
return 'show';
|
||||||
}
|
}
|
||||||
|
|
||||||
onDeleteAccount() {
|
onDeleteAccount() {
|
||||||
this.authService.deleteAccount().subscribe({
|
this.authService.deleteAccount().subscribe({
|
||||||
next: (response: any) => {
|
next: (response: any) => {
|
||||||
this.authService.logout();
|
this.authService.logout();
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
this.closePopup();
|
this.closePopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
hideAuthContainer(event: any) {
|
hideAuthContainer(event: any) {
|
||||||
if (event.toState === "hide") {
|
if (event.toState === 'hide') {
|
||||||
event.element.style.display = "none";
|
event.element.style.display = 'none';
|
||||||
this.isShowErrorMessage = true;
|
this.isShowErrorMessage = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -158,5 +166,4 @@ export class MyProfileComponent implements OnInit {
|
|||||||
private closePopup() {
|
private closePopup() {
|
||||||
this.onStateChange(false);
|
this.onStateChange(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,27 @@
|
|||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<div class="custom-file">
|
<div class="custom-file">
|
||||||
<input type="file"
|
<input
|
||||||
class="custom-file-input"
|
type="file"
|
||||||
id="inputProfilePicture"
|
class="custom-file-input"
|
||||||
aria-describedby="inputProfilePicture"
|
id="inputProfilePicture"
|
||||||
(change)="handleFileInput($event)">
|
aria-describedby="inputProfilePicture"
|
||||||
<label class="custom-file-label"
|
(change)="handleFileInput($event)"
|
||||||
for="inputProfilePicture">
|
/>
|
||||||
{{isProfilePictureSelected ? getFileName() : 'Profile Picture'}}
|
<label class="custom-file-label" for="inputProfilePicture">
|
||||||
|
{{
|
||||||
|
isProfilePictureSelected ? getFileName() : "Profile Picture"
|
||||||
|
}}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button class="btn btn-outline-secondary"
|
<button
|
||||||
[disabled]="!isProfilePictureSelected"
|
class="btn btn-outline-secondary"
|
||||||
(click)="uploadProfilePicture()">Upload</button>
|
[disabled]="!isProfilePictureSelected"
|
||||||
|
(click)="uploadProfilePicture()"
|
||||||
|
>
|
||||||
|
Upload
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,21 +3,20 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|||||||
import { ProfilePicturePickerComponent } from './profile-picture-picker.component';
|
import { ProfilePicturePickerComponent } from './profile-picture-picker.component';
|
||||||
|
|
||||||
describe('ProfilePicturePickerComponent', () => {
|
describe('ProfilePicturePickerComponent', () => {
|
||||||
let component: ProfilePicturePickerComponent;
|
let component: ProfilePicturePickerComponent;
|
||||||
let fixture: ComponentFixture<ProfilePicturePickerComponent>;
|
let fixture: ComponentFixture<ProfilePicturePickerComponent>;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ ProfilePicturePickerComponent ]
|
declarations: [ProfilePicturePickerComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ProfilePicturePickerComponent);
|
fixture = TestBed.createComponent(ProfilePicturePickerComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
import {Component, EventEmitter, Output} from '@angular/core';
|
import { Component, EventEmitter, Output } from '@angular/core';
|
||||||
import {AuthService} from "../../../../shared/auth/auth.service";
|
import { AuthService } from '../../../../shared/auth/auth.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-profile-picture-picker',
|
selector: 'app-profile-picture-picker',
|
||||||
templateUrl: './profile-picture-picker.component.html',
|
templateUrl: './profile-picture-picker.component.html',
|
||||||
styleUrls: ['./profile-picture-picker.component.css']
|
styleUrls: ['./profile-picture-picker.component.css'],
|
||||||
})
|
})
|
||||||
export class ProfilePicturePickerComponent {
|
export class ProfilePicturePickerComponent {
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
imageSent = new EventEmitter<boolean>();
|
imageSent = new EventEmitter<boolean>();
|
||||||
|
|
||||||
private profilePicture!: File;
|
private profilePicture!: File;
|
||||||
|
|
||||||
constructor(private authService: AuthService) { }
|
constructor(private authService: AuthService) {}
|
||||||
|
|
||||||
handleFileInput(event: Event) {
|
handleFileInput(event: Event) {
|
||||||
const element = event.currentTarget as HTMLInputElement;
|
const element = event.currentTarget as HTMLInputElement;
|
||||||
@@ -35,5 +34,4 @@ export class ProfilePicturePickerComponent {
|
|||||||
get isProfilePictureSelected(): boolean {
|
get isProfilePictureSelected(): boolean {
|
||||||
return !!this.profilePicture;
|
return !!this.profilePicture;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.auth-body .btn {
|
.auth-body .btn {
|
||||||
background-color: #D8291C !important;
|
background-color: #d8291c !important;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
border-bottom: 2px solid #7676769b;
|
border-bottom: 2px solid #7676769b;
|
||||||
}
|
}
|
||||||
.input-div:after {
|
.input-div:after {
|
||||||
content: '';
|
content: "";
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
@@ -84,11 +84,12 @@
|
|||||||
.input-div:hover:after,
|
.input-div:hover:after,
|
||||||
.input-div:has(input.form-control:focus):after {
|
.input-div:has(input.form-control:focus):after {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
transition: .4s;
|
transition: 0.4s;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-div > .form-control, .input-div > .form-control:focus {
|
.input-div > .form-control,
|
||||||
|
.input-div > .form-control:focus {
|
||||||
border: none;
|
border: none;
|
||||||
border-color: inherit;
|
border-color: inherit;
|
||||||
-webkit-box-shadow: none;
|
-webkit-box-shadow: none;
|
||||||
@@ -101,7 +102,7 @@
|
|||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
color: #767676;
|
color: #767676;
|
||||||
}
|
}
|
||||||
.input-div >.form-control:-webkit-autofill {
|
.input-div > .form-control:-webkit-autofill {
|
||||||
-webkit-text-fill-color: #767676;
|
-webkit-text-fill-color: #767676;
|
||||||
box-shadow: 0 0 0px 1000px #ffffff inset;
|
box-shadow: 0 0 0px 1000px #ffffff inset;
|
||||||
-webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
|
-webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
|
||||||
@@ -111,17 +112,16 @@
|
|||||||
.input-div:hover > .form-control::placeholder,
|
.input-div:hover > .form-control::placeholder,
|
||||||
.input-div:hover > .input-div-icon,
|
.input-div:hover > .input-div-icon,
|
||||||
.input-div:has(input.form-control:focus) > .input-div-icon {
|
.input-div:has(input.form-control:focus) > .input-div-icon {
|
||||||
color: #D8291C;
|
color: #d8291c;
|
||||||
transition: .3s;
|
transition: 0.3s;
|
||||||
}
|
}
|
||||||
.input-div:hover > .form-control::placeholder,
|
.input-div:hover > .form-control::placeholder,
|
||||||
.input-div:focus > .form-control::placeholder{
|
.input-div:focus > .form-control::placeholder {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
transition: .3s;
|
transition: 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width:767px) {
|
@media (min-width: 767px) {
|
||||||
|
|
||||||
.authentication-container {
|
.authentication-container {
|
||||||
min-width: 630px;
|
min-width: 630px;
|
||||||
}
|
}
|
||||||
@@ -151,5 +151,4 @@
|
|||||||
border-right: 2px solid #80808076;
|
border-right: 2px solid #80808076;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,60 +1,81 @@
|
|||||||
<app-popup [state]="state"
|
<app-popup
|
||||||
|
[state]="state"
|
||||||
(stateChange)="onStateChange($event)"
|
(stateChange)="onStateChange($event)"
|
||||||
[ignoreClickOutside]="ignoreClickOutside">
|
[ignoreClickOutside]="ignoreClickOutside"
|
||||||
|
>
|
||||||
|
<div
|
||||||
<div class="container m-0 overflow-hidden"
|
class="container m-0 overflow-hidden"
|
||||||
[@resizeContainerForErrorMessage]="hideErrorMessage()">
|
[@resizeContainerForErrorMessage]="hideErrorMessage()"
|
||||||
|
>
|
||||||
<app-error-box [errorMessage]="errorMessage"
|
<app-error-box
|
||||||
[@showErrorMessage]="showErrorMessage()">
|
[errorMessage]="errorMessage"
|
||||||
|
[@showErrorMessage]="showErrorMessage()"
|
||||||
|
>
|
||||||
</app-error-box>
|
</app-error-box>
|
||||||
|
|
||||||
<div class="container authentication-container"
|
<div
|
||||||
[@hideAuthContainer]="hideErrorMessage()"
|
class="container authentication-container"
|
||||||
(@hideAuthContainer.done)="hideAuthContainer($event)">
|
[@hideAuthContainer]="hideErrorMessage()"
|
||||||
|
(@hideAuthContainer.done)="hideAuthContainer($event)"
|
||||||
|
>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 auth-body auth-body-form">
|
<div class="col-lg-6 auth-body auth-body-form">
|
||||||
<form [formGroup]="signupForm" (ngSubmit)="onSignUp()">
|
<form [formGroup]="signupForm" (ngSubmit)="onSignUp()">
|
||||||
<div class="input-div">
|
<div class="input-div">
|
||||||
<fa-icon class="input-div-icon"
|
<fa-icon
|
||||||
[icon]="_fullnameIcon">
|
class="input-div-icon"
|
||||||
|
[icon]="_fullnameIcon"
|
||||||
|
>
|
||||||
</fa-icon>
|
</fa-icon>
|
||||||
<input type="text" id="fullname"
|
<input
|
||||||
|
type="text"
|
||||||
|
id="fullname"
|
||||||
formControlName="fullname"
|
formControlName="fullname"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
placeholder="Full Name">
|
placeholder="Full Name"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-div">
|
<div class="input-div">
|
||||||
<fa-icon class="input-div-icon"
|
<fa-icon class="input-div-icon" [icon]="_emailIcon">
|
||||||
[icon]="_emailIcon">
|
|
||||||
</fa-icon>
|
</fa-icon>
|
||||||
<input type="text" id="email"
|
<input
|
||||||
|
type="text"
|
||||||
|
id="email"
|
||||||
formControlName="email"
|
formControlName="email"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
placeholder="Email">
|
placeholder="Email"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-div">
|
<div class="input-div">
|
||||||
<fa-icon class="input-div-icon"
|
<fa-icon class="input-div-icon" [icon]="_userIcon">
|
||||||
[icon]="_userIcon">
|
|
||||||
</fa-icon>
|
</fa-icon>
|
||||||
<input type="text" id="username"
|
<input
|
||||||
|
type="text"
|
||||||
|
id="username"
|
||||||
formControlName="username"
|
formControlName="username"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
placeholder="Username">
|
placeholder="Username"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-div">
|
<div class="input-div">
|
||||||
<fa-icon class="input-div-icon"
|
<fa-icon
|
||||||
[icon]="_passwordIcon">
|
class="input-div-icon"
|
||||||
|
[icon]="_passwordIcon"
|
||||||
|
>
|
||||||
</fa-icon>
|
</fa-icon>
|
||||||
<input type="password" id="password"
|
<input
|
||||||
|
type="password"
|
||||||
|
id="password"
|
||||||
formControlName="password"
|
formControlName="password"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
placeholder="Password">
|
placeholder="Password"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn"
|
<button
|
||||||
[disabled]="!signupForm.valid"
|
class="btn"
|
||||||
type="submit">
|
[disabled]="!signupForm.valid"
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
SignUp
|
SignUp
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -63,24 +84,30 @@
|
|||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6 auth-body auth-body-links">
|
<div class="col-lg-6 auth-body auth-body-links">
|
||||||
<button mat-button
|
<button
|
||||||
class="oauth-button d-flex justify-content-center align-items-center"
|
mat-button
|
||||||
(click)="onGoogleLogin()">
|
class="oauth-button d-flex justify-content-center align-items-center"
|
||||||
<mat-icon style="width: 50px; height:30px"
|
(click)="onGoogleLogin()"
|
||||||
svgIcon="google-logo"></mat-icon>
|
>
|
||||||
|
<mat-icon
|
||||||
|
style="width: 50px; height: 30px"
|
||||||
|
svgIcon="google-logo"
|
||||||
|
></mat-icon>
|
||||||
Login With Google
|
Login With Google
|
||||||
</button>
|
</button>
|
||||||
<button mat-button
|
<button
|
||||||
class="oauth-button d-flex justify-content-center align-items-center"
|
mat-button
|
||||||
(click)="onGithubLogin()">
|
class="oauth-button d-flex justify-content-center align-items-center"
|
||||||
<mat-icon style="width: 50px; height:30px"
|
(click)="onGithubLogin()"
|
||||||
svgIcon="github-logo"></mat-icon>
|
>
|
||||||
|
<mat-icon
|
||||||
|
style="width: 50px; height: 30px"
|
||||||
|
svgIcon="github-logo"
|
||||||
|
></mat-icon>
|
||||||
Login With Github
|
Login With Github
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</app-popup>
|
</app-popup>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('SignupComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ SignupComponent ]
|
declarations: [SignupComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(SignupComponent);
|
fixture = TestBed.createComponent(SignupComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -2,21 +2,34 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
|||||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { MatIconRegistry } from '@angular/material/icon';
|
import { MatIconRegistry } from '@angular/material/icon';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { faEnvelope, faFingerprint, faLock, faUser } from '@fortawesome/free-solid-svg-icons';
|
import {
|
||||||
|
faEnvelope,
|
||||||
|
faFingerprint,
|
||||||
|
faLock,
|
||||||
|
faUser,
|
||||||
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { AuthService } from 'src/app/shared/auth/auth.service';
|
import { AuthService } from 'src/app/shared/auth/auth.service';
|
||||||
import { HttpError } from 'src/app/shared/model/httpError/httpError.model';
|
import { HttpError } from 'src/app/shared/model/httpError/httpError.model';
|
||||||
import HttpErrorChecker from 'src/app/shared/model/httpError/httpErrorChecker';
|
import HttpErrorChecker from 'src/app/shared/model/httpError/httpErrorChecker';
|
||||||
import UserChecker from 'src/app/shared/model/user/user.checker';
|
import UserChecker from 'src/app/shared/model/user/user.checker';
|
||||||
import { User } from 'src/app/shared/model/user/user.model';
|
import { User } from 'src/app/shared/model/user/user.model';
|
||||||
import {animate, animateChild, group, query, state, style, transition, trigger} from "@angular/animations";
|
import {
|
||||||
import {ValidateEmailValidator} from "../../../shared/validators/validate-email.validator";
|
animate,
|
||||||
import {ValidatePasswordValidator} from "../../../shared/validators/validate-password.validator";
|
animateChild,
|
||||||
import {ValidateNotEmptyValidator} from "../../../shared/validators/validate-not-empty.validator";
|
group,
|
||||||
|
query,
|
||||||
|
state,
|
||||||
|
style,
|
||||||
|
transition,
|
||||||
|
trigger,
|
||||||
|
} from '@angular/animations';
|
||||||
|
import { ValidateEmailValidator } from '../../../shared/validators/validate-email.validator';
|
||||||
|
import { ValidatePasswordValidator } from '../../../shared/validators/validate-password.validator';
|
||||||
|
import { ValidateNotEmptyValidator } from '../../../shared/validators/validate-not-empty.validator';
|
||||||
|
|
||||||
|
const GOOGLE_LOGO_SVG = 'assets/img/providers/google.svg';
|
||||||
const GOOGLE_LOGO_SVG = "assets/img/providers/google.svg";
|
const GITHUB_LOGO_SVG = 'assets/img/providers/github.svg';
|
||||||
const GITHUB_LOGO_SVG = "assets/img/providers/github.svg";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-signup',
|
selector: 'app-signup',
|
||||||
@@ -24,78 +37,66 @@ const GITHUB_LOGO_SVG = "assets/img/providers/github.svg";
|
|||||||
styleUrls: ['./signup.component.css'],
|
styleUrls: ['./signup.component.css'],
|
||||||
animations: [
|
animations: [
|
||||||
trigger('resizeContainerForErrorMessage', [
|
trigger('resizeContainerForErrorMessage', [
|
||||||
state('hide',
|
state(
|
||||||
|
'hide',
|
||||||
style({
|
style({
|
||||||
height: '100px',
|
height: '100px',
|
||||||
width: '320px',
|
width: '320px',
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
transition(
|
transition(
|
||||||
'show => hide',
|
'show => hide',
|
||||||
group([
|
group([
|
||||||
query(
|
query('@*', animateChild(), { optional: true }),
|
||||||
"@*",
|
animate('1s ease'),
|
||||||
animateChild(),
|
]),
|
||||||
{ optional: true }
|
),
|
||||||
),
|
|
||||||
animate('1s ease')
|
|
||||||
])
|
|
||||||
)
|
|
||||||
]),
|
]),
|
||||||
trigger('showErrorMessage', [
|
trigger('showErrorMessage', [
|
||||||
state('show',
|
state(
|
||||||
|
'show',
|
||||||
style({
|
style({
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
height: '100px',
|
height: '100px',
|
||||||
width: '320px',
|
width: '320px',
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
state('hide',
|
state(
|
||||||
|
'hide',
|
||||||
style({
|
style({
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
height: '0px',
|
height: '0px',
|
||||||
width: '0px',
|
width: '0px',
|
||||||
})
|
}),
|
||||||
),
|
|
||||||
transition(
|
|
||||||
'* => show',
|
|
||||||
animate(
|
|
||||||
'500ms ease-in'
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
transition('* => show', animate('500ms ease-in')),
|
||||||
]),
|
]),
|
||||||
trigger('hideAuthContainer', [
|
trigger('hideAuthContainer', [
|
||||||
state('hide',
|
state(
|
||||||
|
'hide',
|
||||||
style({
|
style({
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
})
|
}),
|
||||||
),
|
),
|
||||||
transition(
|
transition(
|
||||||
'show => hide',
|
'show => hide',
|
||||||
group([
|
group([
|
||||||
query(
|
query('@*', animateChild(), { optional: true }),
|
||||||
"@*",
|
animate('250ms ease-out'),
|
||||||
animateChild(),
|
]),
|
||||||
{ optional: true }
|
),
|
||||||
),
|
|
||||||
animate(
|
|
||||||
'250ms ease-out'
|
|
||||||
)
|
|
||||||
])
|
|
||||||
)
|
|
||||||
]),
|
]),
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class SignupComponent implements OnInit {
|
export class SignupComponent implements OnInit {
|
||||||
|
@Input()
|
||||||
|
state: boolean = false;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
state: boolean = false;
|
ignoreClickOutside!: HTMLDivElement[];
|
||||||
|
|
||||||
@Input()
|
|
||||||
ignoreClickOutside!: HTMLDivElement[];
|
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
stateChange = new EventEmitter<boolean>();
|
stateChange = new EventEmitter<boolean>();
|
||||||
|
|
||||||
signupForm!: FormGroup;
|
signupForm!: FormGroup;
|
||||||
|
|
||||||
@@ -113,34 +114,46 @@ export class SignupComponent implements OnInit {
|
|||||||
|
|
||||||
_passwordIcon = faLock;
|
_passwordIcon = faLock;
|
||||||
|
|
||||||
constructor(private authService: AuthService,
|
constructor(
|
||||||
|
private authService: AuthService,
|
||||||
private matIconRegistry: MatIconRegistry,
|
private matIconRegistry: MatIconRegistry,
|
||||||
private domSanitizer: DomSanitizer) {
|
private domSanitizer: DomSanitizer,
|
||||||
|
) {
|
||||||
this.matIconRegistry.addSvgIcon(
|
this.matIconRegistry.addSvgIcon(
|
||||||
"google-logo",
|
'google-logo',
|
||||||
this.domSanitizer.bypassSecurityTrustResourceUrl(GOOGLE_LOGO_SVG)
|
this.domSanitizer.bypassSecurityTrustResourceUrl(GOOGLE_LOGO_SVG),
|
||||||
);
|
);
|
||||||
this.matIconRegistry.addSvgIcon(
|
this.matIconRegistry.addSvgIcon(
|
||||||
"github-logo",
|
'github-logo',
|
||||||
this.domSanitizer.bypassSecurityTrustResourceUrl(GITHUB_LOGO_SVG)
|
this.domSanitizer.bypassSecurityTrustResourceUrl(GITHUB_LOGO_SVG),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.signupForm = new FormGroup({
|
this.signupForm = new FormGroup({
|
||||||
'fullname': new FormControl(null, [Validators.required, ValidateNotEmptyValidator]),
|
fullname: new FormControl(null, [
|
||||||
|
Validators.required,
|
||||||
|
ValidateNotEmptyValidator,
|
||||||
|
]),
|
||||||
// Create a Email Validator
|
// Create a Email Validator
|
||||||
'email': new FormControl(null, [Validators.required, ValidateEmailValidator]),
|
email: new FormControl(null, [
|
||||||
'username': new FormControl(null, [Validators.required, ValidateNotEmptyValidator]),
|
Validators.required,
|
||||||
|
ValidateEmailValidator,
|
||||||
|
]),
|
||||||
|
username: new FormControl(null, [
|
||||||
|
Validators.required,
|
||||||
|
ValidateNotEmptyValidator,
|
||||||
|
]),
|
||||||
// Create a Password Validator
|
// Create a Password Validator
|
||||||
'password': new FormControl(null, [Validators.required, ValidatePasswordValidator])
|
password: new FormControl(null, [
|
||||||
|
Validators.required,
|
||||||
|
ValidatePasswordValidator,
|
||||||
|
]),
|
||||||
});
|
});
|
||||||
this.errorMessage = null;
|
this.errorMessage = null;
|
||||||
this.authSubject = this.authService.authSubject.subscribe(
|
this.authSubject = this.authService.authSubject.subscribe((res) => {
|
||||||
res => {
|
this.validateSignup(res);
|
||||||
this.validateSignup(res);
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onStateChange(state: boolean) {
|
onStateChange(state: boolean) {
|
||||||
@@ -152,8 +165,8 @@ export class SignupComponent implements OnInit {
|
|||||||
name: this.signupForm.controls['fullname'].value,
|
name: this.signupForm.controls['fullname'].value,
|
||||||
email: this.signupForm.controls['email'].value,
|
email: this.signupForm.controls['email'].value,
|
||||||
username: this.signupForm.controls['username'].value,
|
username: this.signupForm.controls['username'].value,
|
||||||
password: this.signupForm.controls['password'].value
|
password: this.signupForm.controls['password'].value,
|
||||||
}
|
};
|
||||||
this.authService.signup(user);
|
this.authService.signup(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,11 +180,11 @@ export class SignupComponent implements OnInit {
|
|||||||
|
|
||||||
private validateSignup(res: User | HttpError | null) {
|
private validateSignup(res: User | HttpError | null) {
|
||||||
if (res && UserChecker.test(res)) {
|
if (res && UserChecker.test(res)) {
|
||||||
this.closePopup()
|
this.closePopup();
|
||||||
} if (HttpErrorChecker.test(res)) {
|
}
|
||||||
|
if (HttpErrorChecker.test(res)) {
|
||||||
this.errorMessage = (<HttpError>res).details;
|
this.errorMessage = (<HttpError>res).details;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private closePopup() {
|
private closePopup() {
|
||||||
@@ -181,24 +194,22 @@ export class SignupComponent implements OnInit {
|
|||||||
|
|
||||||
public showErrorMessage(): string {
|
public showErrorMessage(): string {
|
||||||
if (this.isShowErrorMessage) {
|
if (this.isShowErrorMessage) {
|
||||||
return "show";
|
return 'show';
|
||||||
}
|
}
|
||||||
return "hide";
|
return 'hide';
|
||||||
}
|
}
|
||||||
|
|
||||||
public hideErrorMessage(): string {
|
public hideErrorMessage(): string {
|
||||||
if (!!this.errorMessage) {
|
if (!!this.errorMessage) {
|
||||||
return "hide";
|
return 'hide';
|
||||||
}
|
}
|
||||||
return "show";
|
return 'show';
|
||||||
}
|
}
|
||||||
|
|
||||||
hideAuthContainer(event: any) {
|
hideAuthContainer(event: any) {
|
||||||
if (event.toState === "hide") {
|
if (event.toState === 'hide') {
|
||||||
event.element.style.display = "none";
|
event.element.style.display = 'none';
|
||||||
this.isShowErrorMessage = true;
|
this.isShowErrorMessage = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
top: 10vh;
|
top: 10vh;
|
||||||
right: 0;
|
right: 0;
|
||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<div class="slider"
|
<div
|
||||||
appClickedOutside
|
class="slider"
|
||||||
[ignoreElementList]="ignoreClickOutside"
|
appClickedOutside
|
||||||
[clickOutsideStopWatching]="clickOutsideStopWatching"
|
[ignoreElementList]="ignoreClickOutside"
|
||||||
(clickOutside)="closeNavSlider()"
|
[clickOutsideStopWatching]="clickOutsideStopWatching"
|
||||||
[@slideState]="sliderStatus">
|
(clickOutside)="closeNavSlider()"
|
||||||
|
[@slideState]="sliderStatus"
|
||||||
|
>
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('HeaderSliderComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ HeaderSliderComponent ]
|
declarations: [HeaderSliderComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(HeaderSliderComponent);
|
fixture = TestBed.createComponent(HeaderSliderComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,70 +1,73 @@
|
|||||||
import { animate, animateChild, group, query, state, style, transition, trigger } from '@angular/animations';
|
import {
|
||||||
|
animate,
|
||||||
|
animateChild,
|
||||||
|
group,
|
||||||
|
query,
|
||||||
|
state,
|
||||||
|
style,
|
||||||
|
transition,
|
||||||
|
trigger,
|
||||||
|
} from '@angular/animations';
|
||||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header-slider',
|
selector: 'app-header-slider',
|
||||||
templateUrl: './header-slider.component.html',
|
templateUrl: './header-slider.component.html',
|
||||||
styleUrls: ['./header-slider.component.css'],
|
styleUrls: ['./header-slider.component.css'],
|
||||||
animations:[
|
animations: [
|
||||||
trigger('slideState', [
|
trigger('slideState', [
|
||||||
state('hide', style({
|
state(
|
||||||
transform: 'translateX(100%)'
|
'hide',
|
||||||
})),
|
style({
|
||||||
state('show', style({
|
transform: 'translateX(100%)',
|
||||||
transform: 'translateX(0%)'
|
}),
|
||||||
})),
|
),
|
||||||
transition(
|
state(
|
||||||
'hide => show', [
|
'show',
|
||||||
group([
|
style({
|
||||||
query(
|
transform: 'translateX(0%)',
|
||||||
"@*",
|
}),
|
||||||
animateChild(),
|
),
|
||||||
{ optional: true }
|
transition('hide => show', [
|
||||||
),
|
group([
|
||||||
animate('600ms ease-in')
|
query('@*', animateChild(), { optional: true }),
|
||||||
])
|
animate('600ms ease-in'),
|
||||||
]),
|
]),
|
||||||
transition(
|
]),
|
||||||
'show => hide', [
|
transition('show => hide', [
|
||||||
group([
|
group([
|
||||||
query(
|
query('@*', animateChild(), { optional: true }),
|
||||||
"@*",
|
animate('500ms ease-out'),
|
||||||
animateChild(),
|
]),
|
||||||
{ optional: true }
|
]),
|
||||||
),
|
]),
|
||||||
animate('500ms ease-out')
|
],
|
||||||
])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class HeaderSliderComponent {
|
export class HeaderSliderComponent {
|
||||||
|
@Input()
|
||||||
|
ignoreClickOutside!: HTMLDivElement[];
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
ignoreClickOutside!: HTMLDivElement[];
|
clickOutsideStopWatching: boolean = false;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
clickOutsideStopWatching: boolean = false;
|
state: boolean = false;
|
||||||
|
|
||||||
@Input()
|
|
||||||
state: boolean = false;
|
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
stateChange = new EventEmitter<boolean>();
|
stateChange = new EventEmitter<boolean>();
|
||||||
|
|
||||||
constructor() { }
|
constructor() {}
|
||||||
|
|
||||||
get sliderStatus() {
|
get sliderStatus() {
|
||||||
return this.state ? 'show' : 'hide';
|
return this.state ? 'show' : 'hide';
|
||||||
}
|
}
|
||||||
|
|
||||||
public closeNavSlider(): void {
|
public closeNavSlider(): void {
|
||||||
this.state = false;
|
this.state = false;
|
||||||
this.changeState();
|
this.changeState();
|
||||||
}
|
}
|
||||||
|
|
||||||
public changeState() {
|
public changeState() {
|
||||||
this.stateChange.emit(this.state)
|
this.stateChange.emit(this.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,15 +29,14 @@
|
|||||||
|
|
||||||
.nav-links li a {
|
.nav-links li a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.nav-links li a:hover {
|
.nav-links li a:hover {
|
||||||
opacity: .8;
|
opacity: 0.8;
|
||||||
color: #f44336;
|
color: #f44336;
|
||||||
transition: 0.5s;
|
transition: 0.5s;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,18 @@
|
|||||||
<div class="links-container">
|
<div class="links-container">
|
||||||
<div class="nav-links">
|
<div class="nav-links">
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let nav of navLink; let i=index"[@animateSliderItem]="{ value: itemStatus, params: { fadeInTime: .6 + i/20 , fadeOutTime: .6 - i/10 } }">
|
<li
|
||||||
|
*ngFor="let nav of navLink; let i = index"
|
||||||
|
[@animateSliderItem]="{
|
||||||
|
value: itemStatus,
|
||||||
|
params: {
|
||||||
|
fadeInTime: 0.6 + i / 20,
|
||||||
|
fadeOutTime: 0.6 - i / 10
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
>
|
||||||
<a [routerLink]="nav.link">
|
<a [routerLink]="nav.link">
|
||||||
{{nav.page}}
|
{{ nav.page }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -11,18 +20,32 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="profile-container">
|
<div class="profile-container">
|
||||||
<div class="profile"
|
<div
|
||||||
[@animateSliderItem]="{ value: itemStatus, params: { fadeInTime: .6 + (navLink.length+1)/20 , fadeOutTime: .6 - (navLink.length+1)/10 } }"
|
class="profile"
|
||||||
#profile>
|
[@animateSliderItem]="{
|
||||||
<div class="profile-btn"
|
value: itemStatus,
|
||||||
(click)="onProfileButtonClicked()">
|
params: {
|
||||||
<fa-icon *ngIf="!loggedUser || !(loggedUser.profilePictureUrl)"
|
fadeInTime: 0.6 + (navLink.length + 1) / 20,
|
||||||
class="fas fa-user" [icon]="userIcon"></fa-icon>
|
fadeOutTime: 0.6 - (navLink.length + 1) / 10
|
||||||
<img *ngIf="!!loggedUser && !!(loggedUser.profilePictureUrl)"
|
}
|
||||||
class="profile-picture"
|
}"
|
||||||
[ngSrc]="loggedUser.profilePictureUrl"
|
#profile
|
||||||
width="50" height="50"
|
>
|
||||||
alt="Profile Picture" priority/>
|
<div class="profile-btn" (click)="onProfileButtonClicked()">
|
||||||
|
<fa-icon
|
||||||
|
*ngIf="!loggedUser || !loggedUser.profilePictureUrl"
|
||||||
|
class="fas fa-user"
|
||||||
|
[icon]="userIcon"
|
||||||
|
></fa-icon>
|
||||||
|
<img
|
||||||
|
*ngIf="!!loggedUser && !!loggedUser.profilePictureUrl"
|
||||||
|
class="profile-picture"
|
||||||
|
[ngSrc]="loggedUser.profilePictureUrl"
|
||||||
|
width="50"
|
||||||
|
height="50"
|
||||||
|
alt="Profile Picture"
|
||||||
|
priority
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('NavSliderComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ NavSliderComponent ]
|
declarations: [NavSliderComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(NavSliderComponent);
|
fixture = TestBed.createComponent(NavSliderComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,33 +1,41 @@
|
|||||||
import {Component, EventEmitter, OnDestroy, OnInit, Output} from '@angular/core';
|
import {
|
||||||
|
Component,
|
||||||
|
EventEmitter,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
Output,
|
||||||
|
} from '@angular/core';
|
||||||
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { SliderItemComponent } from 'src/app/shared/components/slider-item/slider-item.component';
|
import { SliderItemComponent } from 'src/app/shared/components/slider-item/slider-item.component';
|
||||||
import UserChecker from "../../../shared/model/user/user.checker";
|
import UserChecker from '../../../shared/model/user/user.checker';
|
||||||
import {User} from "../../../shared/model/user/user.model";
|
import { User } from '../../../shared/model/user/user.model';
|
||||||
import {AuthService} from "../../../shared/auth/auth.service";
|
import { AuthService } from '../../../shared/auth/auth.service';
|
||||||
import {Subscription} from "rxjs";
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-nav-slider',
|
selector: 'app-nav-slider',
|
||||||
templateUrl: './nav-slider.component.html',
|
templateUrl: './nav-slider.component.html',
|
||||||
styleUrls: ['./nav-slider.component.css']
|
styleUrls: ['./nav-slider.component.css'],
|
||||||
})
|
})
|
||||||
export class NavSliderComponent extends SliderItemComponent implements OnInit, OnDestroy {
|
export class NavSliderComponent
|
||||||
|
extends SliderItemComponent
|
||||||
|
implements OnInit, OnDestroy
|
||||||
|
{
|
||||||
userIcon = faUser;
|
userIcon = faUser;
|
||||||
|
|
||||||
navLink = [
|
navLink = [
|
||||||
{ page: "Home", link: "/home" },
|
{ page: 'Home', link: '/home' },
|
||||||
{ page: "Work", link: "/home" },
|
{ page: 'Work', link: '/home' },
|
||||||
{ page: "Contact", link: "/home" },
|
{ page: 'Contact', link: '/home' },
|
||||||
{ page: "About", link: "/home" }
|
{ page: 'About', link: '/home' },
|
||||||
]
|
];
|
||||||
|
|
||||||
loggedUser!: User | null;
|
loggedUser!: User | null;
|
||||||
|
|
||||||
private userSubscription!: Subscription;
|
private userSubscription!: Subscription;
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
profileButtonClicked = new EventEmitter();
|
profileButtonClicked = new EventEmitter();
|
||||||
|
|
||||||
constructor(private authService: AuthService) {
|
constructor(private authService: AuthService) {
|
||||||
super();
|
super();
|
||||||
@@ -35,14 +43,14 @@ export class NavSliderComponent extends SliderItemComponent implements OnInit, O
|
|||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.userSubscription = this.authService.authSubject.subscribe(
|
this.userSubscription = this.authService.authSubject.subscribe(
|
||||||
res => {
|
(res) => {
|
||||||
if (res && UserChecker.test(res)) {
|
if (res && UserChecker.test(res)) {
|
||||||
this.loggedUser = <User>res;
|
this.loggedUser = <User>res;
|
||||||
} else {
|
} else {
|
||||||
this.loggedUser = null;
|
this.loggedUser = null;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
@@ -52,5 +60,4 @@ export class NavSliderComponent extends SliderItemComponent implements OnInit, O
|
|||||||
onProfileButtonClicked() {
|
onProfileButtonClicked() {
|
||||||
this.profileButtonClicked.emit();
|
this.profileButtonClicked.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,17 +28,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.user-options li a {
|
.user-options li a {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.user-options li a:hover {
|
.user-options li a:hover {
|
||||||
color: #f44336;
|
color: #f44336;
|
||||||
transition: 0.5s;
|
transition: 0.5s;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: .8;
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,23 @@
|
|||||||
<div class="user-container">
|
<div class="user-container">
|
||||||
<div class="user-options">
|
<div class="user-options">
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let options of (user ? userOptions : userlessOptions); let i=index"[@animateSliderItem]="{ value: itemStatus, params: { fadeInTime: .6 + i/10 , fadeOutTime: .6 - i/10 } }">
|
<li
|
||||||
|
*ngFor="
|
||||||
|
let options of user ? userOptions : userlessOptions;
|
||||||
|
let i = index
|
||||||
|
"
|
||||||
|
[@animateSliderItem]="{
|
||||||
|
value: itemStatus,
|
||||||
|
params: {
|
||||||
|
fadeInTime: 0.6 + i / 10,
|
||||||
|
fadeOutTime: 0.6 - i / 10
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
>
|
||||||
<a (click)="options.onClick()">
|
<a (click)="options.onClick()">
|
||||||
{{options.name}}
|
{{ options.name }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('UserSliderComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ UserSliderComponent ]
|
declarations: [UserSliderComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(UserSliderComponent);
|
fixture = TestBed.createComponent(UserSliderComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -8,77 +8,75 @@ import { User } from 'src/app/shared/model/user/user.model';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-user-slider',
|
selector: 'app-user-slider',
|
||||||
templateUrl: './user-slider.component.html',
|
templateUrl: './user-slider.component.html',
|
||||||
styleUrls: ['./user-slider.component.css']
|
styleUrls: ['./user-slider.component.css'],
|
||||||
})
|
})
|
||||||
export class UserSliderComponent extends SliderItemComponent implements OnInit {
|
export class UserSliderComponent extends SliderItemComponent implements OnInit {
|
||||||
|
|
||||||
userlessOptions = [
|
userlessOptions = [
|
||||||
{
|
{
|
||||||
name: "Login",
|
name: 'Login',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.onLoginOptionClicked();
|
this.onLoginOptionClicked();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Signup",
|
name: 'Signup',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.onSignUpOptionClick();
|
this.onSignUpOptionClick();
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
|
|
||||||
userOptions = [
|
userOptions = [
|
||||||
{
|
{
|
||||||
name: "My Profile",
|
name: 'My Profile',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.onMyProfileClicked()
|
this.onMyProfileClicked();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Help",
|
name: 'Help',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.onHelpClicked();
|
this.onHelpClicked();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Logout",
|
name: 'Logout',
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
this.onLogout();
|
this.onLogout();
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
|
|
||||||
user!: User|null;
|
user!: User | null;
|
||||||
|
|
||||||
authSubscription!: Subscription;
|
authSubscription!: Subscription;
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
loginPopupState: EventEmitter<boolean> = new EventEmitter();
|
loginPopupState: EventEmitter<boolean> = new EventEmitter();
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
signupPopupState: EventEmitter<boolean> = new EventEmitter();
|
signupPopupState: EventEmitter<boolean> = new EventEmitter();
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
helpPopupState: EventEmitter<boolean> = new EventEmitter();
|
helpPopupState: EventEmitter<boolean> = new EventEmitter();
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
myProfilePopupState: EventEmitter<boolean> = new EventEmitter();
|
myProfilePopupState: EventEmitter<boolean> = new EventEmitter();
|
||||||
|
|
||||||
constructor(private authService: AuthService) {
|
constructor(private authService: AuthService) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.authSubscription =
|
this.authSubscription = this.authService.authSubject.subscribe(
|
||||||
this.authService.authSubject.subscribe(
|
(res) => {
|
||||||
res => {
|
if (UserChecker.test(res)) {
|
||||||
if (UserChecker.test(res)) {
|
this.user = <User>res;
|
||||||
this.user = <User>res;
|
} else {
|
||||||
} else {
|
this.user = null;
|
||||||
this.user = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoginOptionClicked(): void {
|
onLoginOptionClicked(): void {
|
||||||
@@ -100,5 +98,4 @@ export class UserSliderComponent extends SliderItemComponent implements OnInit {
|
|||||||
onLogout() {
|
onLogout() {
|
||||||
this.authService.logout();
|
this.authService.logout();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,20 +48,20 @@
|
|||||||
height: 5px;
|
height: 5px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-shadow: 0 2px 5px rgba(255, 101, 47, .2);
|
box-shadow: 0 2px 5px rgba(255, 101, 47, 0.2);
|
||||||
transition: all .5s ease-in-out;
|
transition: all 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.burger-menu::before,
|
.burger-menu::before,
|
||||||
.burger-menu::after {
|
.burger-menu::after {
|
||||||
content: '';
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-shadow: 0 2px 5px rgba(255, 101, 47, .2);
|
box-shadow: 0 2px 5px rgba(255, 101, 47, 0.2);
|
||||||
transition: all .5s ease-in-out;
|
transition: all 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.burger-menu::before {
|
.burger-menu::before {
|
||||||
@@ -75,17 +75,17 @@
|
|||||||
.burger-menu.open {
|
.burger-menu.open {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
transition: all .5s ease-in-out;
|
transition: all 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.burger-menu.open::before {
|
.burger-menu.open::before {
|
||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
transition: all .5s ease-in-out;
|
transition: all 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.burger-menu.open::after {
|
.burger-menu.open::after {
|
||||||
transform: rotate(-45deg);
|
transform: rotate(-45deg);
|
||||||
transition: all .5s ease-in-out;
|
transition: all 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile {
|
.profile {
|
||||||
@@ -99,7 +99,6 @@ app-header-slider {
|
|||||||
/* ====================== COMPUTER MEDIA FORMAT ======================== */
|
/* ====================== COMPUTER MEDIA FORMAT ======================== */
|
||||||
|
|
||||||
@media only screen and (min-width: 712px) {
|
@media only screen and (min-width: 712px) {
|
||||||
|
|
||||||
.nav-links {
|
.nav-links {
|
||||||
all: unset;
|
all: unset;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
@@ -121,7 +120,7 @@ app-header-slider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.link-container li a {
|
.link-container li a {
|
||||||
font-family: 'Montserrat', sans-serif;
|
font-family: "Montserrat", sans-serif;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
letter-spacing: 3px;
|
letter-spacing: 3px;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
@@ -180,5 +179,4 @@ app-header-slider {
|
|||||||
app-header-slider {
|
app-header-slider {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="main" #header>
|
<div class="main" #header>
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<a routerLink="">
|
<a routerLink="">
|
||||||
<img src="assets/img/logohideyoshi-white.png" alt="">
|
<img src="assets/img/logohideyoshi-white.png" alt="" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-links">
|
<div class="nav-links">
|
||||||
@@ -15,14 +15,25 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="profile" #profileDropdown>
|
<div class="profile" #profileDropdown>
|
||||||
<div class="profile-btn" (click)="toogleProfileDropdown()" #profileBtn>
|
<div
|
||||||
<fa-icon *ngIf="!loggedUser || !(loggedUser.profilePictureUrl)"
|
class="profile-btn"
|
||||||
class="fas fa-user" [icon]="userIcon"></fa-icon>
|
(click)="toogleProfileDropdown()"
|
||||||
<img *ngIf="!!loggedUser && !!(loggedUser.profilePictureUrl)"
|
#profileBtn
|
||||||
class="profile-picture"
|
>
|
||||||
[ngSrc]="loggedUser.profilePictureUrl"
|
<fa-icon
|
||||||
width="50" height="50"
|
*ngIf="!loggedUser || !loggedUser.profilePictureUrl"
|
||||||
alt="Profile Picture" priority/>
|
class="fas fa-user"
|
||||||
|
[icon]="userIcon"
|
||||||
|
></fa-icon>
|
||||||
|
<img
|
||||||
|
*ngIf="!!loggedUser && !!loggedUser.profilePictureUrl"
|
||||||
|
class="profile-picture"
|
||||||
|
[ngSrc]="loggedUser.profilePictureUrl"
|
||||||
|
width="50"
|
||||||
|
height="50"
|
||||||
|
alt="Profile Picture"
|
||||||
|
priority
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-header-dropdown
|
<app-header-dropdown
|
||||||
@@ -33,36 +44,43 @@
|
|||||||
(loginPopupState)="loginPopupStateChange($event)"
|
(loginPopupState)="loginPopupStateChange($event)"
|
||||||
(signupPopupState)="signupPopupStateChange($event)"
|
(signupPopupState)="signupPopupStateChange($event)"
|
||||||
(myProfilePopupState)="myProfilePopupStateChange($event)"
|
(myProfilePopupState)="myProfilePopupStateChange($event)"
|
||||||
(helpPopupState)="helpPopupStateChange($event)">
|
(helpPopupState)="helpPopupStateChange($event)"
|
||||||
|
>
|
||||||
</app-header-dropdown>
|
</app-header-dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="burger-container" (click)="toogleNavSlider()">
|
<div class="burger-container" (click)="toogleNavSlider()">
|
||||||
<div class="burger-menu" [ngClass]="{'open' : navSliderStatus}">
|
<div
|
||||||
</div>
|
class="burger-menu"
|
||||||
|
[ngClass]="{ open: navSliderStatus }"
|
||||||
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div #nav>
|
<div #nav>
|
||||||
<app-header-slider
|
<app-header-slider
|
||||||
[(state)]="navSliderStatus"
|
[(state)]="navSliderStatus"
|
||||||
[clickOutsideStopWatching]="userSliderStatus"
|
[clickOutsideStopWatching]="userSliderStatus"
|
||||||
[ignoreClickOutside]="[header, user]">
|
[ignoreClickOutside]="[header, user]"
|
||||||
|
>
|
||||||
<app-nav-slider
|
<app-nav-slider
|
||||||
[state]="navSliderStatus"
|
[state]="navSliderStatus"
|
||||||
(profileButtonClicked)="profileButtonClicked()">
|
(profileButtonClicked)="profileButtonClicked()"
|
||||||
|
>
|
||||||
</app-nav-slider>
|
</app-nav-slider>
|
||||||
</app-header-slider>
|
</app-header-slider>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div #user>
|
<div #user>
|
||||||
<app-header-slider
|
<app-header-slider
|
||||||
[(state)]="userSliderStatus"
|
[(state)]="userSliderStatus"
|
||||||
[ignoreClickOutside]="[header, nav]">
|
[ignoreClickOutside]="[header, nav]"
|
||||||
|
>
|
||||||
<app-user-slider
|
<app-user-slider
|
||||||
[state]="userSliderStatus"
|
[state]="userSliderStatus"
|
||||||
(loginPopupState)="loginPopupStateChange($event)"
|
(loginPopupState)="loginPopupStateChange($event)"
|
||||||
(signupPopupState)="signupPopupStateChange($event)"
|
(signupPopupState)="signupPopupStateChange($event)"
|
||||||
(myProfilePopupState)="myProfilePopupStateChange($event)"
|
(myProfilePopupState)="myProfilePopupStateChange($event)"
|
||||||
(helpPopupState)="helpPopupStateChange($event)">
|
(helpPopupState)="helpPopupStateChange($event)"
|
||||||
|
>
|
||||||
</app-user-slider>
|
</app-user-slider>
|
||||||
</app-header-slider>
|
</app-header-slider>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('HeaderComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ HeaderComponent ]
|
declarations: [HeaderComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(HeaderComponent);
|
fixture = TestBed.createComponent(HeaderComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,21 +1,28 @@
|
|||||||
import {Component, ComponentRef, ElementRef, OnDestroy, OnInit, ViewChild, ViewContainerRef} from '@angular/core';
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentRef,
|
||||||
|
ElementRef,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit,
|
||||||
|
ViewChild,
|
||||||
|
ViewContainerRef,
|
||||||
|
} from '@angular/core';
|
||||||
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
import { faUser } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { LoginComponent } from './header-popup/login/login.component';
|
import { LoginComponent } from './header-popup/login/login.component';
|
||||||
import { SignupComponent } from './header-popup/signup/signup.component';
|
import { SignupComponent } from './header-popup/signup/signup.component';
|
||||||
import {AuthService} from "../shared/auth/auth.service";
|
import { AuthService } from '../shared/auth/auth.service';
|
||||||
import UserChecker from "../shared/model/user/user.checker";
|
import UserChecker from '../shared/model/user/user.checker';
|
||||||
import {User} from "../shared/model/user/user.model";
|
import { User } from '../shared/model/user/user.model';
|
||||||
import {Subscription} from "rxjs";
|
import { Subscription } from 'rxjs';
|
||||||
import {HelpComponent} from "./header-popup/help/help.component";
|
import { HelpComponent } from './header-popup/help/help.component';
|
||||||
import {MyProfileComponent} from "./header-popup/my-profile/my-profile.component";
|
import { MyProfileComponent } from './header-popup/my-profile/my-profile.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-header',
|
selector: 'app-header',
|
||||||
templateUrl: './header.component.html',
|
templateUrl: './header.component.html',
|
||||||
styleUrls: ['./header.component.css']
|
styleUrls: ['./header.component.css'],
|
||||||
})
|
})
|
||||||
export class HeaderComponent implements OnInit, OnDestroy {
|
export class HeaderComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
userIcon = faUser;
|
userIcon = faUser;
|
||||||
|
|
||||||
profileDropdownState: boolean = false;
|
profileDropdownState: boolean = false;
|
||||||
@@ -26,13 +33,13 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||||||
userSliderStatus: boolean = false;
|
userSliderStatus: boolean = false;
|
||||||
|
|
||||||
@ViewChild('profileBtn')
|
@ViewChild('profileBtn')
|
||||||
profileBtnElementRef!: ElementRef;
|
profileBtnElementRef!: ElementRef;
|
||||||
|
|
||||||
@ViewChild('profileDropdown')
|
@ViewChild('profileDropdown')
|
||||||
profileDropdownElementRef!: ElementRef;
|
profileDropdownElementRef!: ElementRef;
|
||||||
|
|
||||||
@ViewChild('user')
|
@ViewChild('user')
|
||||||
userElementRef!: ElementRef;
|
userElementRef!: ElementRef;
|
||||||
|
|
||||||
loggedUser!: User | null;
|
loggedUser!: User | null;
|
||||||
|
|
||||||
@@ -46,25 +53,27 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
private helpComponent!: ComponentRef<HelpComponent>;
|
private helpComponent!: ComponentRef<HelpComponent>;
|
||||||
|
|
||||||
constructor(private viewContainerRef: ViewContainerRef, private authService: AuthService) { }
|
constructor(
|
||||||
|
private viewContainerRef: ViewContainerRef,
|
||||||
|
private authService: AuthService,
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.userSubscription = this.authService.authSubject.subscribe(
|
this.userSubscription = this.authService.authSubject.subscribe(
|
||||||
res => {
|
(res) => {
|
||||||
if (res && UserChecker.test(res)) {
|
if (res && UserChecker.test(res)) {
|
||||||
this.loggedUser = <User>res;
|
this.loggedUser = <User>res;
|
||||||
} else {
|
} else {
|
||||||
this.loggedUser = null;
|
this.loggedUser = null;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.userSubscription.unsubscribe();
|
this.userSubscription.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public toogleProfileDropdown(): void {
|
public toogleProfileDropdown(): void {
|
||||||
this.profileDropdownState = !this.profileDropdownState;
|
this.profileDropdownState = !this.profileDropdownState;
|
||||||
}
|
}
|
||||||
@@ -121,22 +130,21 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createLoginPopup(): void {
|
private createLoginPopup(): void {
|
||||||
this.loginComponent = this.viewContainerRef.createComponent(LoginComponent);
|
this.loginComponent =
|
||||||
|
this.viewContainerRef.createComponent(LoginComponent);
|
||||||
this.loginComponent.instance.state = true;
|
this.loginComponent.instance.state = true;
|
||||||
|
|
||||||
this.loginComponent.instance.ignoreClickOutside = [
|
this.loginComponent.instance.ignoreClickOutside = [
|
||||||
this.profileBtnElementRef,
|
this.profileBtnElementRef,
|
||||||
this.profileDropdownElementRef,
|
this.profileDropdownElementRef,
|
||||||
this.userElementRef
|
this.userElementRef,
|
||||||
].map(element => element.nativeElement);
|
].map((element) => element.nativeElement);
|
||||||
|
|
||||||
this.loginComponent.instance.stateChange.subscribe(
|
this.loginComponent.instance.stateChange.subscribe((state) => {
|
||||||
state => {
|
if (!state) {
|
||||||
if (!state) {
|
this.closeLoginPopup();
|
||||||
this.closeLoginPopup()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
|
|
||||||
this.navSliderStatus = false;
|
this.navSliderStatus = false;
|
||||||
this.userSliderStatus = false;
|
this.userSliderStatus = false;
|
||||||
@@ -144,22 +152,21 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createSignupPopup() {
|
private createSignupPopup() {
|
||||||
this.signupComponent = this.viewContainerRef.createComponent(SignupComponent);
|
this.signupComponent =
|
||||||
|
this.viewContainerRef.createComponent(SignupComponent);
|
||||||
this.signupComponent.instance.state = true;
|
this.signupComponent.instance.state = true;
|
||||||
|
|
||||||
this.signupComponent.instance.ignoreClickOutside = [
|
this.signupComponent.instance.ignoreClickOutside = [
|
||||||
this.profileBtnElementRef,
|
this.profileBtnElementRef,
|
||||||
this.profileDropdownElementRef,
|
this.profileDropdownElementRef,
|
||||||
this.userElementRef
|
this.userElementRef,
|
||||||
].map(element => element.nativeElement);
|
].map((element) => element.nativeElement);
|
||||||
|
|
||||||
this.signupComponent.instance.stateChange.subscribe(
|
this.signupComponent.instance.stateChange.subscribe((state) => {
|
||||||
state => {
|
if (!state) {
|
||||||
if (!state) {
|
this.closeSignupPopup();
|
||||||
this.closeSignupPopup()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
|
|
||||||
this.navSliderStatus = false;
|
this.navSliderStatus = false;
|
||||||
this.userSliderStatus = false;
|
this.userSliderStatus = false;
|
||||||
@@ -167,17 +174,16 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createMyProfilePopup() {
|
private createMyProfilePopup() {
|
||||||
this.myProfileComponent = this.viewContainerRef.createComponent(MyProfileComponent);
|
this.myProfileComponent =
|
||||||
|
this.viewContainerRef.createComponent(MyProfileComponent);
|
||||||
this.myProfileComponent.instance.state = true;
|
this.myProfileComponent.instance.state = true;
|
||||||
this.myProfileComponent.instance.user = this.loggedUser;
|
this.myProfileComponent.instance.user = this.loggedUser;
|
||||||
|
|
||||||
this.myProfileComponent.instance.stateChange.subscribe(
|
this.myProfileComponent.instance.stateChange.subscribe((state) => {
|
||||||
state => {
|
if (!state) {
|
||||||
if (!state) {
|
this.closeMyProfilePopup();
|
||||||
this.closeMyProfilePopup()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
|
|
||||||
this.navSliderStatus = false;
|
this.navSliderStatus = false;
|
||||||
this.userSliderStatus = false;
|
this.userSliderStatus = false;
|
||||||
@@ -185,16 +191,15 @@ export class HeaderComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createHelpPopup() {
|
private createHelpPopup() {
|
||||||
this.helpComponent = this.viewContainerRef.createComponent(HelpComponent);
|
this.helpComponent =
|
||||||
|
this.viewContainerRef.createComponent(HelpComponent);
|
||||||
this.helpComponent.instance.state = true;
|
this.helpComponent.instance.state = true;
|
||||||
|
|
||||||
this.helpComponent.instance.stateChange.subscribe(
|
this.helpComponent.instance.stateChange.subscribe((state) => {
|
||||||
state => {
|
if (!state) {
|
||||||
if (!state) {
|
this.closeHelpPopup();
|
||||||
this.closeHelpPopup()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
|
|
||||||
this.navSliderStatus = false;
|
this.navSliderStatus = false;
|
||||||
this.userSliderStatus = false;
|
this.userSliderStatus = false;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import {CommonModule, NgOptimizedImage} from '@angular/common';
|
import { CommonModule, NgOptimizedImage } from '@angular/common';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
import { HeaderComponent } from './header.component';
|
import { HeaderComponent } from './header.component';
|
||||||
import { HeaderSliderComponent } from './header-slider/header-slider.component';
|
import { HeaderSliderComponent } from './header-slider/header-slider.component';
|
||||||
@@ -14,14 +14,12 @@ import { LoginComponent } from './header-popup/login/login.component';
|
|||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { SignupComponent } from './header-popup/signup/signup.component';
|
import { SignupComponent } from './header-popup/signup/signup.component';
|
||||||
import { CallbackComponent } from './header-popup/callback/callback.component';
|
import { CallbackComponent } from './header-popup/callback/callback.component';
|
||||||
import {MatIconModule} from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { ErrorBoxComponent } from './header-popup/error-box/error-box.component';
|
import { ErrorBoxComponent } from './header-popup/error-box/error-box.component';
|
||||||
import { HelpComponent } from './header-popup/help/help.component';
|
import { HelpComponent } from './header-popup/help/help.component';
|
||||||
import { MyProfileComponent } from './header-popup/my-profile/my-profile.component';
|
import { MyProfileComponent } from './header-popup/my-profile/my-profile.component';
|
||||||
import { ProfilePicturePickerComponent } from './header-popup/my-profile/profile-picture-picker/profile-picture-picker.component';
|
import { ProfilePicturePickerComponent } from './header-popup/my-profile/profile-picture-picker/profile-picture-picker.component';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
HeaderComponent,
|
HeaderComponent,
|
||||||
@@ -46,12 +44,13 @@ import { ProfilePicturePickerComponent } from './header-popup/my-profile/profile
|
|||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
SharedModule,
|
SharedModule,
|
||||||
NgOptimizedImage
|
NgOptimizedImage,
|
||||||
], exports: [
|
],
|
||||||
|
exports: [
|
||||||
HeaderComponent,
|
HeaderComponent,
|
||||||
HeaderSliderComponent,
|
HeaderSliderComponent,
|
||||||
NavSliderComponent,
|
NavSliderComponent,
|
||||||
UserSliderComponent
|
UserSliderComponent,
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class HeaderModule { }
|
export class HeaderModule {}
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('HomeComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ HomeComponent ]
|
declarations: [HomeComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(HomeComponent);
|
fixture = TestBed.createComponent(HomeComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -3,10 +3,8 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-home',
|
selector: 'app-home',
|
||||||
templateUrl: './home.component.html',
|
templateUrl: './home.component.html',
|
||||||
styleUrls: ['./home.component.css']
|
styleUrls: ['./home.component.css'],
|
||||||
})
|
})
|
||||||
export class HomeComponent {
|
export class HomeComponent {
|
||||||
|
constructor() {}
|
||||||
constructor() { }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,25 @@
|
|||||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {first, firstValueFrom, map, Observable, of, Subject, take, tap} from 'rxjs';
|
import {
|
||||||
|
first,
|
||||||
|
firstValueFrom,
|
||||||
|
map,
|
||||||
|
Observable,
|
||||||
|
of,
|
||||||
|
Subject,
|
||||||
|
take,
|
||||||
|
tap,
|
||||||
|
} from 'rxjs';
|
||||||
import { catchError } from 'rxjs/operators';
|
import { catchError } from 'rxjs/operators';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { HttpError } from '../model/httpError/httpError.model';
|
import { HttpError } from '../model/httpError/httpError.model';
|
||||||
import { User } from '../model/user/user.model';
|
import { User } from '../model/user/user.model';
|
||||||
import * as http from "http";
|
import * as http from 'http';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class AuthService {
|
export class AuthService {
|
||||||
|
|
||||||
private userAuthenticated!: User;
|
private userAuthenticated!: User;
|
||||||
|
|
||||||
authSubject = new Subject<User | HttpError | null>();
|
authSubject = new Subject<User | HttpError | null>();
|
||||||
@@ -20,30 +28,35 @@ export class AuthService {
|
|||||||
|
|
||||||
readonly BACKEND_OAUTH_PATH = environment.backendOAuthPath;
|
readonly BACKEND_OAUTH_PATH = environment.backendOAuthPath;
|
||||||
|
|
||||||
constructor(private http: HttpClient) { }
|
constructor(private http: HttpClient) {}
|
||||||
login(userAuthAtempt: User): void {
|
login(userAuthAtempt: User): void {
|
||||||
this.validateUser(this.loginUser(userAuthAtempt));
|
this.validateUser(this.loginUser(userAuthAtempt));
|
||||||
}
|
}
|
||||||
|
|
||||||
googleLogin() {
|
googleLogin() {
|
||||||
window.open(this.BACKEND_OAUTH_PATH + '/oauth2/authorization/google', '_self');
|
window.open(
|
||||||
|
this.BACKEND_OAUTH_PATH + '/oauth2/authorization/google',
|
||||||
|
'_self',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
githubLogin() {
|
githubLogin() {
|
||||||
window.open(this.BACKEND_OAUTH_PATH + '/oauth2/authorization/github', '_self');
|
window.open(
|
||||||
|
this.BACKEND_OAUTH_PATH + '/oauth2/authorization/github',
|
||||||
|
'_self',
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
loginGoogleUser(p: any): void {
|
loginGoogleUser(p: any): void {
|
||||||
this.validateUser(this.fetchGoogleOAuthToken(p))
|
this.validateUser(this.fetchGoogleOAuthToken(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
loginGithubUser(p: any): void {
|
loginGithubUser(p: any): void {
|
||||||
this.validateUser(this.fetchGithubOAuthToken(p))
|
this.validateUser(this.fetchGithubOAuthToken(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
signup(userAuthAtempt: User): void {
|
signup(userAuthAtempt: User): void {
|
||||||
this.validateUser(this.createUser(userAuthAtempt));
|
this.validateUser(this.createUser(userAuthAtempt));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh(): void {
|
refresh(): void {
|
||||||
@@ -56,7 +69,7 @@ export class AuthService {
|
|||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
this.authSubject.next(null);
|
this.authSubject.next(null);
|
||||||
this.destroySessions().subscribe()
|
this.destroySessions().subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteAccount() {
|
deleteAccount() {
|
||||||
@@ -66,7 +79,7 @@ export class AuthService {
|
|||||||
addProfilePicture(file: File): void {
|
addProfilePicture(file: File): void {
|
||||||
const fileType = file.type.split('/')[1];
|
const fileType = file.type.split('/')[1];
|
||||||
this.getAddProfilePictureUrl(fileType).subscribe({
|
this.getAddProfilePictureUrl(fileType).subscribe({
|
||||||
next: (url: string|null) => {
|
next: (url: string | null) => {
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
this.uploadProfilePicture(url, file).then(
|
this.uploadProfilePicture(url, file).then(
|
||||||
(response: Observable<any>) => {
|
(response: Observable<any>) => {
|
||||||
@@ -75,169 +88,160 @@ export class AuthService {
|
|||||||
this.processProfilePicture().subscribe(
|
this.processProfilePicture().subscribe(
|
||||||
() => {
|
() => {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private loginUser(userAuthAtempt: User): Observable<User|any> {
|
private loginUser(userAuthAtempt: User): Observable<User | any> {
|
||||||
|
|
||||||
let loginParams = new URLSearchParams();
|
let loginParams = new URLSearchParams();
|
||||||
loginParams.set("username", userAuthAtempt.username!);
|
loginParams.set('username', userAuthAtempt.username!);
|
||||||
loginParams.set("password", userAuthAtempt.password!);
|
loginParams.set('password', userAuthAtempt.password!);
|
||||||
|
|
||||||
let headers = new HttpHeaders({
|
let headers = new HttpHeaders({
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
});
|
});
|
||||||
|
|
||||||
return this.http.post<User>(
|
return this.http
|
||||||
this.BACKEND_PATH + "/user/login",
|
.post<User>(this.BACKEND_PATH + '/user/login', loginParams, {
|
||||||
loginParams,
|
headers: headers,
|
||||||
{ headers: headers, withCredentials: true }
|
withCredentials: true,
|
||||||
).pipe(
|
})
|
||||||
first()
|
.pipe(first());
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fetchGoogleOAuthToken(p: any): Observable<User|any> {
|
private fetchGoogleOAuthToken(p: any): Observable<User | any> {
|
||||||
|
let params = new HttpParams({
|
||||||
|
fromObject: p,
|
||||||
|
});
|
||||||
|
|
||||||
let params = new HttpParams(
|
return this.http
|
||||||
{
|
.get<User>(this.BACKEND_OAUTH_PATH + '/login/oauth2/code/google', {
|
||||||
fromObject: p
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.http.get<User>(
|
|
||||||
this.BACKEND_OAUTH_PATH + '/login/oauth2/code/google',
|
|
||||||
{
|
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
params: params
|
params: params,
|
||||||
},
|
})
|
||||||
).pipe(
|
.pipe(first());
|
||||||
first()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fetchGithubOAuthToken(p: any): Observable<User|any> {
|
private fetchGithubOAuthToken(p: any): Observable<User | any> {
|
||||||
|
let params = new HttpParams({
|
||||||
|
fromObject: p,
|
||||||
|
});
|
||||||
|
|
||||||
let params = new HttpParams(
|
return this.http
|
||||||
{
|
.get<User>(this.BACKEND_OAUTH_PATH + '/login/oauth2/code/github', {
|
||||||
fromObject: p
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return this.http.get<User>(
|
|
||||||
this.BACKEND_OAUTH_PATH + '/login/oauth2/code/github',
|
|
||||||
{
|
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
params: params
|
params: params,
|
||||||
},
|
})
|
||||||
).pipe(
|
.pipe(first());
|
||||||
first()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private createUser(newUser: User) {
|
private createUser(newUser: User) {
|
||||||
return this.http.post<User>(
|
return this.http
|
||||||
this.BACKEND_PATH + "/user/signup",
|
.post<User>(this.BACKEND_PATH + '/user/signup', newUser, {
|
||||||
newUser,
|
withCredentials: true,
|
||||||
{ withCredentials: true }
|
})
|
||||||
).pipe(
|
.pipe(first());
|
||||||
first()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private refreshAccessToken() {
|
private refreshAccessToken() {
|
||||||
return this.http.post<User>(
|
return this.http.post<User>(
|
||||||
this.BACKEND_PATH + "/user/login/refresh",
|
this.BACKEND_PATH + '/user/login/refresh',
|
||||||
this.userAuthenticated.refreshToken,
|
this.userAuthenticated.refreshToken,
|
||||||
{ withCredentials: true }
|
{ withCredentials: true },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private validateSession(): Observable<User> {
|
private validateSession(): Observable<User> {
|
||||||
return this.http.get<User>(
|
return this.http.get<User>(this.BACKEND_PATH + '/session/validate', {
|
||||||
this.BACKEND_PATH + '/session/validate',
|
withCredentials: true,
|
||||||
{ withCredentials: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private destroySessions() {
|
|
||||||
return this.http.delete(
|
|
||||||
this.BACKEND_PATH + '/session/destroy',
|
|
||||||
{ withCredentials: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private deleteAccountRequest() {
|
|
||||||
let headers = this.createAuthorizationHeader()
|
|
||||||
|
|
||||||
return this.http.delete(
|
|
||||||
this.BACKEND_PATH + `/user/delete`,
|
|
||||||
{ headers: headers, withCredentials: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private validateUser(userAuthAtempt: Observable<User>) {
|
|
||||||
userAuthAtempt.pipe(
|
|
||||||
catchError(error => {
|
|
||||||
if (error.status == 0) {
|
|
||||||
return of(<HttpError>{
|
|
||||||
title: "Service Unavailable",
|
|
||||||
status: 500,
|
|
||||||
details: "Service Unavailable, please try again later.",
|
|
||||||
developerMessage: "Service Unavailable, please try again later.",
|
|
||||||
timestamp: new Date().toISOString()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return of(<HttpError>error.error);
|
|
||||||
}),
|
|
||||||
first()
|
|
||||||
).subscribe({
|
|
||||||
next: userAuthentication => {
|
|
||||||
this.userAuthenticated = <User>userAuthentication;
|
|
||||||
this.authSubject.next(this.userAuthenticated);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private getAddProfilePictureUrl(fileType: string): Observable<string|null> {
|
private destroySessions() {
|
||||||
return this.http.post<{ presigned_url: string, file_key: string }>(
|
return this.http.delete(this.BACKEND_PATH + '/session/destroy', {
|
||||||
this.BACKEND_PATH + '/user/profile-picture?fileType=' + fileType,
|
withCredentials: true,
|
||||||
null,
|
});
|
||||||
{
|
|
||||||
headers: this.createAuthorizationHeader(),
|
|
||||||
withCredentials: true
|
|
||||||
}
|
|
||||||
).pipe(
|
|
||||||
first(),
|
|
||||||
map((res) => {
|
|
||||||
if (!!res && !!res.presigned_url) {
|
|
||||||
return res.presigned_url;
|
|
||||||
}
|
|
||||||
return null
|
|
||||||
})
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async uploadProfilePicture(url: string, file: File): Promise<Observable<any>> {
|
private deleteAccountRequest() {
|
||||||
|
let headers = this.createAuthorizationHeader();
|
||||||
|
|
||||||
|
return this.http.delete(this.BACKEND_PATH + `/user/delete`, {
|
||||||
|
headers: headers,
|
||||||
|
withCredentials: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private validateUser(userAuthAtempt: Observable<User>) {
|
||||||
|
userAuthAtempt
|
||||||
|
.pipe(
|
||||||
|
catchError((error) => {
|
||||||
|
if (error.status == 0) {
|
||||||
|
return of(<HttpError>{
|
||||||
|
title: 'Service Unavailable',
|
||||||
|
status: 500,
|
||||||
|
details:
|
||||||
|
'Service Unavailable, please try again later.',
|
||||||
|
developerMessage:
|
||||||
|
'Service Unavailable, please try again later.',
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return of(<HttpError>error.error);
|
||||||
|
}),
|
||||||
|
first(),
|
||||||
|
)
|
||||||
|
.subscribe({
|
||||||
|
next: (userAuthentication) => {
|
||||||
|
this.userAuthenticated = <User>userAuthentication;
|
||||||
|
this.authSubject.next(this.userAuthenticated);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private getAddProfilePictureUrl(
|
||||||
|
fileType: string,
|
||||||
|
): Observable<string | null> {
|
||||||
|
return this.http
|
||||||
|
.post<{ presigned_url: string; file_key: string }>(
|
||||||
|
this.BACKEND_PATH +
|
||||||
|
'/user/profile-picture?fileType=' +
|
||||||
|
fileType,
|
||||||
|
null,
|
||||||
|
{
|
||||||
|
headers: this.createAuthorizationHeader(),
|
||||||
|
withCredentials: true,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.pipe(
|
||||||
|
first(),
|
||||||
|
map((res) => {
|
||||||
|
if (!!res && !!res.presigned_url) {
|
||||||
|
return res.presigned_url;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async uploadProfilePicture(
|
||||||
|
url: string,
|
||||||
|
file: File,
|
||||||
|
): Promise<Observable<any>> {
|
||||||
const fileData = await this.readAsArrayBuffer(file);
|
const fileData = await this.readAsArrayBuffer(file);
|
||||||
let headers = new HttpHeaders({
|
let headers = new HttpHeaders({
|
||||||
'Content-Type': file.type
|
'Content-Type': file.type,
|
||||||
})
|
});
|
||||||
return this.http.put(
|
return this.http.put(url, fileData, {
|
||||||
url,
|
headers: headers,
|
||||||
fileData,
|
});
|
||||||
{
|
|
||||||
headers: headers,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private processProfilePicture() {
|
private processProfilePicture() {
|
||||||
@@ -246,21 +250,22 @@ export class AuthService {
|
|||||||
null,
|
null,
|
||||||
{
|
{
|
||||||
headers: this.createAuthorizationHeader(),
|
headers: this.createAuthorizationHeader(),
|
||||||
withCredentials: true
|
withCredentials: true,
|
||||||
}
|
},
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private createAuthorizationHeader(): HttpHeaders {
|
private createAuthorizationHeader(): HttpHeaders {
|
||||||
return new HttpHeaders({
|
return new HttpHeaders({
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': 'Bearer ' + this.userAuthenticated.accessToken?.token
|
Authorization:
|
||||||
|
'Bearer ' + this.userAuthenticated.accessToken?.token,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async readAsArrayBuffer(file: File): Promise<ArrayBuffer> {
|
private async readAsArrayBuffer(file: File): Promise<ArrayBuffer> {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.readAsArrayBuffer(file)
|
reader.readAsArrayBuffer(file);
|
||||||
return new Promise<ArrayBuffer>((resolve, reject) => {
|
return new Promise<ArrayBuffer>((resolve, reject) => {
|
||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
resolve(reader.result as ArrayBuffer);
|
resolve(reader.result as ArrayBuffer);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');
|
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap");
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-family: 'Poppins', sans-serif;
|
font-family: "Poppins", sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-background {
|
.popup-background {
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
background: #808080;
|
background: #808080;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
content: '';
|
content: "";
|
||||||
width: 25px;
|
width: 25px;
|
||||||
height: 5px;
|
height: 5px;
|
||||||
}
|
}
|
||||||
@@ -73,11 +73,9 @@
|
|||||||
height: 60px;
|
height: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width:767px) {
|
@media (min-width: 767px) {
|
||||||
|
|
||||||
.popup {
|
.popup {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
max-width: unset;
|
max-width: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
<div #popup
|
<div
|
||||||
class="popup-background"
|
#popup
|
||||||
[@popupState]="popupState"
|
class="popup-background"
|
||||||
(@popupState.done)="animationStop()">
|
[@popupState]="popupState"
|
||||||
<div class="popup"
|
(@popupState.done)="animationStop()"
|
||||||
appClickedOutside
|
>
|
||||||
(clickOutside)="closePopup()"
|
<div
|
||||||
[ignoreElementList]="ignoreClickOutside">
|
class="popup"
|
||||||
|
appClickedOutside
|
||||||
|
(clickOutside)="closePopup()"
|
||||||
|
[ignoreElementList]="ignoreClickOutside"
|
||||||
|
>
|
||||||
<div class="popup-header">
|
<div class="popup-header">
|
||||||
<div class="popup-close-btn" (click)="closePopup()"></div>
|
<div class="popup-close-btn" (click)="closePopup()"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -14,4 +18,4 @@ class="popup-background"
|
|||||||
</div>
|
</div>
|
||||||
<div class="popup-footer"></div>
|
<div class="popup-footer"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('PopupComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ PopupComponent ]
|
declarations: [PopupComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(PopupComponent);
|
fixture = TestBed.createComponent(PopupComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,5 +1,21 @@
|
|||||||
import { animate, animateChild, group, query, state, style, transition, trigger } from '@angular/animations';
|
import {
|
||||||
import { Component, ElementRef, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
|
animate,
|
||||||
|
animateChild,
|
||||||
|
group,
|
||||||
|
query,
|
||||||
|
state,
|
||||||
|
style,
|
||||||
|
transition,
|
||||||
|
trigger,
|
||||||
|
} from '@angular/animations';
|
||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ElementRef,
|
||||||
|
EventEmitter,
|
||||||
|
Input,
|
||||||
|
Output,
|
||||||
|
ViewEncapsulation,
|
||||||
|
} from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-popup',
|
selector: 'app-popup',
|
||||||
@@ -7,49 +23,46 @@ import { Component, ElementRef, EventEmitter, Input, Output, ViewEncapsulation }
|
|||||||
styleUrls: ['./popup.component.css'],
|
styleUrls: ['./popup.component.css'],
|
||||||
animations: [
|
animations: [
|
||||||
trigger('popupState', [
|
trigger('popupState', [
|
||||||
state('hide', style({
|
state(
|
||||||
'opacity': '0'
|
'hide',
|
||||||
})),
|
style({
|
||||||
state('show', style({
|
opacity: '0',
|
||||||
'opacity': '1'
|
}),
|
||||||
})),
|
),
|
||||||
|
state(
|
||||||
|
'show',
|
||||||
|
style({
|
||||||
|
opacity: '1',
|
||||||
|
}),
|
||||||
|
),
|
||||||
transition(
|
transition(
|
||||||
'* => show',
|
'* => show',
|
||||||
group([
|
group([
|
||||||
query(
|
query('@*', animateChild(), { optional: true }),
|
||||||
"@*",
|
animate('250ms ease-in'),
|
||||||
animateChild(),
|
]),
|
||||||
{ optional: true }
|
|
||||||
),
|
|
||||||
animate('250ms ease-in')
|
|
||||||
])
|
|
||||||
),
|
),
|
||||||
transition(
|
transition(
|
||||||
'show => hide',
|
'show => hide',
|
||||||
group([
|
group([
|
||||||
query(
|
query('@*', animateChild(), { optional: true }),
|
||||||
"@*",
|
animate('250ms ease-out'),
|
||||||
animateChild(),
|
]),
|
||||||
{ optional: true }
|
),
|
||||||
),
|
]),
|
||||||
animate('250ms ease-out')
|
],
|
||||||
])
|
|
||||||
)
|
|
||||||
])
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class PopupComponent {
|
export class PopupComponent {
|
||||||
|
@Input()
|
||||||
|
state: boolean = false;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
state: boolean = false;
|
ignoreClickOutside!: HTMLDivElement[];
|
||||||
|
|
||||||
@Input()
|
|
||||||
ignoreClickOutside!: HTMLDivElement[];
|
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
stateChange = new EventEmitter<boolean>(false);
|
stateChange = new EventEmitter<boolean>(false);
|
||||||
|
|
||||||
constructor() { }
|
constructor() {}
|
||||||
|
|
||||||
get popupState(): string {
|
get popupState(): string {
|
||||||
return this.state ? 'show' : 'hide';
|
return this.state ? 'show' : 'hide';
|
||||||
@@ -57,7 +70,7 @@ export class PopupComponent {
|
|||||||
|
|
||||||
animationStop() {
|
animationStop() {
|
||||||
if (!this.state) {
|
if (!this.state) {
|
||||||
this.closePopup()
|
this.closePopup();
|
||||||
this.stateChange.emit(false);
|
this.stateChange.emit(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,5 +78,4 @@ export class PopupComponent {
|
|||||||
closePopup(): void {
|
closePopup(): void {
|
||||||
this.state = false;
|
this.state = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,8 @@ describe('SliderItemComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ SliderItemComponent ]
|
declarations: [SliderItemComponent],
|
||||||
})
|
}).compileComponents();
|
||||||
.compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(SliderItemComponent);
|
fixture = TestBed.createComponent(SliderItemComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
|
|||||||
@@ -1,46 +1,56 @@
|
|||||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
import {
|
||||||
|
animate,
|
||||||
|
state,
|
||||||
|
style,
|
||||||
|
transition,
|
||||||
|
trigger,
|
||||||
|
} from '@angular/animations';
|
||||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-slider-item',
|
selector: 'app-slider-item',
|
||||||
templateUrl: './slider-item.component.html',
|
templateUrl: './slider-item.component.html',
|
||||||
styleUrls: ['./slider-item.component.css'],
|
styleUrls: ['./slider-item.component.css'],
|
||||||
animations:[
|
animations: [
|
||||||
trigger('animateSliderItem',[
|
trigger('animateSliderItem', [
|
||||||
state('hide', style({
|
state(
|
||||||
'opacity': '0',
|
'hide',
|
||||||
'transform': 'translateX(150px)'
|
style({
|
||||||
}),
|
opacity: '0',
|
||||||
{
|
transform: 'translateX(150px)',
|
||||||
params: {
|
}),
|
||||||
fadeInTime: 600,
|
{
|
||||||
fadeOutTime: 600
|
params: {
|
||||||
}
|
fadeInTime: 600,
|
||||||
}),
|
fadeOutTime: 600,
|
||||||
state('show', style({
|
},
|
||||||
'opacity': '1',
|
|
||||||
'transform': 'translateX(0px)'
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
params: {
|
|
||||||
fadeOutTime: 600,
|
|
||||||
fadeInTime: 600
|
|
||||||
},
|
},
|
||||||
}),
|
),
|
||||||
|
state(
|
||||||
|
'show',
|
||||||
|
style({
|
||||||
|
opacity: '1',
|
||||||
|
transform: 'translateX(0px)',
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
params: {
|
||||||
|
fadeOutTime: 600,
|
||||||
|
fadeInTime: 600,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
),
|
||||||
transition('hide => show', animate(`{{ fadeInTime }}s ease-in`)),
|
transition('hide => show', animate(`{{ fadeInTime }}s ease-in`)),
|
||||||
transition('show => hide', animate(`{{ fadeOutTime }}s ease-out`))
|
transition('show => hide', animate(`{{ fadeOutTime }}s ease-out`)),
|
||||||
])
|
]),
|
||||||
]
|
],
|
||||||
})
|
})
|
||||||
export class SliderItemComponent {
|
export class SliderItemComponent {
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
public state:boolean = false;
|
public state: boolean = false;
|
||||||
|
|
||||||
constructor() { }
|
constructor() {}
|
||||||
|
|
||||||
get itemStatus(): string {
|
get itemStatus(): string {
|
||||||
return this.state ? 'show' : 'hide';
|
return this.state ? 'show' : 'hide';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,44 +1,42 @@
|
|||||||
import {NgModule} from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import {CommonModule} from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import {NgcCookieConsentConfig, NgcCookieConsentModule} from "ngx-cookieconsent";
|
import {
|
||||||
|
NgcCookieConsentConfig,
|
||||||
|
NgcCookieConsentModule,
|
||||||
|
} from 'ngx-cookieconsent';
|
||||||
|
|
||||||
const cookieConfig: NgcCookieConsentConfig = {
|
const cookieConfig: NgcCookieConsentConfig = {
|
||||||
"cookie": {
|
cookie: {
|
||||||
"domain": "tinesoft.github.io"
|
domain: 'tinesoft.github.io',
|
||||||
},
|
},
|
||||||
"position": "bottom-left",
|
position: 'bottom-left',
|
||||||
"theme": "classic",
|
theme: 'classic',
|
||||||
"palette": {
|
palette: {
|
||||||
"popup": {
|
popup: {
|
||||||
"background": "#4e4e4e",
|
background: '#4e4e4e',
|
||||||
"text": "#ffffff",
|
text: '#ffffff',
|
||||||
"link": "#ffffff"
|
link: '#ffffff',
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
background: '#fa2f22',
|
||||||
|
text: '#ffffff',
|
||||||
|
border: 'transparent',
|
||||||
},
|
},
|
||||||
"button": {
|
|
||||||
"background": "#fa2f22",
|
|
||||||
"text": "#ffffff",
|
|
||||||
"border": "transparent"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"type": "opt-in",
|
type: 'opt-in',
|
||||||
"content": {
|
content: {
|
||||||
"message": "This website uses cookies to ensure you get the best experience on our website.",
|
message:
|
||||||
"dismiss": "Got it!",
|
'This website uses cookies to ensure you get the best experience on our website.',
|
||||||
"deny": "Refuse cookies",
|
dismiss: 'Got it!',
|
||||||
"link": "",
|
deny: 'Refuse cookies',
|
||||||
"href": "",
|
link: '',
|
||||||
"policy": "Cookie Policy"
|
href: '',
|
||||||
}
|
policy: 'Cookie Policy',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [],
|
declarations: [],
|
||||||
imports: [
|
imports: [CommonModule, NgcCookieConsentModule.forRoot(cookieConfig)],
|
||||||
CommonModule,
|
|
||||||
NgcCookieConsentModule.forRoot(cookieConfig)
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class CookieConsentModule {
|
export class CookieConsentModule {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import { TestBed } from '@angular/core/testing';
|
|||||||
import { CookieConsertService } from './cookie-consert.service';
|
import { CookieConsertService } from './cookie-consert.service';
|
||||||
|
|
||||||
describe('CookieConsertService', () => {
|
describe('CookieConsertService', () => {
|
||||||
let service: CookieConsertService;
|
let service: CookieConsertService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({});
|
||||||
service = TestBed.inject(CookieConsertService);
|
service = TestBed.inject(CookieConsertService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
||||||
expect(service).toBeTruthy();
|
expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,21 +1,20 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {BehaviorSubject, Subject, Subscription} from "rxjs";
|
import { BehaviorSubject, Subject, Subscription } from 'rxjs';
|
||||||
import {CookieService} from "ngx-cookie-service";
|
import { CookieService } from 'ngx-cookie-service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class CookieConsertService {
|
export class CookieConsertService {
|
||||||
|
|
||||||
private storage: Storage;
|
private storage: Storage;
|
||||||
|
|
||||||
cookieStatusChangeSubscription!: BehaviorSubject<boolean>
|
cookieStatusChangeSubscription!: BehaviorSubject<boolean>;
|
||||||
|
|
||||||
constructor(private cookieService: CookieService) {
|
constructor(private cookieService: CookieService) {
|
||||||
this.storage = window.localStorage
|
this.storage = window.localStorage;
|
||||||
|
|
||||||
this.cookieStatusChangeSubscription = new BehaviorSubject<boolean>(
|
this.cookieStatusChangeSubscription = new BehaviorSubject<boolean>(
|
||||||
this.getCookieConsentStatusFromLocalStorage()
|
this.getCookieConsentStatusFromLocalStorage(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,5 +47,4 @@ export class CookieConsertService {
|
|||||||
|
|
||||||
return status === 'true';
|
return status === 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,28 @@
|
|||||||
import { DOCUMENT } from '@angular/common';
|
import { DOCUMENT } from '@angular/common';
|
||||||
import { AfterViewInit, Directive, ElementRef, EventEmitter, Inject, Input, OnDestroy, Output, ViewChild } from '@angular/core';
|
import {
|
||||||
import { combineLatest, combineLatestWith, filter, fromEvent, merge, Subscription } from 'rxjs';
|
AfterViewInit,
|
||||||
|
Directive,
|
||||||
|
ElementRef,
|
||||||
|
EventEmitter,
|
||||||
|
Inject,
|
||||||
|
Input,
|
||||||
|
OnDestroy,
|
||||||
|
Output,
|
||||||
|
ViewChild,
|
||||||
|
} from '@angular/core';
|
||||||
|
import {
|
||||||
|
combineLatest,
|
||||||
|
combineLatestWith,
|
||||||
|
filter,
|
||||||
|
fromEvent,
|
||||||
|
merge,
|
||||||
|
Subscription,
|
||||||
|
} from 'rxjs';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[appClickedOutside]'
|
selector: '[appClickedOutside]',
|
||||||
})
|
})
|
||||||
export class ClickedOutsideDirective implements AfterViewInit, OnDestroy {
|
export class ClickedOutsideDirective implements AfterViewInit, OnDestroy {
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
ignoreElementList!: HTMLDivElement[];
|
ignoreElementList!: HTMLDivElement[];
|
||||||
|
|
||||||
@@ -23,27 +39,27 @@ export class ClickedOutsideDirective implements AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private element: ElementRef,
|
private element: ElementRef,
|
||||||
@Inject(DOCUMENT) private document: Document
|
@Inject(DOCUMENT) private document: Document,
|
||||||
) { }
|
) {}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
|
|
||||||
const clickListener$ = fromEvent(this.document, 'click');
|
const clickListener$ = fromEvent(this.document, 'click');
|
||||||
|
|
||||||
this.eventListener = clickListener$.pipe(
|
this.eventListener = clickListener$
|
||||||
filter((click) => {
|
.pipe(
|
||||||
return (
|
filter((click) => {
|
||||||
(
|
return (
|
||||||
this.isOutside(click.target as HTMLElement) ||
|
(this.isOutside(click.target as HTMLElement) ||
|
||||||
this.isInIncludedList(click.target as HTMLElement)
|
this.isInIncludedList(
|
||||||
) &&
|
click.target as HTMLElement,
|
||||||
this.notInIgnoredList(click.target as HTMLElement)
|
)) &&
|
||||||
);
|
this.notInIgnoredList(click.target as HTMLElement)
|
||||||
})
|
);
|
||||||
). subscribe( () => {
|
}),
|
||||||
!this.clickOutsideStopWatching && this.clickOutside.emit();
|
)
|
||||||
});
|
.subscribe(() => {
|
||||||
|
!this.clickOutsideStopWatching && this.clickOutside.emit();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
@@ -52,12 +68,14 @@ export class ClickedOutsideDirective implements AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
private isOutside(elementToCheck: HTMLElement): boolean {
|
private isOutside(elementToCheck: HTMLElement): boolean {
|
||||||
let status = true;
|
let status = true;
|
||||||
if (this.element.nativeElement === elementToCheck ||
|
if (
|
||||||
this.element.nativeElement.contains(elementToCheck)) {
|
this.element.nativeElement === elementToCheck ||
|
||||||
|
this.element.nativeElement.contains(elementToCheck)
|
||||||
|
) {
|
||||||
status = false;
|
status = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('isOutside', status)
|
console.log('isOutside', status);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -68,26 +86,32 @@ export class ClickedOutsideDirective implements AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let validateIsIgnored = (ignoreElement: HTMLDivElement): boolean => {
|
let validateIsIgnored = (ignoreElement: HTMLDivElement): boolean => {
|
||||||
return ignoreElement === elementToCheck
|
return (
|
||||||
|| ignoreElement.contains(elementToCheck)
|
ignoreElement === elementToCheck ||
|
||||||
|| elementToCheck.contains(ignoreElement)
|
ignoreElement.contains(elementToCheck) ||
|
||||||
}
|
elementToCheck.contains(ignoreElement)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return !this.ignoreElementList.some(validateIsIgnored)
|
return !this.ignoreElementList.some(validateIsIgnored);
|
||||||
}
|
}
|
||||||
|
|
||||||
private isInIncludedList(elementToCheck: HTMLElement): boolean {
|
private isInIncludedList(elementToCheck: HTMLElement): boolean {
|
||||||
if (!this.includeClickedOutside || this.includeClickedOutside.length === 0) {
|
if (
|
||||||
|
!this.includeClickedOutside ||
|
||||||
|
this.includeClickedOutside.length === 0
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let validateIsIncluded = (includedElement: HTMLDivElement): boolean => {
|
let validateIsIncluded = (includedElement: HTMLDivElement): boolean => {
|
||||||
return includedElement === elementToCheck
|
return (
|
||||||
|| includedElement.contains(elementToCheck)
|
includedElement === elementToCheck ||
|
||||||
|| elementToCheck.contains(includedElement)
|
includedElement.contains(elementToCheck) ||
|
||||||
}
|
elementToCheck.contains(includedElement)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return !this.includeClickedOutside.some(validateIsIncluded)
|
return !this.includeClickedOutside.some(validateIsIncluded);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
/**
|
/**
|
||||||
* This module was automatically generated by `ts-interface-builder`
|
* This module was automatically generated by `ts-interface-builder`
|
||||||
*/
|
*/
|
||||||
import * as t from "ts-interface-checker";
|
import * as t from 'ts-interface-checker';
|
||||||
// tslint:disable:object-literal-key-quotes
|
// tslint:disable:object-literal-key-quotes
|
||||||
|
|
||||||
export const HttpError = t.iface([], {
|
export const HttpError = t.iface([], {
|
||||||
"title": "string",
|
title: 'string',
|
||||||
"status": "number",
|
status: 'number',
|
||||||
"details": "string",
|
details: 'string',
|
||||||
"developerMessage": "string",
|
developerMessage: 'string',
|
||||||
"timestamp": "string",
|
timestamp: 'string',
|
||||||
});
|
});
|
||||||
|
|
||||||
const exportedTypeSuite: t.ITypeSuite = {
|
const exportedTypeSuite: t.ITypeSuite = {
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ export interface HttpError {
|
|||||||
details: string;
|
details: string;
|
||||||
developerMessage: string;
|
developerMessage: string;
|
||||||
timestamp: string;
|
timestamp: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { createCheckers } from "ts-interface-checker";
|
import { createCheckers } from 'ts-interface-checker';
|
||||||
import HttpError from "./httpError.model-ti";
|
import HttpError from './httpError.model-ti';
|
||||||
|
|
||||||
const HttpErrorChecker = createCheckers(HttpError)['HttpError'];
|
const HttpErrorChecker = createCheckers(HttpError)['HttpError'];
|
||||||
export default HttpErrorChecker;
|
export default HttpErrorChecker;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* This module was automatically generated by `ts-interface-builder`
|
* This module was automatically generated by `ts-interface-builder`
|
||||||
*/
|
*/
|
||||||
import * as t from "ts-interface-checker";
|
import * as t from 'ts-interface-checker';
|
||||||
// tslint:disable:object-literal-key-quotes
|
// tslint:disable:object-literal-key-quotes
|
||||||
|
|
||||||
export const Token = t.iface([], {
|
export const Token = t.iface([], {
|
||||||
"token": "string",
|
token: 'string',
|
||||||
"expirationDate": t.union("string", "number"),
|
expirationDate: t.union('string', 'number'),
|
||||||
});
|
});
|
||||||
|
|
||||||
const exportedTypeSuite: t.ITypeSuite = {
|
const exportedTypeSuite: t.ITypeSuite = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export interface Token {
|
export interface Token {
|
||||||
token: string,
|
token: string;
|
||||||
expirationDate: string|number
|
expirationDate: string | number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { createCheckers } from "ts-interface-checker";
|
import { createCheckers } from 'ts-interface-checker';
|
||||||
import User from "./user.model-ti";
|
import User from './user.model-ti';
|
||||||
import Token from "../token/token.model-ti";
|
import Token from '../token/token.model-ti';
|
||||||
|
|
||||||
const UserChecker = createCheckers(User, Token)['User'];
|
const UserChecker = createCheckers(User, Token)['User'];
|
||||||
export default UserChecker;
|
export default UserChecker;
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/**
|
/**
|
||||||
* This module was automatically generated by `ts-interface-builder`
|
* This module was automatically generated by `ts-interface-builder`
|
||||||
*/
|
*/
|
||||||
import * as t from "ts-interface-checker";
|
import * as t from 'ts-interface-checker';
|
||||||
// tslint:disable:object-literal-key-quotes
|
// tslint:disable:object-literal-key-quotes
|
||||||
|
|
||||||
export const User = t.iface([], {
|
export const User = t.iface([], {
|
||||||
"id": t.opt("number"),
|
id: t.opt('number'),
|
||||||
"name": t.opt("string"),
|
name: t.opt('string'),
|
||||||
"email": t.opt("string"),
|
email: t.opt('string'),
|
||||||
"username": "string",
|
username: 'string',
|
||||||
"password": t.opt("string"),
|
password: t.opt('string'),
|
||||||
"profilePictureUrl": t.opt("string"),
|
profilePictureUrl: t.opt('string'),
|
||||||
"accessToken": t.opt("Token"),
|
accessToken: t.opt('Token'),
|
||||||
"refreshToken": t.opt("Token"),
|
refreshToken: t.opt('Token'),
|
||||||
"roles": t.opt(t.array("string")),
|
roles: t.opt(t.array('string')),
|
||||||
});
|
});
|
||||||
|
|
||||||
const exportedTypeSuite: t.ITypeSuite = {
|
const exportedTypeSuite: t.ITypeSuite = {
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { Token } from "../token/token.model";
|
import { Token } from '../token/token.model';
|
||||||
|
|
||||||
export interface User {
|
export interface User {
|
||||||
id?: number,
|
id?: number;
|
||||||
name?: string,
|
name?: string;
|
||||||
email?: string,
|
email?: string;
|
||||||
username: string,
|
username: string;
|
||||||
password?: string,
|
password?: string;
|
||||||
profilePictureUrl?: string,
|
profilePictureUrl?: string;
|
||||||
accessToken?: Token,
|
accessToken?: Token;
|
||||||
refreshToken?: Token,
|
refreshToken?: Token;
|
||||||
roles?: Array<string>,
|
roles?: Array<string>;
|
||||||
validateAccessToken?: () => Token | undefined;
|
validateAccessToken?: () => Token | undefined;
|
||||||
};
|
}
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import { TestBed } from '@angular/core/testing';
|
|||||||
import { UpdateService } from './update.service';
|
import { UpdateService } from './update.service';
|
||||||
|
|
||||||
describe('UpdateService', () => {
|
describe('UpdateService', () => {
|
||||||
let service: UpdateService;
|
let service: UpdateService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({});
|
||||||
service = TestBed.inject(UpdateService);
|
service = TestBed.inject(UpdateService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
||||||
expect(service).toBeTruthy();
|
expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,26 +1,27 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {SwUpdate} from "@angular/service-worker";
|
import { SwUpdate } from '@angular/service-worker';
|
||||||
import {interval} from "rxjs";
|
import { interval } from 'rxjs';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class UpdateService {
|
export class UpdateService {
|
||||||
|
|
||||||
constructor(private swUpdate: SwUpdate) {
|
constructor(private swUpdate: SwUpdate) {
|
||||||
if (swUpdate.isEnabled) {
|
if (swUpdate.isEnabled) {
|
||||||
interval(6 * 60 * 60).subscribe(() => swUpdate.checkForUpdate()
|
interval(6 * 60 * 60).subscribe(() =>
|
||||||
.then(() => console.log('checking for updates')));
|
swUpdate
|
||||||
|
.checkForUpdate()
|
||||||
|
.then(() => console.log('checking for updates')),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public checkForUpdates(): void {
|
public checkForUpdates(): void {
|
||||||
this.swUpdate.available.subscribe(event => this.promptUser());
|
this.swUpdate.available.subscribe((event) => this.promptUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
private promptUser(): void {
|
private promptUser(): void {
|
||||||
console.log('updating to new version');
|
console.log('updating to new version');
|
||||||
this.swUpdate.activateUpdate().then(() => document.location.reload());
|
this.swUpdate.activateUpdate().then(() => document.location.reload());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|||||||
import { HttpClientModule } from '@angular/common/http';
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
import { PopupComponent } from './components/popup/popup.component';
|
import { PopupComponent } from './components/popup/popup.component';
|
||||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||||
import {CookieConsentModule} from "./cookie-consent/cookie-consent.module";
|
import { CookieConsentModule } from './cookie-consent/cookie-consent.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@@ -19,12 +19,8 @@ import {CookieConsentModule} from "./cookie-consent/cookie-consent.module";
|
|||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
BrowserAnimationsModule,
|
BrowserAnimationsModule,
|
||||||
FontAwesomeModule,
|
FontAwesomeModule,
|
||||||
CookieConsentModule
|
CookieConsentModule,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [ClickedOutsideDirective, SliderItemComponent, PopupComponent],
|
||||||
ClickedOutsideDirective,
|
|
||||||
SliderItemComponent,
|
|
||||||
PopupComponent
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class SharedModule { }
|
export class SharedModule {}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {AbstractControl} from "@angular/forms";
|
import { AbstractControl } from '@angular/forms';
|
||||||
|
|
||||||
export function ValidateEmailValidator(control: AbstractControl) {
|
export function ValidateEmailValidator(control: AbstractControl) {
|
||||||
const email = control.value;
|
const email = control.value;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {AbstractControl} from "@angular/forms";
|
import { AbstractControl } from '@angular/forms';
|
||||||
|
|
||||||
export function ValidateNotEmptyValidator(control: AbstractControl) {
|
export function ValidateNotEmptyValidator(control: AbstractControl) {
|
||||||
const value = control.value;
|
const value = control.value;
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import {AbstractControl} from "@angular/forms";
|
import { AbstractControl } from '@angular/forms';
|
||||||
|
|
||||||
export function ValidatePasswordValidator(control: AbstractControl) {
|
export function ValidatePasswordValidator(control: AbstractControl) {
|
||||||
var password = control.value;
|
var password = control.value;
|
||||||
var passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/g;
|
var passwordRegex =
|
||||||
|
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/g;
|
||||||
var passwordValid = passwordRegex.test(password);
|
var passwordValid = passwordRegex.test(password);
|
||||||
if (!passwordValid) {
|
if (!passwordValid) {
|
||||||
return { invalidPassword: true };
|
return { invalidPassword: true };
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
(function (window) {
|
(function (window) {
|
||||||
window['env'] = window['env'] || {};
|
window["env"] = window["env"] || {};
|
||||||
|
|
||||||
// Environment variables
|
// Environment variables
|
||||||
window['env']['BACKEND_URL'] = '${BACKEND_URL}';
|
window["env"]["BACKEND_URL"] = "${BACKEND_URL}";
|
||||||
window['env']['BACKEND_OAUTH_URL'] = '${BACKEND_OAUTH_URL}';
|
window["env"]["BACKEND_OAUTH_URL"] = "${BACKEND_OAUTH_URL}";
|
||||||
})(this);
|
})(this);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
backendPath: (<any>window)['env']['BACKEND_URL'],
|
backendPath: (<any>window)['env']['BACKEND_URL'],
|
||||||
backendOAuthPath: (<any>window)['env']['BACKEND_OAUTH_URL']
|
backendOAuthPath: (<any>window)['env']['BACKEND_OAUTH_URL'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
backendPath: 'http://localhost:8070',
|
backendPath: 'http://localhost:8070',
|
||||||
backendOAuthPath: 'http://localhost:8070'
|
backendOAuthPath: 'http://localhost:8070',
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,71 +1,115 @@
|
|||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-italic-100.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-italic-100.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-italic-100.ttf) format('truetype');
|
src:
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-100.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-100.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-100.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-italic-300.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-italic-300.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-italic-300.ttf) format('truetype');
|
src:
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-300.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-300.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-300.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-italic-400.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-italic-400.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-italic-400.ttf) format('truetype');
|
src:
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-400.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-400.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-400.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-italic-700.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-italic-700.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-italic-700.ttf) format('truetype');
|
src:
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-700.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-700.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-700.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-italic-900.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-italic-900.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-italic-900.ttf) format('truetype');
|
src:
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-900.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-900.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-italic-900.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-normal-100.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-normal-100.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-normal-100.ttf) format('truetype');
|
src:
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-100.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-100.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-100.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-normal-300.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-normal-300.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-normal-300.ttf) format('truetype');
|
src:
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-300.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-300.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-300.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-normal-400.eot);
|
src: url(assets/fonts/Montserrat/Montserrat-normal-400.eot);
|
||||||
src: local('Montserrat'), url(assets/fonts/Montserrat/Montserrat-normal-400.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-normal-400.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-normal-400.svg#Montserrat) format('svg'), url(assets/fonts/Montserrat/Montserrat-normal-400.eot?#iefix) format('embedded-opentype'), url(assets/fonts/Montserrat/Montserrat-normal-400.ttf) format('truetype');
|
src:
|
||||||
|
local("Montserrat"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-400.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-400.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-400.svg#Montserrat)
|
||||||
|
format("svg"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-400.eot?#iefix)
|
||||||
|
format("embedded-opentype"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-400.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-normal-700.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-normal-700.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-normal-700.ttf) format('truetype');
|
src:
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-700.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-700.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-700.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Montserrat';
|
font-family: "Montserrat";
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
src: url(assets/fonts/Montserrat/Montserrat-normal-900.woff) format('woff'), url(assets/fonts/Montserrat/Montserrat-normal-900.woff2) format('woff2'), url(assets/fonts/Montserrat/Montserrat-normal-900.ttf) format('truetype');
|
src:
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-900.woff) format("woff"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-900.woff2) format("woff2"),
|
||||||
|
url(assets/fonts/Montserrat/Montserrat-normal-900.ttf)
|
||||||
|
format("truetype");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,39 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Hideyoshi Portfolio</title>
|
||||||
|
<base href="/" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<link
|
||||||
|
rel="icon"
|
||||||
|
type="image/x-icon"
|
||||||
|
href="./assets/img/logohideyoshi-red.png"
|
||||||
|
/>
|
||||||
|
|
||||||
<head>
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
<meta charset="utf-8">
|
<meta name="mobile-web-app-capable" content="yes" />
|
||||||
<title>Hideyoshi Portfolio</title>
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<base href="/">
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="mobile-web-app-capable" content="yes" />
|
||||||
<link rel="icon" type="image/x-icon" href="./assets/img/logohideyoshi-red.png">
|
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||||
|
<meta name="apple-mobile-web-app-title" content="Hideyoshi" />
|
||||||
|
|
||||||
|
<link rel="manifest" href="manifest.webmanifest" />
|
||||||
|
<link
|
||||||
|
rel="preconnect"
|
||||||
|
href="https://hideyoshi-portfolio-dev.s3.amazonaws.com"
|
||||||
|
/>
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<!-- Loading environment variables -->
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<script src="./assets/env.js"></script>
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
</head>
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
||||||
<meta name="apple-mobile-web-app-title" content="Hideyoshi">
|
|
||||||
|
|
||||||
<link rel="manifest" href="manifest.webmanifest">
|
<body>
|
||||||
<link rel="preconnect" href="https://hideyoshi-portfolio-dev.s3.amazonaws.com">
|
<app-root></app-root>
|
||||||
|
<noscript
|
||||||
<!-- Loading environment variables -->
|
>Please enable JavaScript to continue using this
|
||||||
<script src="./assets/env.js"></script>
|
application.</noscript
|
||||||
</head>
|
>
|
||||||
|
</body>
|
||||||
<body>
|
|
||||||
<app-root></app-root>
|
|
||||||
<noscript>Please enable JavaScript to continue using this application.</noscript>
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ if (environment.production) {
|
|||||||
enableProdMode();
|
enableProdMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule)
|
platformBrowserDynamic()
|
||||||
.catch(err => console.error(err));
|
.bootstrapModule(AppModule)
|
||||||
|
.catch((err) => console.error(err));
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "Hideyoshi Portfolio",
|
"name": "Hideyoshi Portfolio",
|
||||||
"short_name": "Hideyoshi",
|
"short_name": "Hideyoshi",
|
||||||
"theme_color": "#2e2e2e",
|
"theme_color": "#2e2e2e",
|
||||||
"background_color": "#2e2e2e",
|
"background_color": "#2e2e2e",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"orientation": "portrait",
|
"orientation": "portrait",
|
||||||
"scope": "./",
|
"scope": "./",
|
||||||
"start_url": "./",
|
"start_url": "./",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "assets/icons/icon-512x512.png",
|
"src": "assets/icons/icon-512x512.png",
|
||||||
"sizes": "512x512",
|
"sizes": "512x512",
|
||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,8 +45,7 @@
|
|||||||
/***************************************************************************************************
|
/***************************************************************************************************
|
||||||
* Zone JS is required by default for Angular itself.
|
* Zone JS is required by default for Angular itself.
|
||||||
*/
|
*/
|
||||||
import 'zone.js'; // Included with Angular CLI.
|
import 'zone.js'; // Included with Angular CLI.
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************************************
|
/***************************************************************************************************
|
||||||
* APPLICATION IMPORTS
|
* APPLICATION IMPORTS
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
@import 'font-montserrat.css';
|
@import "font-montserrat.css";
|
||||||
|
|
||||||
* {
|
* {
|
||||||
padding: 0 auto;
|
padding: 0 auto;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
h1,
|
||||||
font-family: 'Montserrat', sans-serif;
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6 {
|
||||||
|
font-family: "Montserrat", sans-serif;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import 'zone.js/testing';
|
|||||||
import { getTestBed } from '@angular/core/testing';
|
import { getTestBed } from '@angular/core/testing';
|
||||||
import {
|
import {
|
||||||
BrowserDynamicTestingModule,
|
BrowserDynamicTestingModule,
|
||||||
platformBrowserDynamicTesting
|
platformBrowserDynamicTesting,
|
||||||
} from '@angular/platform-browser-dynamic/testing';
|
} from '@angular/platform-browser-dynamic/testing';
|
||||||
|
|
||||||
// First, initialize the Angular testing environment.
|
// First, initialize the Angular testing environment.
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./out-tsc/app",
|
"outDir": "./out-tsc/app",
|
||||||
"types": ["node"]
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"files": [
|
"files": ["src/main.ts", "src/polyfills.ts"],
|
||||||
"src/main.ts",
|
"include": ["src/**/*.d.ts"]
|
||||||
"src/polyfills.ts"
|
|
||||||
],
|
|
||||||
"include": [
|
|
||||||
"src/**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,30 @@
|
|||||||
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
||||||
{
|
{
|
||||||
"compileOnSave": false,
|
"compileOnSave": false,
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"outDir": "./dist/out-tsc",
|
"outDir": "./dist/out-tsc",
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noImplicitOverride": true,
|
"noImplicitOverride": true,
|
||||||
"noPropertyAccessFromIndexSignature": true,
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
"downlevelIteration": true,
|
"downlevelIteration": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "es2020",
|
"module": "es2020",
|
||||||
"lib": [
|
"lib": ["es2020", "dom"],
|
||||||
"es2020",
|
"useDefineForClassFields": false
|
||||||
"dom"
|
},
|
||||||
],
|
"angularCompilerOptions": {
|
||||||
"useDefineForClassFields": false
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
},
|
"strictInjectionParameters": true,
|
||||||
"angularCompilerOptions": {
|
"strictInputAccessModifiers": true,
|
||||||
"enableI18nLegacyMessageIdFormat": false,
|
"strictTemplates": true
|
||||||
"strictInjectionParameters": true,
|
}
|
||||||
"strictInputAccessModifiers": true,
|
|
||||||
"strictTemplates": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user