CP-11332 only allow Employee and Manager party (#29)

* only allow Employee and Manager party

* clean up extra party translations

* rubocop violation fix

* update test

remove Third Party check
pull/544/head
Ryan Arakawa 2 months ago committed by GitHub
parent 9b16c8a258
commit eda0eec6c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -59,13 +59,6 @@
{{ submitter.name }}
</span>
</span>
<button
v-if="submitters.length > 1 && editable"
class="px-2"
@click.prevent.stop="remove(submitter)"
>
<IconTrashX :width="18" />
</button>
</a>
</li>
<li v-if="submitters.length < names.length && editable">
@ -160,36 +153,6 @@
{{ submitter.name }}
</span>
</span>
<div
v-if="!compact && submitters.length > 1 && editable"
class="flex"
>
<div class="flex-col pr-1 hidden group-hover:flex -mt-1 h-0">
<button
:title="t('up')"
class="relative w-2"
style="font-size: 10px; margin-bottom: -4px"
@click.prevent.stop="[move(submitter, -1), $refs.label.focus()] "
>
</button>
<button
:title="t('down')"
class="relative w-2"
style="font-size: 10px; margin-top: -4px"
@click.prevent.stop="[move(submitter, 1), $refs.label.focus()] "
>
</button>
</div>
<button
v-if="!compact && submitters.length > 1 && editable"
class="hidden group-hover:block px-2"
@click.prevent.stop="remove(submitter)"
>
<IconTrashX :width="18" />
</button>
</div>
</a>
</li>
<li
@ -300,36 +263,9 @@ export default {
]
},
names () {
const generatedNames = []
for (let i = 21; i < 101; i++) {
const suffix = getOrdinalSuffix(i)
generatedNames.push(`${i}${suffix} ${this.t('party')}`)
}
return [
this.t('first_party'),
this.t('second_party'),
this.t('third_party'),
this.t('fourth_party'),
this.t('fifth_party'),
this.t('sixth_party'),
this.t('seventh_party'),
this.t('eighth_party'),
this.t('ninth_party'),
this.t('tenth_party'),
this.t('eleventh_party'),
this.t('twelfth_party'),
this.t('thirteenth_party'),
this.t('fourteenth_party'),
this.t('fifteenth_party'),
this.t('sixteenth_party'),
this.t('seventeenth_party'),
this.t('eighteenth_party'),
this.t('nineteenth_party'),
this.t('twentieth_party'),
...generatedNames
this.t('second_party')
]
},
lastPartyIndex () {

@ -79,24 +79,6 @@ const en = {
condition: 'Condition',
first_party: 'Employee',
second_party: 'Manager',
third_party: 'Third Party',
fourth_party: 'Fourth Party',
fifth_party: 'Fifth Party',
sixth_party: 'Sixth Party',
seventh_party: 'Seventh Party',
eighth_party: 'Eighth Party',
ninth_party: 'Ninth Party',
tenth_party: 'Tenth Party',
eleventh_party: 'Eleventh Party',
twelfth_party: 'Twelfth Party',
thirteenth_party: 'Thirteenth Party',
fourteenth_party: 'Fourteenth Party',
fifteenth_party: 'Fifteenth Party',
sixteenth_party: 'Sixteenth Party',
seventeenth_party: 'Seventeenth Party',
eighteenth_party: 'Eighteenth Party',
nineteenth_party: 'Nineteenth Party',
twentieth_party: 'Twentieth Party',
draw: 'Draw',
add: 'Add',
or_add_field_without_drawing: 'Or add field without drawing',
@ -244,24 +226,6 @@ const es = {
option: 'Opción',
first_party: 'Primera Parte',
second_party: 'Segunda Parte',
third_party: 'Tercera Parte',
fourth_party: 'Cuarta Parte',
fifth_party: 'Quinta Parte',
sixth_party: 'Sexta Parte',
seventh_party: 'Séptima Parte',
eighth_party: 'Octava Parte',
ninth_party: 'Novena Parte',
tenth_party: 'Décima Parte',
eleventh_party: 'Undécimo Partido',
twelfth_party: 'Duodécimo Partido',
thirteenth_party: 'Decimotercer Partido',
fourteenth_party: 'Catorceavo Partido',
fifteenth_party: 'Quinceavo Partido',
sixteenth_party: 'Dieciséisavo Partido',
seventeenth_party: 'Diecisieteavo Partido',
eighteenth_party: 'Dieciochoavo Partido',
nineteenth_party: 'Decimonovena Fiesta',
twentieth_party: 'Vigésima Fiesta',
draw: 'Dibujar',
add: 'Agregar',
text: 'Texto',
@ -417,24 +381,6 @@ const it = {
condition: 'Condizione',
first_party: 'Prima parte',
second_party: 'Seconda parte',
third_party: 'Terza parte',
fourth_party: 'Quarta parte',
fifth_party: 'Quinta parte',
sixth_party: 'Sesta parte',
seventh_party: 'Settima parte',
eighth_party: 'Ottava parte',
ninth_party: 'Nona parte',
tenth_party: 'Decima parte',
eleventh_party: 'Undicesima parte',
twelfth_party: 'Dodicesima parte',
thirteenth_party: 'Tredicesima parte',
fourteenth_party: 'Quattordicesima parte',
fifteenth_party: 'Quindicesima parte',
sixteenth_party: 'Sedicesima parte',
seventeenth_party: 'Diciassettesima parte',
eighteenth_party: 'Diciottesima parte',
nineteenth_party: 'Diciannovesima parte',
twentieth_party: 'Ventesima parte',
draw: 'Disegna',
add: 'Aggiungi',
or_add_field_without_drawing: 'Oppure aggiungi campo senza disegno',
@ -582,24 +528,6 @@ const pt = {
option: 'Opção',
first_party: 'Primeira Parte',
second_party: 'Segunda Parte',
third_party: 'Terceira Parte',
fourth_party: 'Quarta Parte',
fifth_party: 'Quinta Parte',
sixth_party: 'Sexta Parte',
seventh_party: 'Sétima Parte',
eighth_party: 'Oitava Parte',
ninth_party: 'Nona Parte',
tenth_party: 'Décima Parte',
eleventh_party: 'Décima Primeira Parte',
twelfth_party: 'Décima Segunda Parte',
thirteenth_party: 'Décima Terceira Parte',
fourteenth_party: 'Décima Quarta Parte',
fifteenth_party: 'Décima Quinta Parte',
sixteenth_party: 'Décima Sexta Parte',
seventeenth_party: 'Décima Sétima Parte',
eighteenth_party: 'Décima Oitava Parte',
nineteenth_party: 'Décima Nona Parte',
twentieth_party: 'Vigésima Parte',
draw: 'Desenhar',
add: 'Adicionar',
text: 'Texto',
@ -750,24 +678,6 @@ const fr = {
option: 'Option',
first_party: 'Première partie',
second_party: 'Deuxième partie',
third_party: 'Troisième partie',
fourth_party: 'Quatrième partie',
fifth_party: 'Cinquième partie',
sixth_party: 'Sixième partie',
seventh_party: 'Septième partie',
eighth_party: 'Huitième partie',
ninth_party: 'Neuvième partie',
tenth_party: 'Dixième partie',
eleventh_party: 'Onzième Parti',
twelfth_party: 'Douzième Parti',
thirteenth_party: 'Treizième Parti',
fourteenth_party: 'Quatorzième Parti',
fifteenth_party: 'Quinzième Parti',
sixteenth_party: 'Seizième Parti',
seventeenth_party: 'Dix-septième Parti',
eighteenth_party: 'Dix-huitième Parti',
nineteenth_party: 'Dix-Neuvième Fête',
twentieth_party: 'Vingtième Fête',
draw: 'Dessiner',
add: 'Ajouter',
or_add_field_without_drawing: 'Ou ajoutez un champ sans dessiner',
@ -919,24 +829,6 @@ const de = {
option: 'Option',
first_party: 'Erste Partei',
second_party: 'Zweite Partei',
third_party: 'Dritte Partei',
fourth_party: 'Vierte Partei',
fifth_party: 'Fünfte Partei',
sixth_party: 'Sechste Partei',
seventh_party: 'Siebte Partei',
eighth_party: 'Achte Partei',
ninth_party: 'Neunte Partei',
tenth_party: 'Zehnte Partei',
eleventh_party: 'Elfte Partei',
twelfth_party: 'Zwölfte Partei',
thirteenth_party: 'Dreizehnte Partei',
fourteenth_party: 'Vierzehnte Partei',
fifteenth_party: 'Fünfzehnte Partei',
sixteenth_party: 'Sechzehnte Partei',
seventeenth_party: 'Siebzehnte Partei',
eighteenth_party: 'Achtzehnte Partei',
nineteenth_party: 'Neunzehnte Party',
twentieth_party: 'Zwanzigste Party',
draw: 'Zeichnen',
add: 'Hinzufügen',
or_add_field_without_drawing: 'Oder Feld ohne Zeichnung hinzufügen',

@ -44,6 +44,7 @@ en: &en
unarchive: Unarchive
signed: Signed
first_party: 'Employee'
second_party: 'Manager'
remove_filter: Remove filter
add: Add
adding: Adding
@ -897,6 +898,7 @@ es: &es
awaiting_completion_by_the_other_party: "Esperando la finalización por la otra parte"
enforce_recipients_order: 'Hacer cumplir el orden de los destinatarios'
first_party: 'Primera Parte'
second_party: 'Segunda Parte'
docuseal_trusted_signature: Firma de confianza DocuSeal
hello_name: Hola %{name}
you_are_invited_to_product_name: Estás invitado a %{product_name}

@ -18,8 +18,7 @@ FactoryBot.define do
end
after(:create) do |template, ev|
party_names = ['Employee', 'Manager', 'Third Party', 'Fourth Party', 'Fifth Party', 'Sixth Party',
'Seventh Party', 'Eighth Party', 'Ninth Party', 'Tenth Party']
party_names = %w[Employee Manager]
template.submitters = Array.new(ev.submitter_count) do |i|
{

@ -8,7 +8,7 @@ describe 'Submission API' do
let(:folder) { create(:template_folder, account:) }
let(:testing_folder) { create(:template_folder, account: testing_account) }
let(:templates) { create_list(:template, 2, account:, author:, folder:) }
let(:multiple_submitters_template) { create(:template, submitter_count: 3, account:, author:, folder:) }
let(:multiple_submitters_template) { create(:template, submitter_count: 2, account:, author:, folder:) }
let(:testing_templates) do
create_list(:template, 2, account: testing_account, author: testing_author, folder: testing_folder)
end
@ -123,8 +123,7 @@ describe 'Submission API' do
send_email: true,
submitters: [
{ role: 'Employee', email: 'john.doe@example.com' },
{ email: 'jane.doe@example.com' },
{ email: 'mike.doe@example.com' }
{ email: 'jane.doe@example.com' }
]
}.to_json
@ -138,8 +137,6 @@ describe 'Submission API' do
expect(response.parsed_body[0]['email']).to eq('john.doe@example.com')
expect(response.parsed_body[1]['role']).to eq('Manager')
expect(response.parsed_body[1]['email']).to eq('jane.doe@example.com')
expect(response.parsed_body[2]['role']).to eq('Third Party')
expect(response.parsed_body[2]['email']).to eq('mike.doe@example.com')
end
it 'returns an error if the submitter email is invalid' do

Loading…
Cancel
Save