mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge branch 'master' into notifications-remove-user-from-group
This commit is contained in:
commit
b969630e6e
81
.github/workflows/publish.yml
vendored
81
.github/workflows/publish.yml
vendored
@ -300,77 +300,10 @@ jobs:
|
||||
repository: ${{ github.repository }}
|
||||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "VERSION": "${VERSION}", "BUILD_DATE": "${BUILD_DATE}", "BUILD_COMMIT": "${BUILD_COMMIT}", "BUILD_VERSION": "${BUILD_VERSION}"}'
|
||||
|
||||
# ##############################################################################
|
||||
# # JOB: KUBERNETES DEPLOY ACTUAL/LATEST VERSION ######################################
|
||||
# ##############################################################################
|
||||
# kubernetes_deploy:
|
||||
# # see example https://github.com/do-community/example-doctl-action
|
||||
# # see example https://github.com/do-community/example-doctl-action/blob/main/.github/workflows/workflow.yaml
|
||||
# name: Kubernetes deploy of latest version to stage.ocelot.social cluster at DigitalOcean
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: [upload_to_dockerhub]
|
||||
# steps:
|
||||
# ##########################################################################
|
||||
# # CHECKOUT CODE ##########################################################
|
||||
# ##########################################################################
|
||||
# - name: Checkout code
|
||||
# uses: actions/checkout@v3
|
||||
# ##########################################################################
|
||||
# # SET ENVS ###############################################################
|
||||
# ##########################################################################
|
||||
# - name: ENV - VERSION
|
||||
# run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
|
||||
# - name: ENV - BUILD_VERSION
|
||||
# run: echo "BUILD_VERSION=${VERSION}-${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
|
||||
# ##########################################################################
|
||||
# # Install DigitalOceans doctl and set kubeconfig #########################
|
||||
# ##########################################################################
|
||||
# - name: Install doctl
|
||||
# uses: digitalocean/action-doctl@v2
|
||||
# with:
|
||||
# token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
||||
# - name: Save DigitalOcean kubeconfig with short-lived credentials
|
||||
# run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 cluster-stage-ocelot-social
|
||||
# ##########################################################################
|
||||
# # Deploy new Docker images to DigitalOcean Kubernetes cluster ############
|
||||
# ##########################################################################
|
||||
# # - name: Deploy 'latest' to DigitalOcean Kubernetes
|
||||
# # run: |
|
||||
# # kubectl -n default set image deployment/ocelot-webapp container-ocelot-webapp=ocelotsocialnetwork/webapp:latest
|
||||
# # kubectl -n default rollout restart deployment/ocelot-webapp
|
||||
# # kubectl -n default set image deployment/ocelot-backend container-ocelot-backend=ocelotsocialnetwork/backend:latest
|
||||
# # kubectl -n default rollout restart deployment/ocelot-backend
|
||||
# # kubectl -n default set image deployment/ocelot-maintenance container-ocelot-maintenance=ocelotsocialnetwork/maintenance:latest
|
||||
# # kubectl -n default rollout restart deployment/ocelot-maintenance
|
||||
# # kubectl -n default set image deployment/ocelot-neo4j container-ocelot-neo4j=ocelotsocialnetwork/neo4j-community:latest
|
||||
# # kubectl -n default rollout restart deployment/ocelot-neo4j
|
||||
# - name: Deploy actual version '$BUILD_VERSION' to DigitalOcean Kubernetes
|
||||
# run: |
|
||||
# kubectl -n default set image deployment/ocelot-webapp container-ocelot-webapp=ocelotsocialnetwork/webapp:$BUILD_VERSION
|
||||
# kubectl -n default rollout restart deployment/ocelot-webapp
|
||||
# kubectl -n default set image deployment/ocelot-backend container-ocelot-backend=ocelotsocialnetwork/backend:$BUILD_VERSION
|
||||
# kubectl -n default rollout restart deployment/ocelot-backend
|
||||
# kubectl -n default set image deployment/ocelot-maintenance container-ocelot-maintenance=ocelotsocialnetwork/maintenance:$BUILD_VERSION
|
||||
# kubectl -n default rollout restart deployment/ocelot-maintenance
|
||||
# kubectl -n default set image deployment/ocelot-neo4j container-ocelot-neo4j=ocelotsocialnetwork/neo4j-community:$BUILD_VERSION
|
||||
# kubectl -n default rollout restart deployment/ocelot-neo4j
|
||||
# # because this step 'kubectl -n default rollout status deployment/* --timeout=600s' does not work as expected
|
||||
# # and we need the pods to be up again for cleaning and seeding the Neo4j database and the backend.
|
||||
# # !!! this is not a perfect solution !!!
|
||||
# # deployments are regularly up again after 3 minutes and 10 seconds
|
||||
# - name: Sleep for 4 minutes, means 240 seconds
|
||||
# run: sleep 240s
|
||||
# shell: bash
|
||||
# - name: Verify deployment and wait for the pods of each deployment to get ready for cleaning and seeding of the database
|
||||
# run: |
|
||||
# kubectl -n default rollout status deployment/ocelot-backend --timeout=600s
|
||||
# kubectl -n default rollout status deployment/ocelot-neo4j --timeout=600s
|
||||
# kubectl -n default rollout status deployment/ocelot-maintenance --timeout=600s
|
||||
# kubectl -n default rollout status deployment/ocelot-webapp --timeout=600s
|
||||
# - name: Run migrations for Neo4j database via backend for staging
|
||||
# run: |
|
||||
# kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "yarn prod:migrate up"
|
||||
# - name: Reset and seed Neo4j database via backend for staging
|
||||
# # db cleaning and seeding is only possible in production if env 'PRODUCTION_DB_CLEAN_ALLOW=true' is set in deployment
|
||||
# run: |
|
||||
# kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node --experimental-repl-await dist/db/clean.js && node --experimental-repl-await dist/db/seed.js"
|
||||
- name: Repository Dispatch stage.ocelot.social
|
||||
uses: peter-evans/repository-dispatch@v2
|
||||
with:
|
||||
token: ${{ secrets.OCELOT_PUBLISH_EVENT_PAT }} # this token is required to access the other repository
|
||||
event-type: trigger-build-success
|
||||
repository: 'Ocelot-Social-Community/stage.ocelot.social'
|
||||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "VERSION": "${VERSION}", "BUILD_DATE": "${BUILD_DATE}", "BUILD_COMMIT": "${BUILD_COMMIT}", "BUILD_VERSION": "${BUILD_VERSION}"}'
|
||||
@ -7,7 +7,13 @@ SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
||||
# configuration
|
||||
CONFIGURATION=${CONFIGURATION:-"example"}
|
||||
KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yaml}
|
||||
VALUES=${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubernetes/values.yaml
|
||||
VALUES=${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubernetes/values.
|
||||
DOCKERHUB_OCELOT_TAG=${DOCKERHUB_OCELOT_TAG:-"latest"}
|
||||
|
||||
# upgrade with helm
|
||||
helm --kubeconfig=${KUBECONFIG} upgrade ocelot --values ${VALUES} ${SCRIPT_DIR}/../src/kubernetes/ --debug --timeout 10m
|
||||
helm --kubeconfig=${KUBECONFIG} upgrade ocelot \
|
||||
--values ${VALUES} \
|
||||
--set appVersion="${DOCKERHUB_OCELOT_TAG}"
|
||||
${SCRIPT_DIR}/../src/kubernetes/ \
|
||||
--debug \
|
||||
--timeout 10m
|
||||
@ -6,6 +6,7 @@
|
||||
:icon="icon"
|
||||
:filled="isMember && !hovered"
|
||||
:danger="isMember && hovered"
|
||||
v-tooltip="tooltip"
|
||||
@mouseenter.native="onHover"
|
||||
@mouseleave.native="hovered = false"
|
||||
@click.prevent="toggle"
|
||||
@ -24,6 +25,7 @@ export default {
|
||||
group: { type: Object, required: true },
|
||||
userId: { type: String, required: true },
|
||||
isMember: { type: Boolean, required: true },
|
||||
isNonePendingMember: { type: Boolean, required: true },
|
||||
disabled: { type: Boolean, default: false },
|
||||
loading: { type: Boolean, default: false },
|
||||
},
|
||||
@ -35,17 +37,33 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
icon() {
|
||||
if (this.isMember && this.hovered) {
|
||||
return 'close'
|
||||
if (this.isMember) {
|
||||
if (this.isNonePendingMember) {
|
||||
return this.hovered ? 'close' : 'check'
|
||||
} else {
|
||||
return this.isMember ? 'check' : 'plus'
|
||||
return this.hovered ? 'close' : 'question-circle'
|
||||
}
|
||||
}
|
||||
return 'plus'
|
||||
},
|
||||
label() {
|
||||
if (this.isMember) {
|
||||
return this.$t('group.joinLeaveButton.iAmMember')
|
||||
if (this.isNonePendingMember) {
|
||||
return this.hovered
|
||||
? this.$t('group.joinLeaveButton.leave')
|
||||
: this.$t('group.joinLeaveButton.iAmMember')
|
||||
} else {
|
||||
return this.$t('group.joinLeaveButton.pendingMember')
|
||||
}
|
||||
}
|
||||
return this.$t('group.joinLeaveButton.join')
|
||||
},
|
||||
tooltip() {
|
||||
return {
|
||||
content: this.$t('group.joinLeaveButton.tooltip'),
|
||||
placement: 'right',
|
||||
show: this.isMember && !this.isNonePendingMember && this.hovered,
|
||||
trigger: this.isMember && !this.isNonePendingMember ? 'hover' : 'manual',
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
{{ formData.title.length }}/{{ formSchema.title.max }}
|
||||
<base-icon v-if="errors && errors.title" name="warning" />
|
||||
</ds-chip>
|
||||
<hc-editor
|
||||
<editor
|
||||
:users="users"
|
||||
:value="formData.content"
|
||||
:hashtags="hashtags"
|
||||
@ -64,14 +64,30 @@
|
||||
{{ formData.categoryIds.length }} / 3
|
||||
<base-icon v-if="errors && errors.categoryIds" name="warning" />
|
||||
</ds-chip>
|
||||
<div class="buttons">
|
||||
<base-button data-test="cancel-button" :disabled="loading" @click="$router.back()" danger>
|
||||
<ds-flex class="buttons-footer" gutter="xxx-small">
|
||||
<ds-flex-item width="3.5" style="margin-right: 16px; margin-bottom: 6px">
|
||||
<!-- eslint-disable vue/no-v-text-v-html-on-component -->
|
||||
<ds-text
|
||||
v-if="showGroupHint"
|
||||
v-html="$t('contribution.visibleOnlyForMembersOfGroup', { name: groupName })"
|
||||
/>
|
||||
<!-- eslint-enable vue/no-v-text-v-html-on-component -->
|
||||
</ds-flex-item>
|
||||
<ds-flex-item width="0.15" />
|
||||
<ds-flex-item class="action-buttons-group" width="2">
|
||||
<base-button
|
||||
data-test="cancel-button"
|
||||
:disabled="loading"
|
||||
@click="$router.back()"
|
||||
danger
|
||||
>
|
||||
{{ $t('actions.cancel') }}
|
||||
</base-button>
|
||||
<base-button type="submit" icon="check" :loading="loading" :disabled="errors" filled>
|
||||
{{ $t('actions.save') }}
|
||||
</base-button>
|
||||
</div>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
</base-card>
|
||||
</template>
|
||||
</ds-form>
|
||||
@ -80,7 +96,7 @@
|
||||
<script>
|
||||
import gql from 'graphql-tag'
|
||||
import { mapGetters } from 'vuex'
|
||||
import HcEditor from '~/components/Editor/Editor'
|
||||
import Editor from '~/components/Editor/Editor'
|
||||
import PostMutations from '~/graphql/PostMutations.js'
|
||||
import CategoriesSelect from '~/components/CategoriesSelect/CategoriesSelect'
|
||||
import ImageUploader from '~/components/Uploader/ImageUploader'
|
||||
@ -89,7 +105,7 @@ import PageParamsLink from '~/components/_new/features/PageParamsLink/PageParams
|
||||
|
||||
export default {
|
||||
components: {
|
||||
HcEditor,
|
||||
Editor,
|
||||
ImageUploader,
|
||||
PageParamsLink,
|
||||
CategoriesSelect,
|
||||
@ -99,8 +115,8 @@ export default {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
groupId: {
|
||||
type: String,
|
||||
group: {
|
||||
type: Object,
|
||||
default: () => null,
|
||||
},
|
||||
},
|
||||
@ -152,6 +168,15 @@ export default {
|
||||
contentLength() {
|
||||
return this.$filters.removeHtml(this.formData.content).length
|
||||
},
|
||||
groupId() {
|
||||
return this.group && this.group.id
|
||||
},
|
||||
showGroupHint() {
|
||||
return this.groupId && ['closed', 'hidden'].includes(this.group.groupType)
|
||||
},
|
||||
groupName() {
|
||||
return this.group && this.group.name
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
@ -284,9 +309,22 @@ export default {
|
||||
align-self: flex-end;
|
||||
}
|
||||
|
||||
> .buttons {
|
||||
> .buttons-footer {
|
||||
justify-content: flex-end;
|
||||
align-self: flex-end;
|
||||
width: 100%;
|
||||
margin-top: $space-base;
|
||||
|
||||
> .action-buttons-group {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
||||
> button {
|
||||
margin-left: 1em;
|
||||
min-width: fit-content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.blur-toggle {
|
||||
@ -297,5 +335,30 @@ export default {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 656px) {
|
||||
> .buttons-footer {
|
||||
flex-direction: column;
|
||||
margin-top: 5px;
|
||||
|
||||
> .action-buttons-group {
|
||||
> button {
|
||||
margin-left: 1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 280px) {
|
||||
> .buttons-footer {
|
||||
> .action-buttons-group {
|
||||
flex-direction: column;
|
||||
|
||||
> button {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
<template>
|
||||
<div class="group-list">
|
||||
<ds-space margin-bottom="small" v-for="group in groups" :key="group.id">
|
||||
<ds-flex class="group-list">
|
||||
<ds-flex-item
|
||||
v-for="group in groups"
|
||||
:key="group.id"
|
||||
:width="{ base: '98%', sm: '98%', md: '48%' }"
|
||||
class="group-item"
|
||||
>
|
||||
<group-teaser :group="group" />
|
||||
</ds-space>
|
||||
</div>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -19,3 +24,8 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.group-item {
|
||||
margin: 0 1% 2% 1%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -289,7 +289,8 @@
|
||||
},
|
||||
"supportedFormats": "Füge ein Bild im Dateiformat JPG, PNG oder GIF ein"
|
||||
},
|
||||
"title": "Titel"
|
||||
"title": "Titel",
|
||||
"visibleOnlyForMembersOfGroup": "Dieser Beitrag wird nur für Mitglieder der Gruppe „<b>{name}</b>“ sichtbar sein."
|
||||
},
|
||||
"delete": {
|
||||
"cancel": "Abbrechen",
|
||||
@ -447,7 +448,10 @@
|
||||
"in": "in",
|
||||
"joinLeaveButton": {
|
||||
"iAmMember": "Bin Mitglied",
|
||||
"join": "Beitreten"
|
||||
"join": "Beitreten",
|
||||
"leave": "Verlassen",
|
||||
"pendingMember": "Ausstehendes Mitglied",
|
||||
"tooltip": "Der Gruppeninhaber muss dich noch bestätigen."
|
||||
},
|
||||
"labelSlug": "Eindeutiger Gruppenname",
|
||||
"leaveModal": {
|
||||
@ -482,7 +486,7 @@
|
||||
"admin": "Administrator",
|
||||
"owner": "Inhaber",
|
||||
"pending": "Ausstehendes Mitglied",
|
||||
"usual": "Einfaches Mitglied"
|
||||
"usual": "Mitglied"
|
||||
},
|
||||
"save": "Neue Gruppe anlegen",
|
||||
"type": "Öffentlichkeit der Gruppe",
|
||||
|
||||
@ -289,7 +289,8 @@
|
||||
},
|
||||
"supportedFormats": "Insert a picture of file format JPG, PNG or GIF"
|
||||
},
|
||||
"title": "Title"
|
||||
"title": "Title",
|
||||
"visibleOnlyForMembersOfGroup": "This post will only be visible to members of the “<b>{name}</b>” group."
|
||||
},
|
||||
"delete": {
|
||||
"cancel": "Cancel",
|
||||
@ -447,7 +448,10 @@
|
||||
"in": "in",
|
||||
"joinLeaveButton": {
|
||||
"iAmMember": "I'm a member",
|
||||
"join": "Join"
|
||||
"join": "Join",
|
||||
"leave": "Leave",
|
||||
"pendingMember": "Pending member",
|
||||
"tooltip": "The group owner has yet to confirm you."
|
||||
},
|
||||
"labelSlug": "Unique group name",
|
||||
"leaveModal": {
|
||||
@ -482,7 +486,7 @@
|
||||
"admin": "Administrator",
|
||||
"owner": "Owner",
|
||||
"pending": "Pending Member",
|
||||
"usual": "Simple Member"
|
||||
"usual": "Member"
|
||||
},
|
||||
"save": "Create new group",
|
||||
"type": "Visibility of the group",
|
||||
|
||||
@ -302,7 +302,8 @@
|
||||
"goal": null,
|
||||
"joinLeaveButton": {
|
||||
"iAmMember": null,
|
||||
"join": null
|
||||
"join": null,
|
||||
"pendingMember": null
|
||||
},
|
||||
"membersCount": null,
|
||||
"membersListTitle": null
|
||||
|
||||
@ -291,7 +291,8 @@
|
||||
"goal": null,
|
||||
"joinLeaveButton": {
|
||||
"iAmMember": null,
|
||||
"join": null
|
||||
"join": null,
|
||||
"pendingMember": null
|
||||
},
|
||||
"membersCount": null,
|
||||
"membersListTitle": null
|
||||
|
||||
@ -299,7 +299,8 @@
|
||||
"goal": null,
|
||||
"joinLeaveButton": {
|
||||
"iAmMember": null,
|
||||
"join": null
|
||||
"join": null,
|
||||
"pendingMember": null
|
||||
},
|
||||
"membersCount": null,
|
||||
"membersListTitle": null
|
||||
|
||||
@ -87,7 +87,8 @@
|
||||
"goal": null,
|
||||
"joinLeaveButton": {
|
||||
"iAmMember": null,
|
||||
"join": null
|
||||
"join": null,
|
||||
"pendingMember": null
|
||||
},
|
||||
"membersCount": null,
|
||||
"membersListTitle": null
|
||||
|
||||
@ -171,7 +171,8 @@
|
||||
"goal": null,
|
||||
"joinLeaveButton": {
|
||||
"iAmMember": null,
|
||||
"join": null
|
||||
"join": null,
|
||||
"pendingMember": null
|
||||
},
|
||||
"membersCount": null,
|
||||
"membersListTitle": null
|
||||
|
||||
@ -337,7 +337,8 @@
|
||||
"goal": null,
|
||||
"joinLeaveButton": {
|
||||
"iAmMember": null,
|
||||
"join": null
|
||||
"join": null,
|
||||
"pendingMember": null
|
||||
},
|
||||
"membersCount": null,
|
||||
"membersListTitle": null
|
||||
|
||||
@ -316,7 +316,8 @@
|
||||
"goal": null,
|
||||
"joinLeaveButton": {
|
||||
"iAmMember": null,
|
||||
"join": null
|
||||
"join": null,
|
||||
"pendingMember": null
|
||||
},
|
||||
"membersCount": null,
|
||||
"membersListTitle": null
|
||||
|
||||
@ -102,6 +102,7 @@
|
||||
:group="group || {}"
|
||||
:userId="currentUser.id"
|
||||
:isMember="isGroupMember"
|
||||
:isNonePendingMember="isGroupMemberNonePending"
|
||||
:disabled="isGroupOwner"
|
||||
:loading="$apollo.loading"
|
||||
@prepare="prepareJoinLeave"
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<tab-navigation :tabs="tabOptions" :activeTab="tabActive" @switch-tab="handleTab" />
|
||||
</ds-space>
|
||||
<ds-space margin="large" />
|
||||
<ds-container>
|
||||
<ds-space>
|
||||
<!-- create group -->
|
||||
<ds-space centered>
|
||||
<nuxt-link :to="{ name: 'group-create' }">
|
||||
@ -49,7 +49,7 @@
|
||||
@next="nextResults"
|
||||
/>
|
||||
</ds-space>
|
||||
</ds-container>
|
||||
</ds-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@ -346,7 +346,7 @@ export default {
|
||||
position: fixed;
|
||||
z-index: 6;
|
||||
margin-top: -35px;
|
||||
padding: 20px 10px 5px 10px;
|
||||
padding: 20px 10px 20px 10px;
|
||||
background-color: #f5f4f6;
|
||||
}
|
||||
@media screen and (max-width: 656px) {
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<ds-space margin="large" />
|
||||
<ds-flex :width="{ base: '100%' }" gutter="base">
|
||||
<ds-flex-item :width="{ base: '100%', md: 5 }">
|
||||
<contribution-form :groupId="groupId" />
|
||||
<contribution-form :group="group" />
|
||||
</ds-flex-item>
|
||||
<ds-flex-item :width="{ base: '100%', md: 1 }"> </ds-flex-item>
|
||||
</ds-flex>
|
||||
|
||||
@ -9,7 +9,10 @@
|
||||
<ds-space margin="large" />
|
||||
<ds-flex :width="{ base: '100%' }" gutter="base">
|
||||
<ds-flex-item :width="{ base: '100%', md: 3 }">
|
||||
<contribution-form :contribution="contribution" />
|
||||
<contribution-form
|
||||
:contribution="contribution"
|
||||
:group="contribution && contribution.group ? contribution.group : null"
|
||||
/>
|
||||
</ds-flex-item>
|
||||
<ds-flex-item :width="{ base: '100%', md: 1 }"> </ds-flex-item>
|
||||
</ds-flex>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user