13 Commits
v0.9 ... v1

Author SHA1 Message Date
b98d28adb4 Update welcome page (#5) 2021-06-14 22:09:33 -04:00
60ed7e1e79 Complete public search (#5)
- Bump version
- Define nav between profile and continent/skills
- Remove redundant code
2021-06-14 21:49:20 -04:00
fb147888c5 Add public search page / initial API (#5) 2021-04-07 21:49:22 -04:00
4a73927e64 Update README 2021-03-16 20:53:09 -04:00
93c99b430f Version bump 2021-03-16 20:14:34 -04:00
9e9b519c25 Fix toasts (#13) 2021-03-16 11:34:58 -04:00
d6f4628e1c Finish real name implementation (#12)
Load name from profile on page load, update user's "current" name once the page is saved
2021-02-07 17:09:43 -05:00
e63a12b774 Deconflict namespaces
Pluralize namespaces in client to keep from having to qualify domain namespace
2021-02-07 16:53:36 -05:00
8350d0bddf Add real name to profile form (#12) 2021-02-07 16:37:47 -05:00
1b2540e5d2 Add real name col / citizen name prop (#12)
Still need to work on allowing the column to be edited
2021-02-06 21:43:16 -05:00
21ba35408e Add TOS / Privacy Policy (#10)
Big hat tip to [you know who you are]
2021-02-06 21:15:21 -05:00
7784ee66ea Add deletion options (#9) 2021-02-06 17:54:06 -05:00
7c6804c2af Use username if display name is blank (#11) 2021-02-01 20:12:41 -05:00
54 changed files with 1194 additions and 150 deletions

View File

@@ -1,3 +1,5 @@
# jobs-jobs-jobs # Jobs, Jobs, Jobs <small>_(and Jobs - Let's Vote for Jobs!)_</small>
Repository for the development of No Agenda Jobs - currently parked [here](http://jobs.bitbadger.solutions) Source repository for **Jobs, Jobs, Jobs**, the jobs and career site for No Agenda nation.
What is No Agenda? [So glad you asked!](https://noagendashow.net)

2
src/.dockerignore Normal file
View File

@@ -0,0 +1,2 @@
**/bin
**/obj

10
src/Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /jjj
COPY . ./
WORKDIR /jjj/JobsJobsJobs/Server
RUN dotnet publish JobsJobsJobs.Server.csproj -c Release /p:PublishProfile=Properties/PublishProfiles/FolderProfile.xml
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /jjj
COPY --from=build /jjj/JobsJobsJobs/Server/bin/Release/net5.0/linux-x64/publish/ ./
ENTRYPOINT [ "/jjj/JobsJobsJobs.Server" ]

View File

@@ -11,7 +11,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JobsJobsJobs.Shared", "Jobs
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{50B51580-9F09-41E2-BC78-DAD38C37B583}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{50B51580-9F09-41E2-BC78-DAD38C37B583}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.dockerignore = .dockerignore
database\12-add-real-name.sql = database\12-add-real-name.sql
JobsJobsJobs\Directory.Build.props = JobsJobsJobs\Directory.Build.props JobsJobsJobs\Directory.Build.props = JobsJobsJobs\Directory.Build.props
Dockerfile = Dockerfile
database\tables.sql = database\tables.sql database\tables.sql = database\tables.sql
EndProjectSection EndProjectSection
EndProject EndProject

View File

@@ -22,7 +22,7 @@ namespace JobsJobsJobs.Client
/// <summary> /// <summary>
/// The application version, as a nice display string /// The application version, as a nice display string
/// </summary> /// </summary>
public static Lazy<string> Version => new Lazy<string>(() => public static Lazy<string> Version => new(() =>
{ {
var version = Assembly.GetExecutingAssembly().GetName().Version!; var version = Assembly.GetExecutingAssembly().GetName().Version!;
var display = $"v{version.Major}.{version.Minor}"; var display = $"v{version.Major}.{version.Minor}";

View File

@@ -3,6 +3,6 @@
@inject NavigationManager nav @inject NavigationManager nav
@inject AppState state @inject AppState state
<PageTitle Title="Logging in..." /> <PageTitle Title="Logging on..." />
<p>@Message</p> <p>@Message</p>

View File

@@ -2,7 +2,7 @@
using Microsoft.AspNetCore.WebUtilities; using Microsoft.AspNetCore.WebUtilities;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace JobsJobsJobs.Client.Pages.Citizen namespace JobsJobsJobs.Client.Pages.Citizens
{ {
public partial class Authorized : ComponentBase public partial class Authorized : ComponentBase
{ {

View File

@@ -11,7 +11,7 @@
{ {
<p> <p>
Your employment profile was last updated <FullDateTime TheDate=@Profile.LastUpdatedOn />. Your profile currently Your employment profile was last updated <FullDateTime TheDate=@Profile.LastUpdatedOn />. Your profile currently
lists @Profile.Skills.Length skill@(Profile.Skills.Length != 1 ? "s" : ""). lists @Profile.Skills.Count skill@(Profile.Skills.Count != 1 ? "s" : "").
</p> </p>
<p><a href="/profile/view/@state.User.Id">View Your Employment Profile</a></p> <p><a href="/profile/view/@state.User.Id">View Your Employment Profile</a></p>
@if (Profile.SeekingEmployment) @if (Profile.SeekingEmployment)
@@ -41,7 +41,6 @@
</Loading> </Loading>
<hr> <hr>
<p> <p>
To see what is currently done, and how this application works, check out &ldquo;How It Works&rdquo; in the sidebar. To see how this application works, check out &ldquo;How It Works&rdquo; in the sidebar (last updated June
The application now has 4 of 5 phases complete towards version 1.0; the documentation was last updated January 14<sup>th</sup>, 2021).
31<sup>st</sup>, 2021.
</p> </p>

View File

@@ -1,10 +1,10 @@
using JobsJobsJobs.Shared.Api; using JobsJobsJobs.Shared;
using JobsJobsJobs.Shared.Api;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Domain = JobsJobsJobs.Shared;
namespace JobsJobsJobs.Client.Pages.Citizen namespace JobsJobsJobs.Client.Pages.Citizens
{ {
/// <summary> /// <summary>
/// The first page a user sees after signing in /// The first page a user sees after signing in
@@ -14,7 +14,7 @@ namespace JobsJobsJobs.Client.Pages.Citizen
/// <summary> /// <summary>
/// The user's profile /// The user's profile
/// </summary> /// </summary>
private Domain.Profile? Profile { get; set; } = null; private Profile? Profile { get; set; } = null;
/// <summary> /// <summary>
/// The number of profiles /// The number of profiles

View File

@@ -11,6 +11,16 @@
<Loading OnLoad=@SetUpProfile Message=@(new MarkupString("Loading Your Profile&hellip;"))> <Loading OnLoad=@SetUpProfile Message=@(new MarkupString("Loading Your Profile&hellip;"))>
<EditForm Model=@ProfileForm OnValidSubmit=@SaveProfile> <EditForm Model=@ProfileForm OnValidSubmit=@SaveProfile>
<DataAnnotationsValidator /> <DataAnnotationsValidator />
<div class="form-row">
<div class="col col-xs-12 col-sm-10 col-md-8 col-lg-6">
<div class="form-group">
<label for="realName" class="jjj-label">Real Name</label>
<InputText id="realName" @bind-Value=@ProfileForm.RealName class="form-control"
placeholder="Leave blank to use your NAS display name" />
<ValidationMessage For=@(() => ProfileForm.RealName) />
</div>
</div>
</div>
<div class="form-row"> <div class="form-row">
<div class="col"> <div class="col">
<div class="form-check"> <div class="form-check">
@@ -115,4 +125,8 @@
<br><a href="/profile/view/@state.User!.Id"><span class="oi oi-file"></span> View Your User Profile</a> <br><a href="/profile/view/@state.User!.Id"><span class="oi oi-file"></span> View Your User Profile</a>
</p> </p>
} }
<p>
<br>If you want to delete your profile, or your entire account,
<a href="/so-long/options">see your deletion options here</a>.
</p>
</Loading> </Loading>

View File

@@ -6,7 +6,7 @@ using System.Linq;
using System.Net.Http.Json; using System.Net.Http.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace JobsJobsJobs.Client.Pages.Citizen namespace JobsJobsJobs.Client.Pages.Citizens
{ {
/// <summary> /// <summary>
/// Profile edit page (called EditProfile so as not to create naming conflicts) /// Profile edit page (called EditProfile so as not to create naming conflicts)
@@ -48,8 +48,9 @@ namespace JobsJobsJobs.Client.Pages.Citizen
ServerApi.SetJwt(http, state); ServerApi.SetJwt(http, state);
var continentTask = state.GetContinents(http); var continentTask = state.GetContinents(http);
var profileTask = ServerApi.RetrieveProfile(http, state); var profileTask = ServerApi.RetrieveProfile(http, state);
var citizenTask = ServerApi.RetrieveOne<Citizen>(http, $"citizen/get/{state.User!.Id}");
await Task.WhenAll(continentTask, profileTask); await Task.WhenAll(continentTask, profileTask, citizenTask);
Continents = continentTask.Result; Continents = continentTask.Result;
@@ -71,6 +72,15 @@ namespace JobsJobsJobs.Client.Pages.Citizen
{ {
errors.Add(profileTask.Result.Error); errors.Add(profileTask.Result.Error);
} }
if (citizenTask.Result.IsOk)
{
ProfileForm.RealName = citizenTask.Result.Ok!.RealName ?? "";
}
else
{
errors.Add(citizenTask.Result.Error);
}
} }
/// <summary> /// <summary>
@@ -98,12 +108,22 @@ namespace JobsJobsJobs.Client.Pages.Citizen
foreach (var blankSkill in blankSkills) ProfileForm.Skills.Remove(blankSkill); foreach (var blankSkill in blankSkills) ProfileForm.Skills.Remove(blankSkill);
var res = await http.PostAsJsonAsync("/api/profile/save", ProfileForm); var res = await http.PostAsJsonAsync("/api/profile/save", ProfileForm);
if (res.IsSuccessStatusCode) if (res.IsSuccessStatusCode && state.User != null)
{ {
var citizen = await ServerApi.RetrieveOne<Citizen>(http, $"citizen/get/{state.User.Id}");
if (citizen.IsOk)
{
state.User = state.User with { Name = citizen.Ok!.CitizenName };
toast.ShowSuccess("Profile Saved Successfully"); toast.ShowSuccess("Profile Saved Successfully");
nav.NavigateTo($"/profile/view/{state.User!.Id}"); nav.NavigateTo($"/profile/view/{state.User!.Id}");
} }
else else
{
toast.ShowError(citizen.Error);
}
}
else
{ {
var error = await res.Content.ReadAsStringAsync(); var error = await res.Content.ReadAsStringAsync();
if (!string.IsNullOrEmpty(error)) error = $"- {error}"; if (!string.IsNullOrEmpty(error)) error = $"- {error}";

View File

@@ -4,18 +4,6 @@
<h3>How It Works</h3> <h3>How It Works</h3>
<p>
Phase 4 is complete, which means that the entire logged-in version of the application is now available. There are
GitHub issues for each one
(<a href="https://github.com/bit-badger/jobs-jobs-jobs/issues/1" target="_blank">Phase 1</a> &bull;
<a href="https://github.com/bit-badger/jobs-jobs-jobs/issues/2" target="_blank">Phase 2</a> &bull;
<a href="https://github.com/bit-badger/jobs-jobs-jobs/issues/3" target="_blank">Phase 3</a> &bull;
<a href="https://github.com/bit-badger/jobs-jobs-jobs/issues/4" target="_blank">Phase 4</a>), and if you run into any
issues with it, feel free to
<a href="https://github.com/bit-badger/jobs-jobs-jobs/issues" target="_blank">let us know on GitHub</a>, or look up
@("@")danieljsummers on No Agenda Social.
</p>
<h4>Completing Your Profile</h4> <h4>Completing Your Profile</h4>
<ul> <ul>
<li> <li>
@@ -44,11 +32,10 @@
would like it presented to fellow citizens. would like it presented to fellow citizens.
</li> </li>
<li> <li>
<a href="https://github.com/bit-badger/jobs-jobs-jobs/issues/5" target="_blank">Phase 5</a> includes allowing If you check the &ldquo;Allow my profile to be searched publicly&rdquo; checkbox, <strong>and</strong> you are
public access to the continent, region, and skills fields of Gitmo Nation citizens who indicate that they are both seeking employment, your continent, region, and skills fields will be searchable and displayed to public users of
seeking employment <strong>and</strong> want their information disclosed to public users. The &ldquo;Allow my the site. They will not be tied to your No Agenda Social handle or real name; they are there to let people peek
profile to be searched publicly&rdquo; checkbox, at the bottom of the page where you edit your employment profile, behind the curtain a bit, and hopefully inspire them to join us.
is how you opt your profile in to this list.
</li> </li>
</ul> </ul>
@@ -77,19 +64,18 @@
to read it; if you submitted the story, there will also be an &ldquo;Edit&rdquo; link. to read it; if you submitted the story, there will also be an &ldquo;Edit&rdquo; link.
</p> </p>
<h4> <h4>Publicly Available Information</h4>
Publicly Available Information
<em><small>(coming in <a href="https://github.com/bit-badger/jobs-jobs-jobs/issues/5" target="_blank">Phase 5</a>)</small></em>
</h4>
<p> <p>
The &ldquo;public&rdquo; page for profile information will display the following information: The &ldquo;Job Seekers&rdquo; page for profile information will allow users to search for and display the continent,
region, skills, and notes of users who are seeking employment <strong>and</strong> have opted in to their information
being publicly searchable. If you are a public user, this information is always the latest we have; check out the link
at the top of the search results for how you can learn more about these fine human resources!
</p> </p>
<ul>
<li>A count of profiles where the citizen is seeking employment</li> <h4>Help / Suggestions</h4>
<li>The citizen&rsquo;s continent and region</li>
<li>The citizen&rsquo;s skills and notes</li>
</ul>
<p> <p>
This information will be pullled only from profiles where citizens have said can it be publicly available This is open-source software
<strong>and</strong> are currently seeking employment. <a href="https://github.com/bit-badger/jobs-jobs-jobs" _target="_blank">developed on Github</a>; feel free to
<a href="https://github.com/bit-badger/jobs-jobs-jobs/issues" target="_blank">create an issue there</a>, or look up
@("@")danieljsummers on No Agenda Social.
</p> </p>

View File

@@ -4,8 +4,8 @@
<PageTitle Title="Welcome!" /> <PageTitle Title="Welcome!" />
<p> <p>
Future home of No Agenda Jobs, where citizens of Gitmo Nation can assist one another in finding or enhancing their Welcome to Jobs, Jobs, Jobs (AKA No Agenda Careers), where citizens of Gitmo Nation can assist one another in finding
employment. This will enable them to continue providing value for value to Adam and John, as they continue their work employment. This will enable them to continue providing value-for-value to Adam and John, as they continue their work
deconstructing the misinformation that passes for news on a day-to-day basis. deconstructing the misinformation that passes for news on a day-to-day basis.
</p> </p>
<p> <p>

View File

@@ -0,0 +1,413 @@
@page "/privacy-policy"
<PageTitle Title="Privacy Policy" />
<h3>Privacy Policy</h3>
<p><em>(as of February 6<sup>th</sup>, 2021)</em></p>
<p>
@Name (“we,” “our,” or “us”) is committed to protecting your privacy. This Privacy Policy explains how your personal
information is collected, used, and disclosed by @Name.
</p>
<p>
This Privacy Policy applies to our website, and its associated subdomains (collectively, our “Service”) alongside
our application, @Name. By accessing or using our Service, you signify that you have read, understood, and agree to
our collection, storage, use, and disclosure of your personal information as described in this Privacy Policy and our
Terms of Service.
</p>
<h4>Definitions and key terms</h4>
<p>
To help explain things as clearly as possible in this Privacy Policy, every time any of these terms are referenced,
are strictly defined as:
</p>
<ul>
<li>
Cookie: small amount of data generated by a website and saved by your web browser. It is used to identify your
browser, provide analytics, remember information about you such as your language preference or login information.
</li>
<li>
Company: when this policy mentions “Company,” “we,” “us,” or “our,” it refers to @Name, that is responsible for
your information under this Privacy Policy.
</li>
<li>Country: where @Name or the owners/founders of @Name are based, in this case is US.</li>
<li>
Customer: refers to the company, organization or person that signs up to use the @Name Service to manage the
relationships with your consumers or service users.
</li>
<li>
Device: any internet connected device such as a phone, tablet, computer or any other device that can be used to
visit @Name and use the services.
</li>
<li>
IP address: Every device connected to the Internet is assigned a number known as an Internet protocol (IP) address.
These numbers are usually assigned in geographic blocks. An IP address can often be used to identify the location
from which a device is connecting to the Internet.
</li>
<li>
Personnel: refers to those individuals who are employed by @Name or are under contract to perform a service on
behalf of one of the parties.
</li>
<li>
Personal Data: any information that directly, indirectly, or in connection with other information — including a
personal identification number — allows for the identification or identifiability of a natural person.
</li>
<li>
Service: refers to the service provided by @Name as described in the relative terms (if available) and on this
platform.
</li>
<li>
Third-party service: refers to advertisers, contest sponsors, promotional and marketing partners, and others who
provide our content or whose products or services we think may interest you.
</li>
<li>
Website: @Name&rsquo;s site, which can be accessed via this URL: <a href="/">https://noagendacareers.com/</a>
</li>
<li>You: a person or entity that is registered with @Name to use the Services.</li>
</ul>
<h4>What Information Do We Collect?</h4>
<p>
We collect information from you when you visit our website, register on our site, or fill out a form.
</p>
<ul>
<li>Name / Username</li>
<li>Coarse Geographic Location</li>
<li>Employment History</li>
<li>No Agenda Social Account Name / Profile</li>
</ul>
<h4>How Do We Use The Information We Collect?</h4>
<p>
Any of the information we collect from you may be used in one of the following ways:
</p>
<ul>
<li>To personalize your experience (your information helps us to better respond to your individual needs)</li>
<li>
To improve our website (we continually strive to improve our website offerings based on the information and
feedback we receive from you)
</li>
<li>
To improve customer service (your information helps us to more effectively respond to your customer service
requests and support needs)
</li>
</ul>
<h4>When does @Name use end user information from third parties?</h4>
<p>@Name will collect End User Data necessary to provide the @Name services to our customers.</p>
<p>
End users may voluntarily provide us with information they have made available on social media websites (specifically
No Agenda Social). If you provide us with any such information, we may collect publicly available information from
the social media websites you have indicated. You can control how much of your information social media websites make
public by visiting these websites and changing your privacy settings.
</p>
<h4>When does @Name use customer information from third parties?</h4>
<p>We do not utilize third party information apart from the end-user data described above.</p>
<h4>Do we share the information we collect with third parties?</h4>
<p>
We may disclose personal and non-personal information about you to government or law enforcement officials or private
parties as we, in our sole discretion, believe necessary or appropriate in order to respond to claims, legal process
(including subpoenas), to protect our rights and interests or those of a third party, the safety of the public or any
person, to prevent or stop any illegal, unethical, or legally actionable activity, or to otherwise comply with
applicable court orders, laws, rules and regulations.
</p>
<h4>Where and when is information collected from customers and end users?</h4>
<p>
@Name will collect personal information that you submit to us. We may also receive personal information about you
from third parties as described above.
</p>
<h4>How Do We Use Your E-mail Address?</h4>
<p>
We do not collect nor use an e-mail address. If you have provided it in the free text areas of the site, other
validated users may be able to view it, but @Name does not search for nor utilize e-mail addresses from those areas.
</p>
<h4>How Long Do We Keep Your Information?</h4>
<p>
We keep your information only so long as we need it to provide @Name to you and fulfill the purposes described in
this policy. When we no longer need to use your information and there is no need for us to keep it to comply with our
legal or regulatory obligations, well either remove it from our systems or depersonalize it so that we can&rsquo;t
identify you.
</p>
<h4>How Do We Protect Your Information?</h4>
<p>
We implement a variety of security measures to maintain the safety of your personal information when you enter,
submit, or access your personal information. We mandate the use of a secure server. We cannot, however, ensure or
warrant the absolute security of any information you transmit to @Name or guarantee that your information on the
Service may not be accessed, disclosed, altered, or destroyed by a breach of any of our physical, technical, or
managerial safeguards.
</p>
<h4>Could my information be transferred to other countries?</h4>
<p>
@Name is hosted in the US. Information collected via our website may be viewed and hosted anywhere in the world,
including countries that may not have laws of general applicability regulating the use and transfer of such data. To
the fullest extent allowed by applicable law, by using any of the above, you voluntarily consent to the trans-border
transfer and hosting of such information.
</p>
<h4>Is the information collected through the @Name Service secure?</h4>
<p>
We take precautions to protect the security of your information. We have physical, electronic, and managerial
procedures to help safeguard, prevent unauthorized access, maintain data security, and correctly use your
information. However, neither people nor security systems are foolproof, including encryption systems. In addition,
people can commit intentional crimes, make mistakes, or fail to follow policies. Therefore, while we use reasonable
efforts to protect your personal information, we cannot guarantee its absolute security. If applicable law imposes
any non-disclaimable duty to protect your personal information, you agree that intentional misconduct will be the
standards used to measure our compliance with that duty.
</p>
<h4>Can I update or correct my information?</h4>
<p>
The rights you have to request updates or corrections to the information @Name collects depend on your relationship
with @Name.
</p>
<p>
Customers have the right to request the restriction of certain uses and disclosures of personally identifiable
information as follows. You can contact us in order to (1) update or correct your personally identifiable
information, or (3) delete the personally identifiable information maintained about you on our systems (subject to
the following paragraph), by cancelling your account. Such updates, corrections, changes and deletions will have no
effect on other information that we maintain in accordance with this Privacy Policy prior to such update, correction,
change, or deletion. You are responsible for maintaining the secrecy of your unique password and account information
at all times.
</p>
<p>
@Name also provides ways for users to modify or remove the information we have collected from them from the
application; these actions will have the same effect as contacting us to modify or remove data.
</p>
<p>
You should be aware that it is not technologically possible to remove each and every record of the information you
have provided to us from our system. The need to back up our systems to protect information from inadvertent loss
means that a copy of your information may exist in a non-erasable form that will be difficult or impossible for us to
locate. Promptly after receiving your request, all personal information stored in databases we actively use, and
other readily searchable media will be updated, corrected, changed, or deleted, as appropriate, as soon as and to the
extent reasonably and technically practicable.
</p>
<p>
If you are an end user and wish to update, delete, or receive any information we have about you, you may do so by
contacting the organization of which you are a customer.
</p>
<h4>Governing Law</h4>
<p>
This Privacy Policy is governed by the laws of US without regard to its conflict of laws provision. You consent to
the exclusive jurisdiction of the courts in connection with any action or dispute arising between the parties under
or in connection with this Privacy Policy except for those individuals who may have rights to make claims under
Privacy Shield, or the Swiss-US framework.
</p>
<p>
The laws of US, excluding its conflicts of law rules, shall govern this Agreement and your use of the website. Your
use of the website may also be subject to other local, state, national, or international laws.
</p>
<p>
By using @Name or contacting us directly, you signify your acceptance of this Privacy Policy. If you do not agree to
this Privacy Policy, you should not engage with our website, or use our services. Continued use of the website,
direct engagement with us, or following the posting of changes to this Privacy Policy that do not significantly
affect the use or disclosure of your personal information will mean that you accept those changes.
</p>
<h4>Your Consent</h4>
<p>
We&rsquo;ve updated our Privacy Policy to provide you with complete transparency into what is being set when you
visit our site and how it&rsquo;s being used. By using our website, registering an account, or making a purchase, you
hereby consent to our Privacy Policy and agree to its terms.
</p>
<h4>Links to Other Websites</h4>
<p>
This Privacy Policy applies only to the Services. The Services may contain links to other websites not operated or
controlled by @Name. We are not responsible for the content, accuracy or opinions expressed in such websites, and
such websites are not investigated, monitored or checked for accuracy or completeness by us. Please remember that
when you use a link to go from the Services to another website, our Privacy Policy is no longer in effect. Your
browsing and interaction on any other website, including those that have a link on our platform, is subject to that
websites own rules and policies. Such third parties may use their own cookies or other methods to collect
information about you.
</p>
<h4>Cookies</h4>
<p>@Name does not use Cookies.</p>
<h4>Kids' Privacy</h4>
<p>
We do not address anyone under the age of 13. We do not knowingly collect personally identifiable information from
anyone under the age of 13. If You are a parent or guardian and You are aware that Your child has provided Us with
Personal Data, please contact Us. If We become aware that We have collected Personal Data from anyone under the age
of 13 without verification of parental consent, We take steps to remove that information from Our servers.
</p>
<h4>Changes To Our Privacy Policy</h4>
<p>
We may change our Service and policies, and we may need to make changes to this Privacy Policy so that they
accurately reflect our Service and policies. Unless otherwise required by law, we will notify you (for example,
through our Service) before we make changes to this Privacy Policy and give you an opportunity to review them before
they go into effect. Then, if you continue to use the Service, you will be bound by the updated Privacy Policy. If
you do not want to agree to this or any updated Privacy Policy, you can delete your account.
</p>
<h4>Third-Party Services</h4>
<p>
We may display, include or make available third-party content (including data, information, applications and other
products services) or provide links to third-party websites or services (&ldquo;Third-Party Services&rdquo;).
</p>
<p>
You acknowledge and agree that @Name shall not be responsible for any Third-Party Services, including their accuracy,
completeness, timeliness, validity, copyright compliance, legality, decency, quality or any other aspect thereof.
@Name does not assume and shall not have any liability or responsibility to you or any other person or entity for any
Third-Party Services.
</p>
<p>
Third-Party Services and links thereto are provided solely as a convenience to you and you access and use them
entirely at your own risk and subject to such third parties' terms and conditions.
</p>
<h4>Tracking Technologies</h4>
<p>
@Name does not use any tracking technologies. When an authorization code is received from No Agenda Social, that
token is stored in the browser&rsquo;s memory, and the Service uses tokens on each request for data. If the page is
refreshed or the browser window/tab is closed, this token disappears, and a new one must be generated before the
application can be used again.
</p>
<h4>Information about General Data Protection Regulation (GDPR)</h4>
<p>
We may be collecting and using information from you if you are from the European Economic Area (EEA), and in this
section of our Privacy Policy we are going to explain exactly how and why is this data collected, and how we maintain
this data under protection from being replicated or used in the wrong way.
</p>
<h4>What is GDPR?</h4>
<p>
GDPR is an EU-wide privacy and data protection law that regulates how EU residents&rsquo; data is protected by
companies and enhances the control the EU residents have, over their personal data.
</p>
<p>
The GDPR is relevant to any globally operating company and not just the EU-based businesses and EU residents. Our
customers data is important irrespective of where they are located, which is why we have implemented GDPR controls
as our baseline standard for all our operations worldwide.
</p>
<h4>What is personal data?</h4>
<p>
Any data that relates to an identifiable or identified individual. GDPR covers a broad spectrum of information that
could be used on its own, or in combination with other pieces of information, to identify a person. Personal data
extends beyond a persons name or email address. Some examples include financial information, political opinions,
genetic data, biometric data, IP addresses, physical address, sexual orientation, and ethnicity.
</p>
<p>The Data Protection Principles include requirements such as:</p>
<ul>
<li>
Personal data collected must be processed in a fair, legal, and transparent way and should only be used in a way
that a person would reasonably expect.
</li>
<li>
Personal data should only be collected to fulfil a specific purpose and it should only be used for that purpose.
Organizations must specify why they need the personal data when they collect it.
</li>
<li>Personal data should be held no longer than necessary to fulfil its purpose.</li>
<li>
People covered by the GDPR have the right to access their own personal data. They can also request a copy of their
data, and that their data be updated, deleted, restricted, or moved to another organization.
</li>
</ul>
<h4>Why is GDPR important?</h4>
<p>
GDPR adds some new requirements regarding how companies should protect individuals&rsquo; personal data that they
collect and process. It also raises the stakes for compliance by increasing enforcement and imposing greater fines
for breach. Beyond these facts, it&rsquo;s simply the right thing to do. At @Name we strongly believe that your data
privacy is very important and we already have solid security and privacy practices in place that go beyond the
requirements of this regulation.
</p>
<h4>Individual Data Subject&rsquo;s Rights - Data Access, Portability, and Deletion</h4>
<p>
We are committed to helping our customers meet the data subject rights requirements of GDPR. @Name processes or
stores all personal data in fully vetted, DPA compliant vendors. We do store all conversation and personal data for
up to 6 years unless your account is deleted. In which case, we dispose of all data in accordance with our Terms of
Service and Privacy Policy, but we will not hold it longer than 60 days.
</p>
<p>
We are aware that if you are working with EU customers, you need to be able to provide them with the ability to
access, update, retrieve and remove personal data. We got you! We've been set up as self service from the start and
have always given you access to your data. Our customer support team is here for you to answer any questions you
might have about working with the API.
</p>
<h4>California Residents</h4>
<p>
The California Consumer Privacy Act (CCPA) requires us to disclose categories of Personal Information we collect and
how we use it, the categories of sources from whom we collect Personal Information, and the third parties with whom
we share it, which we have explained above.
</p>
<p>
We are also required to communicate information about rights California residents have under California law. You may
exercise the following rights:
</p>
<ul>
<li>
Right to Know and Access. You may submit a verifiable request for information regarding the: (1) categories of
Personal Information we collect, use, or share; (2) purposes for which categories of Personal Information are
collected or used by us; (3) categories of sources from which we collect Personal Information; and (4) specific
pieces of Personal Information we have collected about you.
</li>
<li>Right to Equal Service. We will not discriminate against you if you exercise your privacy rights.</li>
<li>
Right to Delete. You may submit a verifiable request to close your account and we will delete Personal Information
about you that we have collected.
</li>
<li>Request that a business that sells a consumer's personal data, not sell the consumer's personal data.</li>
</ul>
<p>
If you make a request, we have one month to respond to you. If you would like to exercise any of these rights, please
contact us.
</p>
<p>We do not sell the Personal Information of our users.</p>
<p>For more information about these rights, please contact us.</p>
<h4>California Online Privacy Protection Act (CalOPPA)</h4>
<p>
CalOPPA requires us to disclose categories of Personal Information we collect and how we use it, the categories of
sources from whom we collect Personal Information, and the third parties with whom we share it, which we have
explained above.
</p>
<p>CalOPPA users have the following rights:</p>
<ul>
<li>
Right to Know and Access. You may submit a verifiable request for information regarding the: (1) categories of
Personal Information we collect, use, or share; (2) purposes for which categories of Personal Information are
collected or used by us; (3) categories of sources from which we collect Personal Information; and (4) specific
pieces of Personal Information we have collected about you.
</li>
<li>Right to Equal Service. We will not discriminate against you if you exercise your privacy rights.</li>
<li>
Right to Delete. You may submit a verifiable request to close your account and we will delete Personal Information
about you that we have collected.
</li>
<li>Right to request that a business that sells a consumer's personal data, not sell the consumer's personal data.</li>
</ul>
<p>
If you make a request, we have one month to respond to you. If you would like to exercise any of these rights, please
contact us.
</p>
<p>We do not sell the Personal Information of our users.</p>
<p>For more information about these rights, please contact us.</p>
<h4>Contact Us</h4>
<p>Don't hesitate to contact us if you have any questions.</p>
<ul>
<li>Via this Link: <a href="/how-it-works">https://noagendacareers.com/how-it-works</a></li>
</ul>
@code {
/// <summary>
/// The name of the application
/// </summary>
private string Name = "Jobs, Jobs, Jobs";
}

View File

@@ -5,10 +5,9 @@ using Microsoft.AspNetCore.WebUtilities;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace JobsJobsJobs.Client.Pages.Profile namespace JobsJobsJobs.Client.Pages.Profiles
{ {
public partial class Search : ComponentBase public partial class Search : ComponentBase
{ {
@@ -56,10 +55,10 @@ namespace JobsJobsJobs.Client.Pages.Profile
{ {
if (query.TryGetValue(part, out var partValue)) func(partValue); if (query.TryGetValue(part, out var partValue)) func(partValue);
} }
setPart("ContinentId", x => Criteria.ContinentId = x); setPart(nameof(Criteria.ContinentId), x => Criteria.ContinentId = x);
setPart("Skill", x => Criteria.Skill = x); setPart(nameof(Criteria.Skill), x => Criteria.Skill = x);
setPart("BioExperience", x => Criteria.BioExperience = x); setPart(nameof(Criteria.BioExperience), x => Criteria.BioExperience = x);
setPart("RemoteWork", x => Criteria.RemoteWork = x); setPart(nameof(Criteria.RemoteWork), x => Criteria.RemoteWork = x);
await RetrieveProfiles(); await RetrieveProfiles();
} }
@@ -100,6 +99,11 @@ namespace JobsJobsJobs.Client.Pages.Profile
Searching = false; Searching = false;
} }
/// <summary>
/// Return a CSS class if the user is actively seeking work
/// </summary>
/// <param name="profile">The result in question</param>
/// <returns>A string with the appropriate CSS class, if actively seeking work</returns>
private static string? IsSeeking(ProfileSearchResult profile) => private static string? IsSeeking(ProfileSearchResult profile) =>
profile.SeekingEmployment ? "font-weight-bold" : null; profile.SeekingEmployment ? "font-weight-bold" : null;
@@ -124,10 +128,10 @@ namespace JobsJobsJobs.Client.Pages.Profile
if (!string.IsNullOrEmpty(func(Criteria))) dict.Add(name, func(Criteria)); if (!string.IsNullOrEmpty(func(Criteria))) dict.Add(name, func(Criteria));
} }
part("ContinentId", it => it.ContinentId); part(nameof(Criteria.ContinentId), it => it.ContinentId);
part("Skill", it => it.Skill); part(nameof(Criteria.Skill), it => it.Skill);
part("BioExperience", it => it.BioExperience); part(nameof(Criteria.BioExperience), it => it.BioExperience);
part("RemoteWork", it => it.RemoteWork); part(nameof(Criteria.RemoteWork), it => it.RemoteWork);
return dict; return dict;
} }

View File

@@ -0,0 +1,62 @@
@page "/profile/seeking"
@inject HttpClient http
@inject NavigationManager nav
@inject AppState state
<PageTitle Title="People Seeking Work" />
<h3>People Seeking Work</h3>
<ErrorList Errors=@ErrorMessages>
@if (Searching)
{
<p>Searching profiles...</p>
}
else
{
if (!Searched)
{
<p>Enter one or more criteria to filter results, or just click &ldquo;Search&rdquo; to list all profiles.</p>
}
<Collapsible HeaderText="Search Criteria" Collapsed=@(Searched && SearchResults.Any())>
<PublicSearchForm Criteria=@Criteria OnSearch=@DoSearch Continents=@Continents />
</Collapsible>
<br>
@if (SearchResults.Any())
{
<p>
These profiles match your search criteria. To learn more about these people, join the merry band of human
resources in the <a href="https://noagendashow.net" target="_blank">No Agenda</a> tribe!
</p>
<table class="table table-sm table-hover">
<thead>
<tr>
<th scope="col">Continent</th>
<th scope="col" class="text-center">Region</th>
<th scope="col" class="text-center">Remote?</th>
<th scope="col" class="text-center">Skills</th>
</tr>
</thead>
<tbody>
@foreach (var profile in SearchResults)
{
<tr>
<td>@profile.Continent</td>
<td>@profile.Region</td>
<td class="text-center">@YesOrNo(profile.RemoteWork)</td>
<td>
@foreach (var skill in profile.Skills)
{
@skill.Replace(" ()", "")<br>
}
</td>
</tr>
}
</tbody>
</table>
}
else if (Searched)
{
<p>No results found for the specified criteria</p>
}
}
</ErrorList>

View File

@@ -0,0 +1,134 @@
using JobsJobsJobs.Shared;
using JobsJobsJobs.Shared.Api;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.WebUtilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace JobsJobsJobs.Client.Pages.Profiles
{
public partial class Seeking : ComponentBase
{
/// <summary>
/// Whether a search has been performed
/// </summary>
private bool Searched { get; set; } = false;
/// <summary>
/// Indicates whether a request for matching profiles is in progress
/// </summary>
private bool Searching { get; set; } = false;
/// <summary>
/// The search criteria
/// </summary>
private PublicSearch Criteria { get; set; } = new PublicSearch();
/// <summary>
/// Error messages encountered while searching for profiles
/// </summary>
private IList<string> ErrorMessages { get; } = new List<string>();
/// <summary>
/// All continents
/// </summary>
private IEnumerable<Continent> Continents { get; set; } = Enumerable.Empty<Continent>();
/// <summary>
/// The search results
/// </summary>
private IEnumerable<PublicSearchResult> SearchResults { get; set; } = Enumerable.Empty<PublicSearchResult>();
protected override async Task OnInitializedAsync()
{
Continents = await state.GetContinents(http);
// Determine if we have searched before
var query = QueryHelpers.ParseQuery(nav.ToAbsoluteUri(nav.Uri).Query);
if (query.TryGetValue("Searched", out var searched))
{
Searched = Convert.ToBoolean(searched);
void setPart(string part, Action<string> func)
{
if (query.TryGetValue(part, out var partValue)) func(partValue);
}
setPart(nameof(Criteria.ContinentId), x => Criteria.ContinentId = x);
setPart(nameof(Criteria.Region), x => Criteria.Region = x);
setPart(nameof(Criteria.Skill), x => Criteria.Skill = x);
setPart(nameof(Criteria.RemoteWork), x => Criteria.RemoteWork = x);
await RetrieveProfiles();
}
}
/// <summary>
/// Do a search
/// </summary>
/// <remarks>This navigates with the parameters in the URL; this should trigger a search</remarks>
private async Task DoSearch()
{
var query = SearchQuery();
query.Add("Searched", "True");
nav.NavigateTo(QueryHelpers.AddQueryString("/profile/seeking", query));
await RetrieveProfiles();
}
/// <summary>
/// Retreive profiles matching the current search criteria
/// </summary>
private async Task RetrieveProfiles()
{
Searching = true;
var searchResult = await ServerApi.RetrieveMany<PublicSearchResult>(http,
QueryHelpers.AddQueryString("profile/public-search", SearchQuery()));
if (searchResult.IsOk)
{
SearchResults = searchResult.Ok;
}
else
{
ErrorMessages.Add(searchResult.Error);
}
Searched = true;
Searching = false;
}
private static string? IsSeeking(ProfileSearchResult profile) =>
profile.SeekingEmployment ? "font-weight-bold" : null;
/// <summary>
/// Return "Yes" for true and "No" for false
/// </summary>
/// <param name="condition">The condition in question</param>
/// <returns>"Yes" for true, "No" for false</returns>
private static string YesOrNo(bool condition) => condition ? "Yes" : "No";
/// <summary>
/// Create a search query string from the currently-entered criteria
/// </summary>
/// <returns>The query string for the currently-entered criteria</returns>
private IDictionary<string, string?> SearchQuery()
{
var dict = new Dictionary<string, string?>();
if (Criteria.IsEmptySearch) return dict;
void part(string name, Func<PublicSearch, string?> func)
{
if (!string.IsNullOrEmpty(func(Criteria))) dict.Add(name, func(Criteria));
}
part(nameof(Criteria.ContinentId), it => it.ContinentId);
part(nameof(Criteria.Region), it => it.Region);
part(nameof(Criteria.Skill), it => it.Skill);
part(nameof(Criteria.RemoteWork), it => it.RemoteWork);
return dict;
}
}
}

View File

@@ -3,8 +3,8 @@
@inject AppState state @inject AppState state
<Loading OnLoad=@RetrieveProfile> <Loading OnLoad=@RetrieveProfile>
<PageTitle Title=@($"Employment Profile for {Citizen.DisplayName}") /> <PageTitle Title=@($"Employment Profile for {Citizen.CitizenName}") />
<h2><a href="@Citizen.ProfileUrl" target="_blank">@Citizen.DisplayName</a></h2> <h2><a href="@Citizen.ProfileUrl" target="_blank">@Citizen.CitizenName</a></h2>
<h4>@Profile.Continent!.Name, @Profile.Region</h4> <h4>@Profile.Continent!.Name, @Profile.Region</h4>
<p>@WorkTypes</p> <p>@WorkTypes</p>
@@ -15,7 +15,7 @@
</div> </div>
@if (Profile.Skills.Length > 0) @if (Profile.Skills.Count > 0)
{ {
<hr> <hr>
<h4>Skills</h4> <h4>Skills</h4>

View File

@@ -1,21 +1,21 @@
using Microsoft.AspNetCore.Components; using JobsJobsJobs.Shared;
using Microsoft.AspNetCore.Components;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Domain = JobsJobsJobs.Shared;
namespace JobsJobsJobs.Client.Pages.Profile namespace JobsJobsJobs.Client.Pages.Profiles
{ {
public partial class View : ComponentBase public partial class View : ComponentBase
{ {
/// <summary> /// <summary>
/// The citizen whose profile is being displayed /// The citizen whose profile is being displayed
/// </summary> /// </summary>
private Domain.Citizen Citizen { get; set; } = default!; private Citizen Citizen { get; set; } = default!;
/// <summary> /// <summary>
/// The profile to display /// The profile to display
/// </summary> /// </summary>
private Domain.Profile Profile { get; set; } = default!; private Profile Profile { get; set; } = default!;
/// <summary> /// <summary>
/// The work types for the top of the page /// The work types for the top of the page
@@ -55,8 +55,8 @@ namespace JobsJobsJobs.Client.Pages.Profile
public async Task RetrieveProfile(ICollection<string> errors) public async Task RetrieveProfile(ICollection<string> errors)
{ {
ServerApi.SetJwt(http, state); ServerApi.SetJwt(http, state);
var citizenTask = ServerApi.RetrieveOne<Domain.Citizen>(http, $"citizen/get/{Id}"); var citizenTask = ServerApi.RetrieveOne<Citizen>(http, $"citizen/get/{Id}");
var profileTask = ServerApi.RetrieveOne<Domain.Profile>(http, $"profile/get/{Id}"); var profileTask = ServerApi.RetrieveOne<Profile>(http, $"profile/get/{Id}");
await Task.WhenAll(citizenTask, profileTask); await Task.WhenAll(citizenTask, profileTask);

View File

@@ -0,0 +1,39 @@
@page "/so-long/options"
@inject HttpClient http
@inject AppState state
@inject NavigationManager nav
@inject IToastService toast
<PageTitle Title="Account Deletion Options" />
<h3>Account Deletion Options</h3>
<h4>Option 1 &ndash; Delete Your Profile</h4>
<p>
Utilizing this option will remove your current employment profile and skills. This will preserve any success stories
you may have written, and preserves this application&rsquo;s knowledge of you. This is what you want to use if you
want to clear out your profile and start again (and remove the current one from others&rsquo; view).
</p>
<p class="text-center">
<button class="btn btn-danger" @onclick=@DeleteProfile>Delete Your Profile</button>
</p>
<hr>
<h4>Option 2 &ndash; Delete Your Account</h4>
<p>
This option will make it like you never visited this site. It will delete your profile, skills, success stories, and
account. This is what you want to use if you want to disappear from this application. Clicking the button below
<strong>will not</strong> affect your No Agenda Social account in any way; its effects are limited to Jobs, Jobs,
Jobs.
</p>
<p>
<em>
(This will not revoke this application&rsquo;s permissions on No Agenda Social; you will have to remove this
yourself. The confirmation message has a link where you can do this; once the page loads, find the
<strong>Jobs, Jobs, Jobs</strong> entry, and click the <strong>&times; Revoke</strong> link for that entry.)
</em>
</p>
<p class="text-center">
<button class="btn btn-danger" @onclick=@DeleteAccount>Delete Your Entire Account</button>
</p>

View File

@@ -0,0 +1,54 @@
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using System.Threading.Tasks;
namespace JobsJobsJobs.Client.Pages.SoLong
{
public partial class Options : ComponentBase
{
/// <summary>
/// Extract an error phrase from a response similar to <code>404 - Not Found</code>
/// </summary>
/// <param name="response">The HTTP response</param>
/// <returns>The formatted error code</returns>
private static string ErrorPhrase(HttpResponseMessage response) =>
$"{response.StatusCode}{(string.IsNullOrEmpty(response.ReasonPhrase) ? "" : $" - {response.ReasonPhrase }")}";
/// <summary>
/// Delete the profile only; redirect to home page on success
/// </summary>
private async Task DeleteProfile()
{
ServerApi.SetJwt(http, state);
var result = await http.DeleteAsync("/api/profile/");
if (result.IsSuccessStatusCode)
{
toast.ShowSuccess("Profile Deleted Successfully");
nav.NavigateTo("/citizen/dashboard");
}
else
{
toast.ShowError(ErrorPhrase(result));
}
}
/// <summary>
/// Delete everything pertaining to the user's account
/// </summary>
private async Task DeleteAccount()
{
ServerApi.SetJwt(http, state);
var result = await http.DeleteAsync("/api/citizen/");
if (result.IsSuccessStatusCode)
{
state.Jwt = "";
state.User = null;
nav.NavigateTo("/so-long/success");
}
else
{
toast.ShowError(ErrorPhrase(result));
}
}
}
}

View File

@@ -0,0 +1,15 @@
@page "/so-long/success"
<PageTitle Title="Account Deletion Success" />
<h3>Account Deletion Success</h3>
<p>
Your account has been successfully deleted. To revoke the permissions you have previously granted to this
application, find it in <a href="https://noagendasocial.com/oauth/authorized_applications">this list</a> and click
<strong>&times; Revoke</strong>. Otherwise, clicking &ldquo;Log On&rdquo; will create a new, empty account without
prompting you further.
</p>
<p>
Thank you for participating, and thank you for your courage. #GitmoNation
</p>

View File

@@ -5,7 +5,7 @@
<PageTitle Title="Success Story" /> <PageTitle Title="Success Story" />
<Loading OnLoad=@RetrieveStory> <Loading OnLoad=@RetrieveStory>
<h3>@Citizen.DisplayName&rsquo;s Success Story</h3> <h3>@Citizen.CitizenName&rsquo;s Success Story</h3>
<h4><FullDateTime TheDate=@Story.RecordedOn /></h4> <h4><FullDateTime TheDate=@Story.RecordedOn /></h4>
@if (Story.FromHere) @if (Story.FromHere)
{ {

View File

@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Components; using JobsJobsJobs.Shared;
using Microsoft.AspNetCore.Components;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Domain = JobsJobsJobs.Shared;
namespace JobsJobsJobs.Client.Pages.SuccessStory namespace JobsJobsJobs.Client.Pages.SuccessStory
{ {
@@ -16,12 +16,12 @@ namespace JobsJobsJobs.Client.Pages.SuccessStory
/// <summary> /// <summary>
/// The success story to be displayed /// The success story to be displayed
/// </summary> /// </summary>
private Domain.Success Story { get; set; } = default!; private Success Story { get; set; } = default!;
/// <summary> /// <summary>
/// The citizen who authorized this success story /// The citizen who authorized this success story
/// </summary> /// </summary>
private Domain.Citizen Citizen { get; set; } = default!; private Citizen Citizen { get; set; } = default!;
/// <summary> /// <summary>
/// Retrieve the success story /// Retrieve the success story
@@ -30,7 +30,7 @@ namespace JobsJobsJobs.Client.Pages.SuccessStory
public async Task RetrieveStory(ICollection<string> errors) public async Task RetrieveStory(ICollection<string> errors)
{ {
ServerApi.SetJwt(http, state); ServerApi.SetJwt(http, state);
var story = await ServerApi.RetrieveOne<Domain.Success>(http, $"success/{Id}"); var story = await ServerApi.RetrieveOne<Success>(http, $"success/{Id}");
if (story.IsOk) if (story.IsOk)
{ {
@@ -41,7 +41,7 @@ namespace JobsJobsJobs.Client.Pages.SuccessStory
else else
{ {
Story = story.Ok; Story = story.Ok;
var citizen = await ServerApi.RetrieveOne<Domain.Citizen>(http, $"citizen/get/{Story.CitizenId}"); var citizen = await ServerApi.RetrieveOne<Citizen>(http, $"citizen/get/{Story.CitizenId}");
if (citizen.IsOk) if (citizen.IsOk)
{ {
if (citizen.Ok == null) if (citizen.Ok == null)

View File

@@ -0,0 +1,38 @@
@page "/terms-of-service"
<PageTitle Title="Terms of Service" />
<h3>Terms of Service</h3>
<p><em>(as of February 6<sup>th</sup>, 2021)</em></p>
<h4>Acceptance of Terms</h4>
<p>
By accessing this web site, you are agreeing to be bound by these Terms and Conditions, and that you are responsible
to ensure that your use of this site complies with all applicable laws. Your continued use of this site implies your
acceptance of these terms.
</p>
<h4>Description of Service and Registration</h4>
<p>
Jobs, Jobs, Jobs is a service that allows individuals to enter and amend employment profiles, restricting access to
the details of these profiles to other users of <a href="https://noagendasocial.com">No Agenda Social</a>.
Registration is accomplished by allowing Jobs, Jobs, Jobs to read one&rsquo;s No Agenda Social profile. See our
<a href="/privacy-policy">privacy policy</a> for details on the personal (user) information we maintain.
</p>
<h4>Liability</h4>
<p>
This service is provided &ldquo;as is&rdquo;, and no warranty (express or implied) exists. The service and its
developers may not be held liable for any damages that may arise through the use of this service.
</p>
<h4>Updates to Terms</h4>
<p>
These terms and conditions may be updated at any time. When these terms are updated, users will be notified via a
notice on the dashboard page. Additionally, the date at the top of this page will be updated, and any substantive
updates will also be accompanied by a summary of those changes.
</p>
<hr>
<p>You may also wish to review our <a href="/privacy-policy">privacy policy</a> to learn how we handle your data.</p>

View File

@@ -2,7 +2,6 @@
using JobsJobsJobs.Shared.Api; using JobsJobsJobs.Shared.Api;
using NodaTime; using NodaTime;
using NodaTime.Serialization.SystemTextJson; using NodaTime.Serialization.SystemTextJson;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;

View File

@@ -19,12 +19,25 @@
<source src="/audio/pelosi-jobs.mp3"> <source src="/audio/pelosi-jobs.mp3">
</audio> </audio>
<div class="app-version">Jobs, Jobs, Jobs @AppState.Version.Value</div> <div class="app-version">
Jobs, Jobs, Jobs @AppState.Version.Value &bull; <a href="/privacy-policy">Privacy Policy</a>
&bull; <a href="/terms-of-service">Terms of Service</a>
</div> </div>
</div> </div>
</div>
@if (InitToasts)
{
<BlazoredToasts Position="ToastPosition.BottomRight" <BlazoredToasts Position="ToastPosition.BottomRight"
ShowProgressBar="true" /> ShowProgressBar="true" />
}
@code { @code {
bool InitToasts = false;
async void PlayJobs() => await js.InvokeVoidAsync("Audio.play", "pelosijobs"); async void PlayJobs() => await js.InvokeVoidAsync("Audio.play", "pelosijobs");
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
if (!InitToasts) InitToasts = true;
}
} }

View File

@@ -77,3 +77,10 @@
font-style: italic; font-style: italic;
font-size: .8rem; font-size: .8rem;
} }
.app-version a:link,
.app-version a:visited {
color: rgba(0, 0, 0, .25);
}
.app-version a:hover {
text-decoration: underline;
}

View File

@@ -18,6 +18,11 @@
<span class="oi oi-home" aria-hidden="true"></span> Home <span class="oi oi-home" aria-hidden="true"></span> Home
</NavLink> </NavLink>
</li> </li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="/profile/seeking">
<span class="oi oi-spreadsheet" aria-hidden="true"></span> Job Seekers
</NavLink>
</li>
<li class="nav-item px-3"> <li class="nav-item px-3">
<a class="nav-link" href="@AuthUrl"> <a class="nav-link" href="@AuthUrl">
<span class="oi oi-account-login" aria-hidden="true"></span> Log On <span class="oi oi-account-login" aria-hidden="true"></span> Log On

View File

@@ -0,0 +1,60 @@
@using JobsJobsJobs.Shared.Api
<EditForm Model=@Criteria OnValidSubmit=@OnSearch>
<div class="form-row">
<div class="col col-12 col-sm-6 col-md-4 col-lg-3">
<label for="continentId" class="jjj-label">Continent</label>
<InputSelect id="continentId" @bind-Value=@Criteria.ContinentId class="form-control form-control-sm">
<option value="">&ndash; Any &ndash;</option>
@foreach (var (id, name) in Continents)
{
<option value="@id">@name</option>
}
</InputSelect>
</div>
<div class="col col-12 col-sm-6 col-md-4 col-lg-3">
<label for="region" class="jjj-label">Region</label>
<InputText id="region" @bind-Value=@Criteria.Region class="form-control form-control-sm"
placeholder="(free-form text)" />
</div>
<div class="col col-12 col-sm-6 offset-md-2 col-lg-3 offset-lg-0">
<label class="jjj-label">Seeking Remote Work?</label><br>
<InputRadioGroup @bind-Value=@Criteria.RemoteWork>
<div class="form-check form-check-inline">
<InputRadio id="remoteNull" Value=@("") class="form-check-input" />
<label for="remoteNull" class="form-check-label">No Selection</label>
</div>
<div class="form-check form-check-inline">
<InputRadio id="remoteYes" Value=@("yes") class="form-check-input" />
<label for="remoteYes" class="form-check-label">Yes</label>
</div>
<div class="form-check form-check-inline">
<InputRadio id="remoteNo" Value=@("no") class="form-check-input" />
<label for="remoteNo" class="form-check-label">No</label>
</div>
</InputRadioGroup>
</div>
<div class="col col-12 col-sm-6 col-lg-3">
<label for="skillSearch" class="jjj-label">Skill</label>
<InputText id="skillSearch" @bind-Value=@Criteria.Skill class="form-control form-control-sm"
placeholder="(free-form text)" />
</div>
</div>
<div class="form-row">
<div class="col">
<br>
<button type="submit" class="btn btn-sm btn-outline-primary">Search</button>
</div>
</div>
</EditForm>
@code {
[Parameter]
public PublicSearch Criteria { get; set; } = default!;
[Parameter]
public EventCallback OnSearch { get; set; } = default!;
[Parameter]
public IEnumerable<Continent> Continents { get; set; } = default!;
}

View File

@@ -5,7 +5,7 @@
</div> </div>
<div class="col col-xs-10 col-sm-10 col-md-6"> <div class="col col-xs-10 col-sm-10 col-md-6">
<div class="form-group"> <div class="form-group">
<label for="skillDesc@(Skill.Id)">Skill</label> <label for="skillDesc@(Skill.Id)" class="jjj-label">Skill</label>
<input type="text" id="skillDesc@(Skill.Id)" @bind="@Skill.Description" class="form-control" maxlength="100" <input type="text" id="skillDesc@(Skill.Id)" @bind="@Skill.Description" class="form-control" maxlength="100"
placeholder="A skill (language, design technique, process, etc.)"> placeholder="A skill (language, design technique, process, etc.)">
<ValidationMessage For="@(() => Skill.Description)" /> <ValidationMessage For="@(() => Skill.Description)" />
@@ -13,7 +13,7 @@
</div> </div>
<div class="col col-xs-12 col-sm-12 col-md-5"> <div class="col col-xs-12 col-sm-12 col-md-5">
<div class="form-group"> <div class="form-group">
<label for="skillNotes@(Skill.Id)">Notes</label> <label for="skillNotes@(Skill.Id)" class="jjj-label">Notes</label>
<input type="text" id="skillNotes@(Skill.Id)" @bind="@Skill.Notes" class="form-control" maxlength="100" <input type="text" id="skillNotes@(Skill.Id)" @bind="@Skill.Notes" class="form-control" maxlength="100"
placeholder="A further description of the skill (100 characters max)"> placeholder="A further description of the skill (100 characters max)">
<ValidationMessage For="@(() => Skill.Notes)" /> <ValidationMessage For="@(() => Skill.Notes)" />

View File

@@ -66,6 +66,7 @@ label.jjj-required::after {
content: ' *'; content: ' *';
} }
label.jjj-label { label.jjj-label,
::placeholder {
font-style: italic; font-style: italic;
} }

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<AssemblyVersion>0.9.0.0</AssemblyVersion> <AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>0.9.0.0</FileVersion> <FileVersion>1.0.0.0</FileVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using NodaTime; using NodaTime;
using System.Security.Claims;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace JobsJobsJobs.Server.Areas.Api.Controllers namespace JobsJobsJobs.Server.Areas.Api.Controllers
@@ -44,6 +45,11 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
_db = db; _db = db;
} }
/// <summary>
/// The current citizen ID
/// </summary>
private CitizenId CurrentCitizenId => CitizenId.Parse(User.FindFirst(ClaimTypes.NameIdentifier)!.Value);
[HttpGet("log-on/{authCode}")] [HttpGet("log-on/{authCode}")]
public async Task<IActionResult> LogOn([FromRoute] string authCode) public async Task<IActionResult> LogOn([FromRoute] string authCode)
{ {
@@ -59,7 +65,8 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
var citizen = await _db.FindCitizenByNAUser(account.Username); var citizen = await _db.FindCitizenByNAUser(account.Username);
if (citizen == null) if (citizen == null)
{ {
citizen = new Citizen(await CitizenId.Create(), account.Username, account.DisplayName, account.Url, citizen = new Citizen(await CitizenId.Create(), account.Username,
string.IsNullOrWhiteSpace(account.DisplayName) ? null : account.DisplayName, null, account.Url,
now, now); now, now);
await _db.AddCitizen(citizen); await _db.AddCitizen(citizen);
} }
@@ -67,7 +74,7 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
{ {
citizen = citizen with citizen = citizen with
{ {
DisplayName = account.DisplayName, DisplayName = string.IsNullOrWhiteSpace(account.DisplayName) ? null : account.DisplayName,
LastSeenOn = now LastSeenOn = now
}; };
_db.UpdateCitizen(citizen); _db.UpdateCitizen(citizen);
@@ -77,7 +84,7 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
// Step 3 - Generate JWT // Step 3 - Generate JWT
var jwt = Auth.CreateJwt(citizen, _config); var jwt = Auth.CreateJwt(citizen, _config);
return new JsonResult(new LogOnSuccess(jwt, citizen.Id.ToString(), citizen.DisplayName)); return new JsonResult(new LogOnSuccess(jwt, citizen.Id.ToString(), citizen.CitizenName));
} }
[Authorize] [Authorize]
@@ -87,5 +94,15 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
var citizen = await _db.FindCitizenById(CitizenId.Parse(id)); var citizen = await _db.FindCitizenById(CitizenId.Parse(id));
return citizen == null ? NotFound() : Ok(citizen); return citizen == null ? NotFound() : Ok(citizen);
} }
[Authorize]
[HttpDelete("")]
public async Task<IActionResult> Remove()
{
await _db.DeleteCitizen(CurrentCitizenId);
await _db.SaveChangesAsync();
return Ok();
}
} }
} }

View File

@@ -1,5 +1,4 @@
using JobsJobsJobs.Server.Data; using JobsJobsJobs.Server.Data;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -9,7 +8,6 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
/// API endpoint for continent information /// API endpoint for continent information
/// </summary> /// </summary>
[Route("api/[controller]")] [Route("api/[controller]")]
[Authorize]
[ApiController] [ApiController]
public class ContinentController : ControllerBase public class ContinentController : ControllerBase
{ {

View File

@@ -46,7 +46,7 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
private CitizenId CurrentCitizenId => CitizenId.Parse(User.FindFirst(ClaimTypes.NameIdentifier)!.Value); private CitizenId CurrentCitizenId => CitizenId.Parse(User.FindFirst(ClaimTypes.NameIdentifier)!.Value);
// This returns 204 to indicate that there is no profile data for the current citizen (if, of course, that is // This returns 204 to indicate that there is no profile data for the current citizen (if, of course, that is
// the case. The version where an ID is specified returns 404, which is an error condition, as it should not // the case). The version where an ID is specified returns 404, which is an error condition, as it should not
// occur unless someone is messing with a URL. // occur unless someone is messing with a URL.
[HttpGet("")] [HttpGet("")]
public async Task<IActionResult> Get() public async Task<IActionResult> Get()
@@ -89,14 +89,14 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
foreach (var skill in skills) await _db.SaveSkill(skill); foreach (var skill in skills) await _db.SaveSkill(skill);
await _db.DeleteMissingSkills(CurrentCitizenId, skills.Select(s => s.Id)); await _db.DeleteMissingSkills(CurrentCitizenId, skills.Select(s => s.Id));
// Real Name
_db.Update((await _db.FindCitizenById(CurrentCitizenId))!
with { RealName = string.IsNullOrWhiteSpace(form.RealName) ? null : form.RealName });
await _db.SaveChangesAsync(); await _db.SaveChangesAsync();
return Ok(); return Ok();
} }
[HttpGet("skills")]
public async Task<IActionResult> GetSkills() =>
Ok(await _db.FindSkillsByCitizen(CurrentCitizenId));
[HttpGet("count")] [HttpGet("count")]
public async Task<IActionResult> GetProfileCount() => public async Task<IActionResult> GetProfileCount() =>
Ok(new Count(await _db.CountProfiles())); Ok(new Count(await _db.CountProfiles()));
@@ -116,6 +116,11 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
public async Task<IActionResult> Search([FromQuery] ProfileSearch search) => public async Task<IActionResult> Search([FromQuery] ProfileSearch search) =>
Ok(await _db.SearchProfiles(search)); Ok(await _db.SearchProfiles(search));
[HttpGet("public-search")]
[AllowAnonymous]
public async Task<IActionResult> SearchPublic([FromQuery] PublicSearch search) =>
Ok(await _db.SearchPublicProfiles(search));
[HttpPatch("employment-found")] [HttpPatch("employment-found")]
public async Task<IActionResult> EmploymentFound() public async Task<IActionResult> EmploymentFound()
{ {
@@ -130,5 +135,13 @@ namespace JobsJobsJobs.Server.Areas.Api.Controllers
return Ok(); return Ok();
} }
[HttpDelete("")]
public async Task<IActionResult> Remove()
{
await _db.DeleteProfileByCitizen(CurrentCitizenId);
await _db.SaveChangesAsync();
return Ok();
}
} }
} }

View File

@@ -97,7 +97,7 @@ namespace JobsJobsJobs.Server
Subject = new ClaimsIdentity(new[] Subject = new ClaimsIdentity(new[]
{ {
new Claim(ClaimTypes.NameIdentifier, citizen.Id.ToString()), new Claim(ClaimTypes.NameIdentifier, citizen.Id.ToString()),
new Claim(ClaimTypes.Name, citizen.DisplayName), new Claim(ClaimTypes.Name, citizen.CitizenName),
}), }),
Expires = DateTime.UtcNow.AddHours(2), Expires = DateTime.UtcNow.AddHours(2),
Issuer = "https://noagendacareers.com", Issuer = "https://noagendacareers.com",

View File

@@ -34,7 +34,7 @@ namespace JobsJobsJobs.Server.Data
/// </summary> /// </summary>
/// <param name="citizen">The citizen to be added</param> /// <param name="citizen">The citizen to be added</param>
public static async Task AddCitizen(this JobsDbContext db, Citizen citizen) => public static async Task AddCitizen(this JobsDbContext db, Citizen citizen) =>
await db.Citizens.AddAsync(citizen); await db.Citizens.AddAsync(citizen).ConfigureAwait(false);
/// <summary> /// <summary>
/// Update a citizen after they have logged on (update last seen, sync display name) /// Update a citizen after they have logged on (update last seen, sync display name)
@@ -42,5 +42,20 @@ namespace JobsJobsJobs.Server.Data
/// <param name="citizen">The updated citizen</param> /// <param name="citizen">The updated citizen</param>
public static void UpdateCitizen(this JobsDbContext db, Citizen citizen) => public static void UpdateCitizen(this JobsDbContext db, Citizen citizen) =>
db.Entry(citizen).State = EntityState.Modified; db.Entry(citizen).State = EntityState.Modified;
/// <summary>
/// Delete a citizen
/// </summary>
/// <param name="citizenId">The ID of the citizen to be deleted</param>
/// <returns></returns>
public static async Task DeleteCitizen(this JobsDbContext db, CitizenId citizenId)
{
var id = citizenId.ToString();
await db.DeleteProfileByCitizen(citizenId).ConfigureAwait(false);
await db.Database.ExecuteSqlInterpolatedAsync($"DELETE FROM jjj.success WHERE citizen_id = {id}")
.ConfigureAwait(false);
await db.Database.ExecuteSqlInterpolatedAsync($"DELETE FROM jjj.citizen WHERE id = {id}")
.ConfigureAwait(false);
}
} }
} }

View File

@@ -12,38 +12,36 @@ namespace JobsJobsJobs.Server.Data
/// Citizen ID converter /// Citizen ID converter
/// </summary> /// </summary>
public static readonly ValueConverter<CitizenId, string> CitizenIdConverter = public static readonly ValueConverter<CitizenId, string> CitizenIdConverter =
new ValueConverter<CitizenId, string>(v => v.ToString(), v => CitizenId.Parse(v)); new(v => v.ToString(), v => CitizenId.Parse(v));
/// <summary> /// <summary>
/// Continent ID converter /// Continent ID converter
/// </summary> /// </summary>
public static readonly ValueConverter<ContinentId, string> ContinentIdConverter = public static readonly ValueConverter<ContinentId, string> ContinentIdConverter =
new ValueConverter<ContinentId, string>(v => v.ToString(), v => ContinentId.Parse(v)); new(v => v.ToString(), v => ContinentId.Parse(v));
/// <summary> /// <summary>
/// Markdown converter /// Markdown converter
/// </summary> /// </summary>
public static readonly ValueConverter<MarkdownString, string> MarkdownStringConverter = public static readonly ValueConverter<MarkdownString, string> MarkdownStringConverter =
new ValueConverter<MarkdownString, string>(v => v.Text, v => new MarkdownString(v)); new(v => v.Text, v => new MarkdownString(v));
/// <summary> /// <summary>
/// Markdown converter for possibly-null values /// Markdown converter for possibly-null values
/// </summary> /// </summary>
public static readonly ValueConverter<MarkdownString?, string?> OptionalMarkdownStringConverter = public static readonly ValueConverter<MarkdownString?, string?> OptionalMarkdownStringConverter =
new ValueConverter<MarkdownString?, string?>( new(v => v == null ? null : v.Text, v => v == null ? null : new MarkdownString(v));
v => v == null ? null : v.Text,
v => v == null ? null : new MarkdownString(v));
/// <summary> /// <summary>
/// Skill ID converter /// Skill ID converter
/// </summary> /// </summary>
public static readonly ValueConverter<SkillId, string> SkillIdConverter = public static readonly ValueConverter<SkillId, string> SkillIdConverter =
new ValueConverter<SkillId, string>(v => v.ToString(), v => SkillId.Parse(v)); new(v => v.ToString(), v => SkillId.Parse(v));
/// <summary> /// <summary>
/// Success ID converter /// Success ID converter
/// </summary> /// </summary>
public static readonly ValueConverter<SuccessId, string> SuccessIdConverter = public static readonly ValueConverter<SuccessId, string> SuccessIdConverter =
new ValueConverter<SuccessId, string>(v => v.ToString(), v => SuccessId.Parse(v)); new(v => v.ToString(), v => SuccessId.Parse(v));
} }
} }

View File

@@ -49,11 +49,13 @@ namespace JobsJobsJobs.Server.Data
m.Property(e => e.Id).HasColumnName("id").IsRequired().HasMaxLength(12) m.Property(e => e.Id).HasColumnName("id").IsRequired().HasMaxLength(12)
.HasConversion(Converters.CitizenIdConverter); .HasConversion(Converters.CitizenIdConverter);
m.Property(e => e.NaUser).HasColumnName("na_user").IsRequired().HasMaxLength(50); m.Property(e => e.NaUser).HasColumnName("na_user").IsRequired().HasMaxLength(50);
m.Property(e => e.DisplayName).HasColumnName("display_name").IsRequired().HasMaxLength(255); m.Property(e => e.DisplayName).HasColumnName("display_name").HasMaxLength(255);
m.Property(e => e.ProfileUrl).HasColumnName("profile_url").IsRequired().HasMaxLength(1_024); m.Property(e => e.ProfileUrl).HasColumnName("profile_url").IsRequired().HasMaxLength(1_024);
m.Property(e => e.JoinedOn).HasColumnName("joined_on").IsRequired(); m.Property(e => e.JoinedOn).HasColumnName("joined_on").IsRequired();
m.Property(e => e.LastSeenOn).HasColumnName("last_seen_on").IsRequired(); m.Property(e => e.LastSeenOn).HasColumnName("last_seen_on").IsRequired();
m.Property(e => e.RealName).HasColumnName("real_name").HasMaxLength(255);
m.HasIndex(e => e.NaUser).IsUnique(); m.HasIndex(e => e.NaUser).IsUnique();
m.Ignore(e => e.CitizenName);
}); });
modelBuilder.Entity<Continent>(m => modelBuilder.Entity<Continent>(m =>
@@ -81,8 +83,12 @@ namespace JobsJobsJobs.Server.Data
m.Property(e => e.LastUpdatedOn).HasColumnName("last_updated_on").IsRequired(); m.Property(e => e.LastUpdatedOn).HasColumnName("last_updated_on").IsRequired();
m.Property(e => e.Experience).HasColumnName("experience") m.Property(e => e.Experience).HasColumnName("experience")
.HasConversion(Converters.OptionalMarkdownStringConverter); .HasConversion(Converters.OptionalMarkdownStringConverter);
m.Ignore(e => e.Continent); m.HasOne(e => e.Continent)
m.Ignore(e => e.Skills); .WithMany()
.HasForeignKey(e => e.ContinentId);
m.HasMany(e => e.Skills)
.WithOne()
.HasForeignKey(e => e.CitizenId);
}); });
modelBuilder.Entity<Skill>(m => modelBuilder.Entity<Skill>(m =>

View File

@@ -18,24 +18,13 @@ namespace JobsJobsJobs.Server.Data
/// </summary> /// </summary>
/// <param name="citizenId">The ID of the citizen whose profile should be retrieved</param> /// <param name="citizenId">The ID of the citizen whose profile should be retrieved</param>
/// <returns>The profile, or null if it does not exist</returns> /// <returns>The profile, or null if it does not exist</returns>
public static async Task<Profile?> FindProfileByCitizen(this JobsDbContext db, CitizenId citizenId) public static async Task<Profile?> FindProfileByCitizen(this JobsDbContext db, CitizenId citizenId) =>
{ await db.Profiles.AsNoTracking()
var profile = await db.Profiles.AsNoTracking() .Include(p => p.Continent)
.Include(p => p.Skills)
.SingleOrDefaultAsync(p => p.Id == citizenId) .SingleOrDefaultAsync(p => p.Id == citizenId)
.ConfigureAwait(false); .ConfigureAwait(false);
if (profile != null)
{
return profile with
{
Continent = await db.FindContinentById(profile.ContinentId).ConfigureAwait(false),
Skills = (await db.FindSkillsByCitizen(citizenId).ConfigureAwait(false)).ToArray()
};
}
return null;
}
/// <summary> /// <summary>
/// Save a profile /// Save a profile
/// </summary> /// </summary>
@@ -52,16 +41,6 @@ namespace JobsJobsJobs.Server.Data
} }
} }
/// <summary>
/// Retrieve all skills for the given citizen
/// </summary>
/// <param name="citizenId">The ID of the citizen whose skills should be retrieved</param>
/// <returns>The skills defined for this citizen</returns>
public static async Task<IEnumerable<Skill>> FindSkillsByCitizen(this JobsDbContext db, CitizenId citizenId) =>
await db.Skills.AsNoTracking()
.Where(s => s.CitizenId == citizenId)
.ToListAsync().ConfigureAwait(false);
/// <summary> /// <summary>
/// Save a skill /// Save a skill
/// </summary> /// </summary>
@@ -111,7 +90,7 @@ namespace JobsJobsJobs.Server.Data
/// <summary> /// <summary>
/// Search profiles by the given criteria /// Search profiles by the given criteria
/// </summary> /// </summary>
// TODO: A criteria parameter! /// <param name="search">The search parameters</param>
/// <returns>The information for profiles matching the criteria</returns> /// <returns>The information for profiles matching the criteria</returns>
public static async Task<IEnumerable<ProfileSearchResult>> SearchProfiles(this JobsDbContext db, public static async Task<IEnumerable<ProfileSearchResult>> SearchProfiles(this JobsDbContext db,
ProfileSearch search) ProfileSearch search)
@@ -156,9 +135,72 @@ namespace JobsJobsJobs.Server.Data
query = query.Where(it => citizenIds.Contains(it.Citizen.Id)); query = query.Where(it => citizenIds.Contains(it.Citizen.Id));
} }
return await query.Select(x => new ProfileSearchResult(x.Citizen.Id, x.Citizen.DisplayName, return await query.Select(x => new ProfileSearchResult(x.Citizen.Id, x.Citizen.CitizenName,
x.Profile.SeekingEmployment, x.Profile.RemoteWork, x.Profile.FullTime, x.Profile.LastUpdatedOn)) x.Profile.SeekingEmployment, x.Profile.RemoteWork, x.Profile.FullTime, x.Profile.LastUpdatedOn))
.ToListAsync().ConfigureAwait(false); .ToListAsync().ConfigureAwait(false);
} }
/// <summary>
/// Search public profiles by the given criteria
/// </summary>
/// <param name="search">The search parameters</param>
/// <returns>The information for profiles matching the criteria</returns>
public static async Task<IEnumerable<PublicSearchResult>> SearchPublicProfiles(this JobsDbContext db,
PublicSearch search)
{
var query = db.Profiles
.Include(it => it.Continent)
.Include(it => it.Skills)
.Where(it => it.IsPublic);
var useIds = false;
var citizenIds = new List<CitizenId>();
if (!string.IsNullOrEmpty(search.ContinentId))
{
query = query.Where(it => it.ContinentId == ContinentId.Parse(search.ContinentId));
}
if (!string.IsNullOrEmpty(search.Region))
{
query = query.Where(it => it.Region.ToLower().Contains(search.Region.ToLower()));
}
if (!string.IsNullOrEmpty(search.RemoteWork))
{
query = query.Where(it => it.RemoteWork == (search.RemoteWork == "yes"));
}
if (!string.IsNullOrEmpty(search.Skill))
{
useIds = true;
citizenIds.AddRange(await db.Skills
.Where(s => s.Description.ToLower().Contains(search.Skill.ToLower()))
.Select(s => s.CitizenId)
.ToListAsync().ConfigureAwait(false));
}
if (useIds)
{
query = query.Where(it => citizenIds.Contains(it.Id));
}
return await query.Select(x => new PublicSearchResult(x.Continent!.Name, x.Region, x.RemoteWork,
x.Skills.Select(sk => $"{sk.Description} ({sk.Notes})")))
.ToListAsync().ConfigureAwait(false);
}
/// <summary>
/// Delete skills and profile for the given citizen
/// </summary>
/// <param name="citizenId">The ID of the citizen whose profile should be deleted</param>
public static async Task DeleteProfileByCitizen(this JobsDbContext db, CitizenId citizenId)
{
var id = citizenId.ToString();
await db.Database.ExecuteSqlInterpolatedAsync($"DELETE FROM jjj.skill WHERE citizen_id = {id}")
.ConfigureAwait(false);
await db.Database.ExecuteSqlInterpolatedAsync($"DELETE FROM jjj.profile WHERE citizen_id = {id}")
.ConfigureAwait(false);
}
} }
} }

View File

@@ -28,7 +28,7 @@ namespace JobsJobsJobs.Server.Data
await db.Successes await db.Successes
.Join(db.Citizens, s => s.CitizenId, c => c.Id, (s, c) => new { Success = s, Citizen = c }) .Join(db.Citizens, s => s.CitizenId, c => c.Id, (s, c) => new { Success = s, Citizen = c })
.OrderByDescending(it => it.Success.RecordedOn) .OrderByDescending(it => it.Success.RecordedOn)
.Select(it => new StoryEntry(it.Success.Id, it.Citizen.Id, it.Citizen.DisplayName, .Select(it => new StoryEntry(it.Success.Id, it.Citizen.Id, it.Citizen.CitizenName,
it.Success.RecordedOn, it.Success.FromHere, it.Success.Story != null)) it.Success.RecordedOn, it.Success.FromHere, it.Success.Story != null))
.ToListAsync().ConfigureAwait(false); .ToListAsync().ConfigureAwait(false);
} }

