Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
</fieldset>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Save</button>
<button type="submit" id=submitButton class="btn btn-primary">Save</button>
<button #closeModal type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,14 @@ export class DetailsFieldsComponent implements OnChanges, OnInit {
}

onSubmit() {

// Debounce submit (Save) button
const button = document.querySelector('#submitButton');
button.setAttribute('disabled', 'true');
setTimeout(() => {
button.removeAttribute('disabled');
}, 3000);

const emptyValue = '';
const { project_name, uri, description } = this.entryForm.value;
const areEmptyValues = [uri, description].every(item => item === emptyValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,26 @@ export class ProjectListHoverComponent implements OnInit, OnDestroy {
}

clockIn(selectedProject, customerName, name) {

// Debounce 'Clock In' buttons
const buttons = document.getElementsByClassName('btn btn-sm btn-primary btn-select');
for (const button of buttons) {
button.setAttribute('disabled', 'true');
}
setTimeout(() => {
for (const button of buttons) {
button.removeAttribute('disabled');
}
}, 3000);

const entry = {
project_id: selectedProject,
start_date: new Date().toISOString(),
timezone_offset: new Date().getTimezoneOffset(),
technologies: [],
activity_id: head(this.activities).id,
};

this.store.dispatch(new entryActions.ClockIn(entry));
this.projectsForm.setValue({ project_id: `${customerName} - ${name}` });
setTimeout(() => {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
],
"lib": [
"es2018",
"dom"
"dom",
"dom.Iterable"
]
},
"angularCompilerOptions": {
Expand Down