Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2320 allow input value copied to selected rows #2345

Merged
merged 34 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0b3d17b
Allow input value to be copied to selected rows instead of all rows
Jul 12, 2023
c5f58ab
Added select all feature
Jul 18, 2023
6de4adc
Allow input value to be copied to selected rows instead of all rows
Aug 1, 2023
899831c
Merge branch 'master' into 2320-allow-input-value-copied-to-selected-…
PoornimaVKrishnan Aug 1, 2023
7990375
Resolving conflicts
Aug 1, 2023
0e90d70
Changed double quote to single
Aug 4, 2023
8aab268
Fixed all pending bugs and added comments
Aug 16, 2023
9120faf
Fixed first round of review comments
Aug 18, 2023
98887fd
Fixed review comments
Aug 31, 2023
5536186
Merge branch 'master' into 2320-allow-input-value-copied-to-selected-…
PoornimaVKrishnan Sep 1, 2023
2602987
Fixed review comments 2
Sep 7, 2023
41b550e
Fixed centre to center
Sep 8, 2023
7716e23
Merge branch 'master' of github.com:informatics-isi-edu/chaise into 2…
RFSH Sep 12, 2023
907534d
add skeleton for testing multi-form-input feature
RFSH Sep 13, 2023
7763382
add more info to multi-form-input test spec
RFSH Sep 13, 2023
5944a2a
change multi-form-input default column to be markdown
RFSH Oct 11, 2023
5ecfa7f
Pushing Phase 1 of test cases
Oct 16, 2023
e3acd5e
Fixed comments for phase 1 and added it blocks for phase 2
Oct 20, 2023
9649a05
Merge branch 'master' of github.com:informatics-isi-edu/chaise into 2…
RFSH Oct 25, 2023
2fd07da
Merge branch 'master' of github.com:informatics-isi-edu/chaise into 2…
RFSH Oct 25, 2023
9fcb4fc
add more columns to mulit-form-input + add comment for testSubmission…
RFSH Oct 25, 2023
7de2057
Phase 2: Test cases
Oct 26, 2023
4886ad8
Added text,int,float along with textarea
Nov 2, 2023
44164bc
Added text, int, float
Nov 3, 2023
9414627
Added all types
Nov 20, 2023
71b0e2b
Cleaning up promises
Nov 22, 2023
75bc773
Cleaning up promises 2nd commit
Nov 22, 2023
6ef4b70
Review comments
Nov 29, 2023
48a4575
fix issues in the code + complete test cases for the create case
RFSH Dec 1, 2023
7857d42
Merge branch 'master' of github.com:informatics-isi-edu/chaise into 2…
RFSH Dec 1, 2023
9b0fbcf
finalize the multi-form-input spec + fix the multi-edit test
RFSH Dec 1, 2023
96552f1
fix an issue in fk test + add test for upload
RFSH Dec 1, 2023
f9a9769
add condition to expected submission_results as we're not running ass…
RFSH Dec 1, 2023
63de612
fix the file test case to avoid doing browser.sleep + refactor the code
RFSH Dec 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/styles/scss/_recordedit-app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
/**
* make sure the table cells have the same width
*/
.shift-form, .select-all-row {
.shift-form, .multi-form-input-row {
display: flex;
width: 100%;
}
Expand Down
8 changes: 4 additions & 4 deletions src/assets/scss/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
}
}
}
// Optional: Group multiple button groups together for a toolbar

// Changing this to grid to set maximum two rows of wrapping buttons if width is less
.chaise-btn-toolbar {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
gap: 5px;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(100px, max-content));

