Skip to content

Commit

Permalink
Merge branch 'master' into fix-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
neSpecc committed Jan 3, 2025
2 parents d679e7b + d0b09ca commit 8426b77
Show file tree
Hide file tree
Showing 15 changed files with 283 additions and 21 deletions.
15 changes: 15 additions & 0 deletions src/assets/catalog/sentry.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/sprite-icons/fastapi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/sprite-icons/flask.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions src/components/catalog/GuidePageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@
</div>
<CatalogItemLabel
class="guide-page-header__label"
item-type="catcher"
:item-type="badge"
/>
</div>
<div class="guide-page-header__description">
{{ description }}
</div>
<div class="guide-page-header__info">
<a :href="githubLink">
<a
v-if="githubLink"
:href="githubLink"
>
<Icon symbol="github" />
{{ $t('components.catalog.viewSource') }}
</a>
<a
v-if="readmeLink"
:href="readmeLink"
>
{{ $t('components.catalog.viewReadme') }}
Expand Down Expand Up @@ -61,17 +65,21 @@ export default {
type: String,
required: true,
},
badge: {
type: String,
default: 'catcher',
},
githubLink: {
type: String,
required: true,
default: '',
},
description: {
type: String,
required: true,
},
readmeLink: {
type: String,
required: true,
default: '',
},
},
data() {
Expand Down
16 changes: 14 additions & 2 deletions src/components/catalog/Item.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<div class="catalog-item">
<div
class="catalog-item"
:class="{'catalog-item--wide': isWide}"
>
<div
class="catalog-item__header"
:style="{'background-image': `url(${image})`}"
Expand Down Expand Up @@ -48,6 +51,10 @@ export default {
type: String,
required: true,
},
isWide: {
type: Boolean,
default: false,
},
},
};
</script>
Expand All @@ -63,8 +70,13 @@ export default {
cursor: pointer;
transition: all 120ms ease;
&--wide {
max-width: 300px;
}
&__header {
height: 100px;
flex-shrink: 0;
background-position: center center;
background-size: cover;
border-radius: 4px;
Expand All @@ -87,7 +99,7 @@ export default {
}
&__install-button {
margin: 15px auto 15px 15px;
margin: 0 auto 15px 15px;
text-transform: uppercase;
}
Expand Down
36 changes: 36 additions & 0 deletions src/components/catalog/catchers/AddCatcher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,26 @@
:class="{'project-add-catcher__catalog-item--not-implemented': !item.page}"
@click.native="item.page && $router.push({name: 'setup-catcher', params: {projectId: $route.params.projectId, page: item.page}})"
/>

<a class="project-add-catcher__catalog-more" href="https://docs.hawk.so/integrations?from=garage" target="_blank">
{{ $t('components.catalog.discoverMore') }}
</a>

<h2 class="project-add-catcher__catalog-header">
{{ $t('components.catalog.migrationFromSentry') }}
</h2>
<CatalogItem
type="external"
class="project-add-catcher__catalog-item"
:name="'SENTRY'"
:isWide="true"
:image="require('../../../assets/catalog/sentry.svg')"
:description="$t('components.catalog.migrationFromSentryDescription')"
@click.native="$router.push({name: 'setup-catcher', params: {projectId: $route.params.projectId, page: 'sentry'}})"
/>
<div class="project-add-catcher__migration-description"></div>
</div>

</div>
</div>
</template>
Expand Down Expand Up @@ -243,6 +262,7 @@ export default {
display: flex;
flex-direction: column;
justify-content: center;
margin-bottom: 100px;
}
&__catalog-header {
Expand Down Expand Up @@ -283,5 +303,21 @@ export default {
max-width: 245px;
}
}
&__catalog-more {
background-color: var(--color-bg-main);
margin: 7.5px 7.5px 50px;
text-align: center;
padding: 18px 20px;
border-radius: 4px;
width: 100%;
cursor: pointer;
transition: all 0.2s ease;
&:hover {
box-shadow: 0 6px 12px -5px rgba(0,0,0,0.15);
transform: translateY(-2px);
}
}
}
</style>
1 change: 1 addition & 0 deletions src/components/catalog/catchers/dynamicLoadGuidePages.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default {
async beforeRouteEnter(to, _from, next) {
const hasSeparatePage = [
'javascript',
'sentry',
];

let view = 'common';
Expand Down
93 changes: 93 additions & 0 deletions src/components/catalog/catchers/guides/sentry.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<template>
<div class="guide-page">
<GuideHeader
class="guide-page__header"
:background-image="
require('../../../../assets/catalog/sentry.svg')
"
catcher-name="Sentry"
:badge="'external'"
:description="$t('components.catalog.migrationFromSentryDescription')"
/>
<div class="guide-page__instructions">
<div class="guide-page__instructions-header">
{{ $t('components.catalog.installation') }}
</div>
<GuideStepBlock :step-number="1">
<template #header>
{{ $t('components.catalog.getDSN') }}
</template>
<template #content>
{{ $t('components.catalog.hereIsDSN') }}
<TokenBlock v-if="computedDSN" :token="computedDSN" />
<template v-else>
<p style="color: var(--color-indicator-critical);">
{{ $t('projects.settings.integrations.sentryDSNTextNoToken') }}
</p>
<UiButton
:href="`/project/${project.id}/settings/integrations`"
:content="$t('projects.settings.general.title')"
/>
</template>
</template>
</GuideStepBlock>
<GuideStepBlock
:step-number="2"
last
>
<template #header>
{{ $t('components.catalog.useDSN') }}
</template>
<template #content>
{{ $t('components.catalog.useDSNText') }}
</template>
</GuideStepBlock>
</div>
</div>
</template>

<script>
import GuideStepBlock from '../../GuideStepBlock';
import GuideHeader from '../../GuidePageHeader';
import TokenBlock from '../../../project/TokenBlock';
import { getSentryDSN } from '../../../../utils';
import UiButton from '../../../utils/UiButton';
export default {
name: 'SetupJavascriptCatcher',
components: {
GuideStepBlock,
GuideHeader,
TokenBlock,
UiButton,
},
data() {
return {
repoUrl: 'https://github.com/codex-team/hawk.javascript',
readmeUrl: 'https://github.com/codex-team/hawk.javascript/blob/master/README.md',
};
},
computed: {
/**
* Current viewed project
*
* @returns {Project}
*/
project() {
const projectId = this.$route.params.projectId;
return this.$store.getters.getProjectById(projectId);
},
computedDSN() {
if (!this.project || !this.project.token) {
return '';
}
return getSentryDSN(this.project.token);
},
},
};
</script>

<style src="../../../../styles/guide-page.css"></style>
16 changes: 15 additions & 1 deletion src/components/event/Overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@
icon="nuxt"
title="Nuxt"
/>
<DetailsAddons
v-if="getIntegrationAddons('flask')"
class="event-overview__section"
:addons="getIntegrationAddons('flask')"
icon="flask"
title="Flask"
/>
<DetailsAddons
v-if="getIntegrationAddons('fastapi')"
class="event-overview__section"
:addons="getIntegrationAddons('fastapi')"
icon="fastapi"
title="FastAPI"
/>
<DetailsAddons
v-if="hasContext"
class="event-overview__section"
Expand Down Expand Up @@ -120,7 +134,7 @@ export default Vue.extend({
return null;
}
const integrationToFilter = [ 'vue', 'nuxt' ];
const integrationToFilter = [ 'vue', 'nuxt', 'flask', 'fastapi'];
const filteredAddons = {};
Object.entries(this.event.payload.addons).forEach(([name, value]) => {
Expand Down
Loading

0 comments on commit 8426b77

Please sign in to comment.