Skip to content
This repository has been archived by the owner on Feb 8, 2025. It is now read-only.

Commit

Permalink
fix: fix realId forms and some messages (#957)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Jun 4, 2021
1 parent 1fa4aca commit b187f3b
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 11 deletions.
4 changes: 2 additions & 2 deletions resources/js/Pages/Company/Partials/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

<div class="flex pa0-ns pa3">
<div>
<p class="ttu f7 gray mb1 mt0 mr5">number of employees</p>
<p class="ttu f7 gray mb1 mt0 mr5">{{ $t('company.stat_number_of_employees') }}</p>
<p class="mt0 mb0">{{ statistics.number_of_employees }}</p>
</div>
<div>
<p class="ttu f7 gray mb1 mt0 mr5">number of teams</p>
<p class="ttu f7 gray mb1 mt0 mr5">{{ $t('company.stat_number_of_teams') }}</p>
<p class="mt0 mb0">{{ statistics.number_of_teams }}</p>
</div>
<div v-if="statistics.founded_at" class="">
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Company/Partials/Questions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="br3 bg-white box z-1">
<!-- active question, if defined -->
<div v-if="questions.active_question" class="pa3 bb bb-gray">
<p class="f7 gray ma0">Active question</p>
<p class="f7 gray ma0">{{ $t('company.questions_active') }}</p>
<inertia-link :href="questions.active_question.url" class="dib ma0 mt2 fw6">{{ questions.active_question.title }}</inertia-link>
</div>

Expand Down
7 changes: 5 additions & 2 deletions resources/js/Shared/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ input[type=checkbox] {
<div :class="extraClassUpperDiv">
<div class="flex items-start">
<input
:id="id"
:id="realId"
v-model="proxyValue"
:value="value"
type="checkbox"
Expand All @@ -35,7 +35,7 @@ input[type=checkbox] {
:data-cy="datacy"
v-bind="$attrs"
/>
<label v-if="label" class="fw4 lh-copy f5 pointer di" :for="id">
<label v-if="label" class="fw4 lh-copy f5 pointer di" :for="realId">
<span v-html="label"></span>
<span v-if="!required" class="optional-badge f7">
{{ $t('app.optional') }}
Expand Down Expand Up @@ -127,6 +127,9 @@ export default {
this.$emit('update:modelValue', value);
},
},
realId() {
return this.id + this._.uid;
},
hasError() {
return this.localErrors.length > 0 && this.required;
}
Expand Down
7 changes: 5 additions & 2 deletions resources/js/Shared/EditableCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ input[type=checkbox] {
<div class="dib">
<div class="flex items-start">
<input
:id="id"
:id="realId"
v-model="proxyValue"
:value="value"
:data-cy="datacy + '-single-item'"
Expand All @@ -86,7 +86,7 @@ input[type=checkbox] {
/>

<!-- content of the checkbox -->
<label v-if="label" :for="id" class="fw4 lh-copy f5 pointer di relative">
<label v-if="label" :for="realId" class="fw4 lh-copy f5 pointer di relative">
<span class="mr2 hover-effect" v-html="label"></span>

<small-name-and-avatar
Expand Down Expand Up @@ -239,6 +239,9 @@ export default {
this.$emit('update:modelValue', value);
},
},
realId() {
return this.id + this._.uid;
},
hasError() {
return this.errors.length > 0 && this.required;
}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Shared/FileInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<template>
<div :class="extraClassUpperDiv">
<label v-if="label" class="db fw4 lh-copy f6" :for="id">
<label v-if="label" class="db fw4 lh-copy f6" :for="realId">
{{ label }}
<span v-if="!required" class="optional-badge f7">
{{ $t('app.optional') }}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Shared/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ nav {
<span class="mr1">🔍</span> {{ $t('app.header_find') }}
</a>
<inertia-link v-if="$page.props.auth.company && $page.props.auth.employee.permission_level <= 200" :href="'/' + $page.props.auth.company.id + '/account'" data-cy="header-adminland-link" class="no-underline pa2 bb-0 special">
<span class="mr1">👮‍♂️</span> Adminland
<span class="mr1">👮‍♂️</span> {{ $t('app.header_adminland') }}
</inertia-link>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion resources/js/Shared/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@

<template>
<div :class="extraClassUpperDiv">
<label v-if="label" class="db fw4 lh-copy f6" :for="id">
<label v-if="label" class="db fw4 lh-copy f6" :for="realId">
{{ label }}
<span v-if="!required" class="optional-badge f7">
{{ $t('app.optional') }}
</span>
</label>
<v-select v-model="proxyValue"
:input-id="realId"
:options="options"
:label="customLabelKey"
:placeholder="placeholder"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Shared/TextArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<template>
<div class="mb3">
<label v-if="label" class="db fw4 lh-copy f6" :for="id">
<label v-if="label" class="db fw4 lh-copy f6" :for="realId">
{{ label }}
<span v-if="!required" class="optional-badge f7">
{{ $t('app.optional') }}
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
'header_home' => 'Summary',
'header_find' => 'Find',
'header_company' => 'Company',
'header_adminland' => 'Adminland',
'header_settings' => 'Settings',
'header_switch_company' => 'Switch company',
'header_go_to_employee_profile' => 'Your profile',
Expand Down
3 changes: 3 additions & 0 deletions resources/lang/en/company.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
'menu_projects' => 'Projects',
'menu_groups' => 'Groups',
'menu_hr' => 'Human Resources',
'stat_number_of_employees' => 'number of employees',
'stat_number_of_teams' => 'number of teams',
'stat_founded_at' => 'founded',
'title' => 'Manage your company with OfficeLife',
'new_name' => 'What is the name of your company?',
Expand Down Expand Up @@ -40,6 +42,7 @@
'new_hires_date_with_position_past' => 'Started on :date as :position',
'new_hires_blank' => 'There are no new hires this week.',
'recent_ships_title' => 'Accomplishments',
'questions_active' => 'Active question',
'questions_blank' => 'No questions have been asked to employees yet.',
'questions_title' => 'Questions to get to know your colleagues',
'questions_view_all' => 'View all questions ({count})',
Expand Down

0 comments on commit b187f3b

Please sign in to comment.