Files
habitica/website/client/src/components/group-plans/groupPlanCreationModal.vue
Fiz 8aaff7ae23 Remove group strings from languages (besides default) (#15522)
* add new frontend files

* Add UI for managing blockers

* correctly reset local data after creating blocker

* Tweak wording

* Add UI for managing blockers

* restructure admin pages

* add blocker to block emails from registration

* lint fixes

* Await genericPurchase completion before page reload to prevent request cancellation.

Also adds defensive check for undefined error.response in axios interceptor to prevent "t.response undefined" errors.

* Fix shop tabs overflow off screen at certain zoom levels
Fix quest cards get cut off on small screens
Fix pop-up windows extend past screen edges on mobile

* Update ToS error message

- Updated account suspension message from "This account, User ID..." to "Your account @[username] has been
  blocked..."
- Modified server auth middleware to pass username parameter when throwing account suspended error
-Modified auth utils loginRes function to include username in suspended account error
- Updated client bannedAccountModal component to pass username (empty string if unavailable)
- Updated login test to expect username in account suspended message

* lint fix

* Responsive Layout for Equipment Containers

- Added responsive CSS for mobile (<768px) and tablet (769px-1024px)
- Implemented flex-wrap layout that automatically stacks items in rows of 4 on smaller

* remove redundant disabled styles in task modals

The .disabled class conflicting with existing disabled state implementations

* Revert "Merge branch 'fiz/item-container-scaling' into qa/bat"

This reverts commit 4f28bfaad4, reversing
changes made to 477dd6328a.

* fix(blockers): duplicated code from rebase

* fix(admin): revert accidental change from rebase

* move !error.response to correct level

!error.response before any attempt to access error.response.status

* chore(github): split responsiveness to #15514

* Group string updates & removals

Removed the "Couple sharing tasks" and "Coworkers sharing tasks" strings:
- Removed from all language locale files
- Removed from both Vue components that used them in dropdowns:
	- groupPlanCreationModal.vue
 	- successModal.vue

* Remove some Group strings

Remove the "groupParentChildren", "groupFriends", "groupManager", and "groupTeacher" strings from all languages (except default)

---------

Co-authored-by: Phillip Thelen <phillip@habitica.com>
Co-authored-by: Kalista Payne <kalista@habitica.com>
2025-09-30 16:46:13 -05:00

275 lines
6.0 KiB
Vue

<template>
<b-modal
id="create-group"
:title="$t('createGroupTitle')"
:hide-footer="true"
:hide-header="true"
size="md"
@hide="onHide()"
>
<div class="col-12">
<!-- HEADER -->
<div
class="modal-close"
>
<span
class="cancel-text"
@click="close()"
>
{{ $t('cancel') }}
</span>
<button
class="btn btn-primary next-button"
:value="$t('next')"
:disabled="!newGroupIsReady"
@click="stripeGroup({ group: newGroup })"
>
{{ $t('next') }}
</button>
</div>
<h2>{{ $t('createGroup') }}</h2>
<!-- FORM -->
<div class="form-group">
<lockable-label
:text="$t('nameStar')"
/>
<input
id="new-group-name"
v-model="newGroup.name"
class="form-control input-medium option-content name-input"
required="required"
type="text"
:placeholder="$t('nameStarText')"
>
</div>
<div class="form-group">
<lockable-label
for="new-group-description"
:text="$t('descriptionOptional')"
class="description-label"
/>
<div class="characters-remaining">
{{ $t('charactersRemaining', {characters: charactersRemaining}) }}
</div>
<textarea
id="new-group-description"
v-model="newGroup.description"
class="form-control option-content description-input"
cols="3"
:placeholder="$t('descriptionOptionalText')"
maxlength="250"
></textarea>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox">
<input
id="create-group-leaderOnlyChallenges-checkbox"
v-model="newGroup.leaderOnly.challenges"
class="custom-control-input"
type="checkbox"
>
<label
class="custom-control-label"
for="create-group-leaderOnlyChallenges-checkbox"
>{{ $t('leaderOnlyChallenges') }}</label>
</div>
</div>
<div class="form-group">
<lockable-label
:text="$t('groupUse')"
/>
<select-translated-array
:items="[
'groupParentChildren',
'groupFriends',
'groupManager',
'groupTeacher'
]"
class="group-input"
:placeholder="'groupUseDefault'"
:value="newGroup.demographics"
@select="newGroup.demographics = $event"
/>
</div>
<div class="form-group">
<button
class="btn btn-primary btn-lg btn-block btn-payment"
:disabled="!newGroupIsReady"
@click="stripeGroup({ group: newGroup })"
>
{{ $t('nextPaymentMethod') }}
</button>
</div>
</div>
</b-modal>
</template>
<style lang="scss" scoped>
@import '@/assets/scss/colors.scss';
h2 {
color: $purple-300;
font-size: 1.25rem;
height: 28px;
width: 120px;
margin-top: 24px;
align-self: center;
}
.cancel-text {
color: $blue-10;
font-size: 0.875rem;
margin-right: 16px;
text-align: center;
cursor: pointer;
}
.next-button {
align-self: center;
}
.form-control::placeholder {
color: $gray-50;
height: 32px;
}
.description-label {
margin-bottom: -24px;
}
.name-input, .description-input, .group-input {
margin-top: -4px;
}
.characters-remaining {
color: $gray-100;
font-size: 0.75rem;
line-height: 1.33;
text-align: right;
margin-bottom: 12px;
}
.description-input {
height: 56px;
}
.spacer {
margin-bottom: 16px !important;
}
.btn-payment {
margin: 24px 112px 24px 112px;
width: 177px;
}
.payments {
padding: 24px;
}
.payment-options {
margin-bottom: 4em;
.purple-box {
background-color: #4f2a93;
color: #fff;
padding: .5em;
border-radius: 8px;
width: 200px;
height: 215px;
.number {
font-size: 60px;
}
.name {
width: 100px;
margin-left: .3em;
}
div {
display: inline-block;
}
}
.box, .purple-box {
display: inline-block;
vertical-align: bottom;
}
}
</style>
<style lang="scss">
@import '@/assets/scss/mixins.scss';
#create-group {
.modal-dialog {
max-width: 448px;
}
.modal-content {
width: 448px;
max-height: 436px;
border-radius: 8px;
box-shadow: 0 14px 28px 0 rgba(26, 24, 29, 0.24), 0 10px 10px 0 rgba(26, 24, 29, 0.28);
}
.modal-body{
padding: 0px;
margin-left: 12px;
margin-right: 12px;
}
.modal-close {
position: absolute;
right: 16px;
cursor: pointer;
top: 0px;
}
}
</style>
<script>
import paymentsMixin from '../../mixins/payments';
import { mapState } from '@/libs/store';
import selectTranslatedArray from '@/components/tasks/modal-controls/selectTranslatedArray';
import lockableLabel from '@/components/tasks/modal-controls/lockableLabel';
export default {
components: {
selectTranslatedArray,
lockableLabel,
},
mixins: [paymentsMixin],
data () {
return {
newGroup: {
type: 'guild',
privacy: 'private',
name: '',
description: '',
leaderOnly: {
challenges: false,
},
demographics: null,
user: '',
},
type: 'guild',
};
},
computed: {
...mapState({ user: 'user.data' }),
newGroupIsReady () {
return Boolean(this.newGroup.name) && Boolean(this.newGroup.demographics);
},
charactersRemaining () {
const currentLength = this.newGroup.description ? this.newGroup.description.length : 0;
return 250 - currentLength;
},
},
methods: {
close () {
this.$root.$emit('bv::hide::modal', 'create-group');
},
onHide () {
this.sendingInProgress = false;
},
},
};
</script>