.input-group {
width: auto;
Expand Down
4 changes: 3 additions & 1 deletion src/assets/scss/_inputs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@
// iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
opacity: 1;
cursor: not-allowed;

// We are adding this to fix the issue in firefox where the form is not clickable if its disabled
pointer-events: none;
RFSH marked this conversation as resolved.
Show resolved Hide resolved

// make sure the input is taking the input-disabled styles and not the default bootstrap/browser ones
// (using * so it selects input, textarea, or any other HTML element that we might have
*::placeholder, *:disabled {
Expand Down
164 changes: 152 additions & 12 deletions src/assets/scss/_recordedit.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@use 'helpers';

// From _recordedit-app.scss
.recordedit-container{
.recordedit-container {
.btn-sm[data-handler="bootstrap-markdown-cmdRidLink"] {
padding: 5px 3px;
}
Expand Down Expand Up @@ -104,28 +104,159 @@

&.highlighted-row {
background-color: map-get(variables.$color-map, 'recordedit-highlighted-row');
// We add this so that the multi-form-input-row spans across the entire view
max-width: none;
}

.inputs-row {
display: flex;
flex-direction: row;

// adding an overlay on top of form to add the click event
.form-overlay {
height: 100%;
width: 100%;
cursor: pointer;
// This rule is to overwrite cursor:not-allowed for toolbar.
.chaise-btn-toolbar {
pointer-events: none;
}
}
}

.select-all-row {
.multi-form-input-row {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 5px;
// Making it sticky so that it is fixed in its position and rest of the form conatiner scrolls horizontally
position: sticky;
top: 0;
left: 0;
// we are giving z-index 2, which is lower than the dropdown input values, so that they show up
z-index: map-get(variables.$z-index-map, 'multi-form-input-row');

.select-all-text, .select-all-input, .select-all-buttons {
float: left;
// Adding a div to align the content centre always
.centre-align {
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 5px;
max-width: 100%;
}

.select-all-text {
padding: 4px;
border: 1px solid transparent;
.centre-align-textarea {
width: auto;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain why this is needed. You should also move it to be inside .center-align rule above, like this:

.centre-align {
  ...

  &.centre-align-textarea {
    with: auto;
  }
}

& refers to the parent selector.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a child class for centre-align, it is a separate class for textarea

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. .centre-align-textarea is a more specific class that you're adding to only some .centre-align elements. That's why I wrote it as &.centre-align-textarea.

In scss just because you're writing a rule inside another one doesn't mean that it will always go another level deep. It just means start from there. & in here refers to .centre-align elements and by appending .centre-align-textarea to it, we're basically saying all the .centre-align.centre-align-textarea elements.

If I you were to just say .centre-align-textarea or & .centre-align-textarea then it would be different and not what we want.

Also let's use center instead of centre.

}

.select-all-input {
width: 250px;
margin: 0px 5px;
.multi-form-upper-row {
display: flex;
width: 100%;
justify-content: space-between;

.multi-form-input-checkbox-container {
display: flex;
align-items: center;
cursor: pointer;

.multi-form-input-checkbox {
display: flex;
align-items: center;

.checkbox-input {
position: relative;
margin: 0 5px 0 0;
width: 16px;
height: 16px;

// We are reducing the width and height to make it consitent with the text
&:before {
RFSH marked this conversation as resolved.
Show resolved Hide resolved
width: 16px;
height: 16px;
}

// adjusting the top and left to make the selection centre aligned in the checkbox
&:after {
top: -5px;
RFSH marked this conversation as resolved.
Show resolved Hide resolved
left: -1px;
}
}
}
.multi-form-input-how-to {
border-color: map-get(variables.$color-map, 'white')!important;
cursor: default;
margin-left: 5px;
color: map-get(variables.$color-map, 'how-to-multi-form');
}

.multi-form-input-how-to:hover {
z-index: auto !important;
}
}

.multi-form-input-button-container {
/**
* We are aligning the buttons always to the right of the container so that when the width is less it always
* aligns to the top right in the first row
*/
text-align: right;
}
}

.multi-form-input {
width: 100%;

// We follow the min-width given for multi-form-input-row which is 250px
textarea {
resize: both;
min-width: 250px;
RFSH marked this conversation as resolved.
Show resolved Hide resolved
max-width: 100%;
}
}


}

/**
* We are adding this rule to centre align the input area when the screen resolution is greater than 1800px.
* We also give a width to the input area of 1200px.
*/
@media (min-width: 1800px) {
RFSH marked this conversation as resolved.
Show resolved Hide resolved
.multi-form-input-row {
.centre-align {
width: 1200px;
}

.centre-align-textarea {
width: auto;
}

.multi-form-input {
textarea {
width: 1200px;
max-width: 100%;
}
}

.multi-form-input-textarea {
width: 100%;
}
}

}

@media (max-width: 1799px) {
.multi-form-input-row {
.multi-form-input-input {
width: 100%;

textarea {
max-width: 100%;
}
}
}
}
}
Expand Down Expand Up @@ -164,6 +295,7 @@
background: map-get(variables.$color-map, 'disabled-background');
opacity: 0.55;
}

.spinner-border-sm {
left: 50%;
top: 15px;
Expand All @@ -188,6 +320,12 @@
padding: 8px 10px;
}

// This is added to show the form is selected to apply the change
.entity-active {
outline: 2px solid map-get(variables.$color-map, 'primary');
outline-offset: -2px;
}

// only form inputs
.column-cell {
border-left: none;
Expand Down Expand Up @@ -221,6 +359,7 @@

.form-header-buttons-container {
float: right;

.remove-form-btn {
padding: 1px 7px 0px 7px;
}
Expand Down Expand Up @@ -265,7 +404,7 @@
}

@-moz-document url-prefix() {
#form-edit > table > tbody > tr > td:first-child {
#form-edit>table>tbody>tr>td:first-child {
margin-top: -1px;
}
}
Expand Down Expand Up @@ -330,4 +469,5 @@
// width: 0%;
// background-color: #8cacc7 !important;
// }
}

}
5 changes: 5 additions & 0 deletions src/assets/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,11 @@ html {
background-color: map-get(variables.$color-map, 'white');
}

&:indeterminate:before {
RFSH marked this conversation as resolved.
Show resolved Hide resolved
/* Style for indeterminate state */
background: none;
}

&:checked:after {
position: absolute;
top: -2px;
Expand Down
1 change: 1 addition & 0 deletions src/assets/scss/maps/_color-map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ $color-map: (
'vocab-background': rgba(220, 220, 220, 0.68),
'warning': #f0ad4e,
'white': #ffffff,
'how-to-multi-form': #000
RFSH marked this conversation as resolved.
Show resolved Hide resolved
);
2 changes: 2 additions & 0 deletions src/assets/scss/maps/_z-index-map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,6 @@ $z-index-map: (
'modal-error-backdrop-on-search-popup': 1061,
'modal-error-on-search-popup': 1066,

// higher than dropdown
'multi-form-input-row': 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move it up there. The values in this map are sorted for readability purposes.

)
Loading