View File

@@ -6,7 +6,7 @@
<ActiveDebugProfile>JobsJobsJobs.Server</ActiveDebugProfile> <ActiveDebugProfile>JobsJobsJobs.Server</ActiveDebugProfile>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID> <Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath> <Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
<NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile> <NameOfLastUsedPublishProfile>C:\Users\danie\Documents\sandbox\jobs-jobs-jobs\src\JobsJobsJobs\Server\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor> <DebuggerFlavor>ProjectDebugger</DebuggerFlavor>

View File

@@ -13,6 +13,7 @@
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" /> <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" /> <link href="css/app.css" rel="stylesheet" />
<link href="JobsJobsJobs.Client.styles.css" rel="stylesheet" /> <link href="JobsJobsJobs.Client.styles.css" rel="stylesheet" />
<link href="_content/Blazored.Toast/blazored-toast.min.css" rel="stylesheet">
</head> </head>
<body> <body>

View File

@@ -5,5 +5,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<_PublishTargetUrl>C:\Users\danie\Documents\sandbox\jobs-jobs-jobs\src\JobsJobsJobs\Server\bin\Release\net5.0\publish\</_PublishTargetUrl> <_PublishTargetUrl>C:\Users\danie\Documents\sandbox\jobs-jobs-jobs\src\JobsJobsJobs\Server\bin\Release\net5.0\publish\</_PublishTargetUrl>
<History>True|2021-06-15T02:08:33.4261507Z;True|2021-06-14T21:58:04.2622487-04:00;True|2021-03-16T19:34:57.2747439-04:00;</History>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -1,3 +1,4 @@
using Blazored.Toast;
using JobsJobsJobs.Server.Data; using JobsJobsJobs.Server.Data;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
@@ -43,6 +44,7 @@ namespace JobsJobsJobs.Server
services.AddRazorPages() services.AddRazorPages()
.AddJsonOptions(options => .AddJsonOptions(options =>
options.JsonSerializerOptions.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb)); options.JsonSerializerOptions.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb));
services.AddBlazoredToast();
services.AddAuthentication(options => services.AddAuthentication(options =>
{ {
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;

View File

@@ -19,6 +19,12 @@ namespace JobsJobsJobs.Shared.Api
/// </summary> /// </summary>
public bool IsPublic { get; set; } public bool IsPublic { get; set; }
/// <summary>
/// The user's real name
/// </summary>
[StringLength(255)]
public string RealName { get; set; } = "";
/// <summary> /// <summary>
/// The ID of the continent on which the citizen is located /// The ID of the continent on which the citizen is located
/// </summary> /// </summary>

View File

@@ -0,0 +1,37 @@
namespace JobsJobsJobs.Shared.Api
{
/// <summary>
/// The parameters for a public job search
/// </summary>
public class PublicSearch
{
/// <summary>
/// Retrieve citizens from this continent
/// </summary>
public string? ContinentId { get; set; }
/// <summary>
/// Retrieve citizens from this region
/// </summary>
public string? Region { get; set; }
/// <summary>
/// Text for a search within a citizen's skills
/// </summary>
public string? Skill { get; set; }
/// <summary>
/// Whether to retrieve citizens who do or do not want remote work
/// </summary>
public string RemoteWork { get; set; } = "";
/// <summary>
/// Is the search empty?
/// </summary>
public bool IsEmptySearch =>
string.IsNullOrEmpty(ContinentId)
&& string.IsNullOrEmpty(Region)
&& string.IsNullOrEmpty(Skill)
&& string.IsNullOrEmpty(RemoteWork);
}
}

View File

@@ -0,0 +1,13 @@
using System.Collections.Generic;
namespace JobsJobsJobs.Shared.Api
{
/// <summary>
/// A public profile search result
/// </summary>
public record PublicSearchResult(
string Continent,
string Region,
bool RemoteWork,
IEnumerable<string> Skills);
}

View File

@@ -8,8 +8,15 @@ namespace JobsJobsJobs.Shared
public record Citizen( public record Citizen(
CitizenId Id, CitizenId Id,
string NaUser, string NaUser,
string DisplayName, string? DisplayName,
string? RealName,
string ProfileUrl, string ProfileUrl,
Instant JoinedOn, Instant JoinedOn,
Instant LastSeenOn); Instant LastSeenOn)
{
/// <summary>
/// The user's name by which they should be known
/// </summary>
public string CitizenName => RealName ?? DisplayName ?? NaUser;
}
} }

View File

@@ -1,5 +1,5 @@
using NodaTime; using NodaTime;
using System; using System.Collections.Generic;
namespace JobsJobsJobs.Shared namespace JobsJobsJobs.Shared
{ {
@@ -26,6 +26,6 @@ namespace JobsJobsJobs.Shared
/// <summary> /// <summary>
/// Convenience property for skills associated with a profile /// Convenience property for skills associated with a profile
/// </summary> /// </summary>
public Skill[] Skills { get; set; } = Array.Empty<Skill>(); public ICollection<Skill> Skills { get; set; } = new List<Skill>();
} }
} }

View File

@@ -0,0 +1,8 @@
ALTER TABLE jjj.citizen ALTER COLUMN display_name DROP NOT NULL;
ALTER TABLE jjj.citizen ADD COLUMN real_name VARCHAR(255);
COMMENT ON COLUMN jjj.citizen.real_name
IS 'The real name of the user';
-- This can be run as often as needed
UPDATE jjj.citizen SET display_name = NULL WHERE display_name = na_user;