Skip to content

Commit

Permalink
Merge pull request #73 from canopas/remove-jobs-feature-flag-and-redi…
Browse files Browse the repository at this point in the history
…rect-traffic-to-jobs

Remove jobs feature flag and redirect traffic to /jobs
  • Loading branch information
cp-sumi-k committed Mar 1, 2022
2 parents c275052 + debdf0b commit 068954e
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 88 deletions.
19 changes: 8 additions & 11 deletions sitemap/sitemap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/xml"
"jobs"
"net/http"
"strings"
"time"

"github.com/gin-gonic/gin"
Expand Down Expand Up @@ -44,18 +43,16 @@ func (repository *SitemapRepository) GenerateSitemap(c *gin.Context) {
{Loc: blogsUrl, Priority: `0.8`},
}

if strings.Contains(baseUrl, "dev-stack") {
careers, err := repository.careerRepo.GetCareers()
careers, err := repository.careerRepo.GetCareers()

if err != nil {
c.AbortWithStatus(http.StatusInternalServerError)
return
}
if err != nil {
c.AbortWithStatus(http.StatusInternalServerError)
return
}

for i := range careers {
sitemapUrls = append(sitemapUrls, URL{Loc: jobsUrl + `/` + careers[i].UniqueId, Priority: `0.9`})
sitemapUrls = append(sitemapUrls, URL{Loc: jobsUrl + `/apply/` + careers[i].UniqueId, Priority: `0.9`})
}
for i := range careers {
sitemapUrls = append(sitemapUrls, URL{Loc: jobsUrl + `/` + careers[i].UniqueId, Priority: `0.9`})
sitemapUrls = append(sitemapUrls, URL{Loc: jobsUrl + `/apply/` + careers[i].UniqueId, Priority: `0.9`})
}

//get first day of current month
Expand Down
21 changes: 13 additions & 8 deletions vue-frontend/src/components/ApplyForCareer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -335,20 +335,19 @@
</transition>
</div>
</div>
<ScreenFooter v-if="!showJobs" />
<ScreenFooter2 v-if="showJobs" />
<ScreenFooter2 />
</div>
</div>
</template>

<script>
import ScreenHeader from "./partials/ScreenHeader.vue";
import ScreenFooter from "./partials/ScreenFooter.vue";
import ScreenFooter2 from "./partials/ScreenFooter2.vue";
import ScreenMeta from "./partials/ScreenMeta.vue";
import ScreenLoader from "./utils/ScreenLoader.vue";
import axios from "axios";
import config from "@/config.js";
import router from "@/router";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { library } from "@fortawesome/fontawesome-svg-core";
Expand Down Expand Up @@ -426,7 +425,6 @@ export default {
showSuccessMessagePopup: false,
showErrorMessagePopup: false,
showReviewFormPopup: false,
showJobs: config.IS_SHOW_JOBS,
seoData: {
type: "Jobs Posting Website",
url: location.toString(),
Expand All @@ -435,7 +433,6 @@ export default {
},
components: {
ScreenHeader,
ScreenFooter,
ScreenFooter2,
ScreenMeta,
FontAwesomeIcon,
Expand All @@ -448,16 +445,24 @@ export default {
},
methods: {
getCareerDetails() {
var id = this.$route.params.id;
axios
.get(config.API_BASE + "/api/careers/" + this.$route.params.id)
.get(config.API_BASE + "/api/careers/" + id)
.then((res) => {
this.isLoading = false;
this.title = res.data.title;
this.prepareSEOdata(res.data);
})
.catch(() => {
.catch((err) => {
this.isLoading = false;
this.showErrorMessagePopup = true;
if (err.response && err.response.status == 404) {
router.push({
name: "Error404Page",
params: { catchAll: "jobs/" + id },
});
} else {
this.showErrorMessagePopup = true;
}
});
},
prepareSEOdata(job) {
Expand Down
6 changes: 1 addition & 5 deletions vue-frontend/src/components/CareerDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@
</router-link>
</div>
</div>
<ScreenFooter v-if="!showJobs" />
<ScreenFooter2 v-if="showJobs" />
<ScreenFooter2 />
</div>
</div>
</template>

<script>
import ScreenHeader from "./partials/ScreenHeader.vue";
import ScreenFooter from "./partials/ScreenFooter.vue";
import ScreenFooter2 from "./partials/ScreenFooter2.vue";
import ScreenMeta from "./partials/ScreenMeta.vue";
import ScreenLoader from "./utils/ScreenLoader.vue";
Expand All @@ -97,7 +95,6 @@ export default {
checkCircle: faCheckCircle,
isLoading: true,
showErrorMessagePopup: false,
showJobs: config.IS_SHOW_JOBS,
jsonld: {},
jobPosted: "",
validThrough: "",
Expand All @@ -110,7 +107,6 @@ export default {
},
components: {
ScreenHeader,
ScreenFooter,
ScreenFooter2,
ScreenMeta,
FontAwesomeIcon,
Expand Down
21 changes: 10 additions & 11 deletions vue-frontend/src/components/ContactScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,42 @@
<ContactLanding />
<ContactForm v-on:isLoading="setLoader" />
</div>
<ScreenFooter v-if="!showJobs" />
<ScreenFooter2 v-if="showJobs" />
<ScreenFooter2 />
</div>
</template>

<script>
import ScreenHeader from "./partials/ScreenHeader.vue";
import ScreenFooter from "./partials/ScreenFooter.vue";
import ScreenFooter2 from "./partials/ScreenFooter2.vue";
import ScreenMeta from "./partials/ScreenMeta.vue";
import ScreenLoader from "./utils/ScreenLoader.vue";
import ContactLanding from "./contact/ContactLanding.vue";
import ContactForm from "./contact/ContactForm.vue";
import Config from "@/config.js";
import config from "@/config.js";
export default {
components: {
ScreenHeader,
ContactLanding,
ScreenFooter,
ScreenFooter2,
ScreenMeta,
ContactForm,
ScreenLoader,
},
data() {
return {
showJobs: Config.IS_SHOW_JOBS,
isLoading: false,
seoData: Config.SEO_META_DATA,
seoData: {
title:
"Let's discuss your idea or problem you're facing in your business.",
description:
"Thank you for choosing Canopas for your business. Fill out all the required information about you and your business. We will get back to you soon.",
type: "Website",
url: config.BASE_URL + "/contact",
},
};
},
mounted() {
this.seoData.title =
"Let's discuss your idea or problem you're facing in your business.";
this.seoData.description =
"Thank you for choosing Canopas for your business. Fill out all the required information about you and your business. We will get back to you soon.";
this.$gtag.event("view_page_contact");
},
methods: {
Expand Down
30 changes: 9 additions & 21 deletions vue-frontend/src/components/Error404Page.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<div class="error-container">
<div>
<ScreenMeta v-bind:seoData="seoData" />
<ScreenHeader />
<div class="not-found-container">
<div class="container">
<div class="image-404">
<img :src="firstErrorLetter" alt="404" />
<img :src="middleErrorLetter" class="middle-logo" alt="404" />
Expand All @@ -20,13 +20,13 @@
<span class="canopas-gradient-text">Back to Home page</span>
</a>
</div>
<ScreenFooter />
<ScreenFooter2 />
</div>
</template>

<script>
import ScreenHeader from "./partials/ScreenHeader.vue";
import ScreenFooter from "./partials/ScreenFooter.vue";
import ScreenFooter2 from "./partials/ScreenFooter2.vue";
import ScreenMeta from "./partials/ScreenMeta.vue";
import firstErrorLetter from "@/assets/images/logo/404page_4_1.svg";
import middleErrorLetter from "@/assets/images/logo/canopas-icon.svg";
Expand All @@ -45,7 +45,7 @@ export default {
},
components: {
ScreenHeader,
ScreenFooter,
ScreenFooter2,
ScreenMeta,
FontAwesomeIcon,
},
Expand All @@ -56,19 +56,14 @@ export default {
</script>

<style lang="scss" scoped>
.error-container {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.not-found-container {
.container {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
flex-direction: column;
margin: 16px;
margin: 0 auto;
padding: 150px 5%;
min-height: 50vh;
}
.image-404 {
Expand Down Expand Up @@ -123,11 +118,4 @@ export default {
font-size: 1.5rem;
margin-right: 16px;
}
@include media-breakpoint-up(md) {
.not-found-container {
width: 50%;
margin: 16px auto;
}
}
</style>
6 changes: 1 addition & 5 deletions vue-frontend/src/components/HomeScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<CanopasDescription />
<HomeConsultation />
<HomeCTA />
<ScreenFooter v-if="!showJobs" />
<ScreenFooter2 v-if="showJobs" />
<ScreenFooter2 />
</div>
</template>

Expand All @@ -25,7 +24,6 @@ import ProblemSolution from "./home/ProblemSolution.vue";
import CanopasDescription from "./home/CanopasDescription.vue";
import HomeConsultation from "./home/HomeConsultation.vue";
import HomeCTA from "./home/HomeCTA.vue";
import ScreenFooter from "./partials/ScreenFooter.vue";
import ScreenFooter2 from "./partials/ScreenFooter2.vue";
import ScreenMeta from "./partials/ScreenMeta.vue";
import DoYouKnow from "./home/DoYouKnow.vue";
Expand Down Expand Up @@ -56,7 +54,6 @@ library.add(
export default {
data() {
return {
showJobs: Config.IS_SHOW_JOBS,
seoData: Config.SEO_META_DATA,
};
},
Expand All @@ -72,7 +69,6 @@ export default {
CanopasDescription,
HomeConsultation,
HomeCTA,
ScreenFooter,
ScreenFooter2,
},
mounted() {
Expand Down
2 changes: 1 addition & 1 deletion vue-frontend/src/components/JobsScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default {
description:
"Canopas is looking for professionals who are ready to step out of their comfort zones, want to acquire new skills, and want to make an impact in the world with their work.",
type: "Jobs Posting Website",
url: config.JOBS_URL,
url: config.BASE_URL + "/jobs",
},
};
},
Expand Down
2 changes: 1 addition & 1 deletion vue-frontend/src/components/partials/ScreenHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default {
data() {
return {
headerLogoImage: headerLogoImage,
careerURL: Config.IS_SHOW_JOBS ? "/jobs" : Config.JOBS_URL,
careerURL: "/jobs",
blogsURL: Config.BLOG_URL,
navbarSticky: false,
navbarAnimation: false,
Expand Down
3 changes: 1 addition & 2 deletions vue-frontend/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ export default Object.freeze({
LINKEDIN_URL: "https://www.linkedin.com/company/canopasinc",
MEDIUM_URL: "https://medium.com/canopas",
BLOG_URL: "https://blog.canopas.com",
JOBS_URL: "https://jobs.canopas.com",
API_BASE: "https://dev-stack-api.canopas.com",
BASE_URL: "https://dev-stack.canopas.com",
CALENDLY_IFRAME_URL: "https://calendly.com/darpanvithani/15min",
IS_SHOW_JOBS: true,
SEO_META_DATA: {
title:
"Canopas - A software development company in surat helping businesses bring their idea to life!",
Expand Down
3 changes: 1 addition & 2 deletions vue-frontend/src/config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ export default Object.freeze({
LINKEDIN_URL: "https://www.linkedin.com/company/canopasinc",
MEDIUM_URL: "https://medium.com/canopas",
BLOG_URL: "https://blog.canopas.com",
JOBS_URL: "https://jobs.canopas.com",
API_BASE: "https://prod-stack-api.canopas.com",
BASE_URL: "https://canopas.com",
CALENDLY_IFRAME_URL: "https://calendly.com/darpanvithani/15min",
IS_SHOW_JOBS: false,
SEO_META_DATA: {
title:
"Canopas - A software development company in surat helping businesses bring their idea to life!",
Expand Down
36 changes: 15 additions & 21 deletions vue-frontend/src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createWebHistory, createRouter } from "vue-router";
import Config from "@/config.js";

// Don't lazy load home screen
import HomeScreen from "@/components/HomeScreen.vue";
Expand All @@ -26,28 +25,23 @@ const routes = [
name: "Error404Page",
component: Error404Page,
},
{
path: "/jobs",
name: "JobsScreen",
component: JobsScreen,
},
{
path: "/jobs/:id",
name: "CareerDetailsPage",
component: CareerDetailsPage,
},
{
path: "/jobs/apply/:id",
name: "ApplyForCareerPage",
component: ApplyForCareerPage,
},
];

if (Config.IS_SHOW_JOBS) {
routes.push(
{
path: "/jobs",
name: "JobsScreen",
component: JobsScreen,
},
{
path: "/jobs/:id",
name: "CareerDetailsPage",
component: CareerDetailsPage,
},
{
path: "/jobs/apply/:id",
name: "ApplyForCareerPage",
component: ApplyForCareerPage,
}
);
}

const router = createRouter({
history: createWebHistory(),
routes,
Expand Down

0 comments on commit 068954e

Please sign in to comment.