Skip to content

Commit 066af35

Browse files
Merge pull request #1727 from ral-facilities/remove-drawing-link-and-number-#1636
remove drawing link and number #1636
2 parents fa969eb + f703f94 commit 066af35

22 files changed

+31
-693
lines changed

cypress/e2e/with_api/catalogueItems/functions.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const modifyCatalogueItem = (
88
daysToReplace: string;
99
daysToRework?: string;
1010
expectedLifetimeDays?: string;
11-
drawingNumber?: string;
12-
drawingLink?: string;
1311
itemModelNumber?: string;
1412
notes?: string;
1513
manufacturer: string;
@@ -72,20 +70,6 @@ const modifyCatalogueItem = (
7270
cy.findByLabelText('Expected Lifetime (days)').clear();
7371
}
7472

75-
if (values.drawingNumber) {
76-
cy.findByLabelText('Drawing number').clear();
77-
cy.findByLabelText('Drawing number').type(values.drawingNumber);
78-
} else {
79-
cy.findByLabelText('Drawing number').clear();
80-
}
81-
82-
if (values.drawingLink) {
83-
cy.findByLabelText('Drawing link').clear();
84-
cy.findByLabelText('Drawing link').type(values.drawingLink);
85-
} else {
86-
cy.findByLabelText('Drawing link').clear();
87-
}
88-
8973
if (values.itemModelNumber) {
9074
cy.findByLabelText('Model number').clear();
9175
cy.findByLabelText('Model number').type(values.itemModelNumber);
@@ -152,11 +136,6 @@ const modifyCatalogueItem = (
152136
if (values.expectedLifetimeDays)
153137
cy.findByText(values.expectedLifetimeDays).should('exist');
154138

155-
if (values.drawingNumber)
156-
cy.findByText(values.drawingNumber).should('exist');
157-
158-
if (values.drawingLink) cy.findByText(values.drawingLink).should('exist');
159-
160139
if (values.itemModelNumber)
161140
cy.findByText(values.itemModelNumber).should('exist');
162141

@@ -311,8 +290,6 @@ export const addCatalogueItem = (ignoreChecks?: boolean) => {
311290
daysToReplace: '5',
312291
daysToRework: '1',
313292
expectedLifetimeDays: '365',
314-
drawingLink: 'https://example.com/',
315-
drawingNumber: 'GH45235324',
316293
itemModelNumber: 'rew5435453',
317294
notes: 'test',
318295
manufacturer: 'ThorsLabs',
@@ -334,8 +311,6 @@ export const editCatalogueItem = () => {
334311
costToReworkGbp: '20',
335312
daysToReplace: '5',
336313
expectedLifetimeDays: '365',
337-
drawingLink: 'https://example.com/',
338-
drawingNumber: 'GH4523566324',
339314
itemModelNumber: 'rew54359453',
340315
notes: 'test 2',
341316
manufacturer: 'ThorsLabs',

cypress/e2e/with_mock_data/catalogueItems.cy.ts

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ describe('Catalogue Items', () => {
2626
cy.findByLabelText('Time to replace (days) *').type('14');
2727
cy.findByLabelText('Time to rework (days)').type('5');
2828
cy.findByLabelText('Expected Lifetime (days)').type('345');
29-
cy.findByLabelText('Drawing number').type('MX43242');
30-
cy.findByLabelText('Drawing link').type('https://example.com');
3129
cy.findByLabelText('Model number').type('MXtest');
3230
cy.findByLabelText('Manufacturer *').click();
3331
cy.findByLabelText('Manufacturer *').type('Man{downArrow}{enter}');
@@ -66,8 +64,6 @@ describe('Catalogue Items', () => {
6664
days_to_replace: 14,
6765
days_to_rework: 5,
6866
expected_lifetime_days: 345,
69-
drawing_number: 'MX43242',
70-
drawing_link: 'https://example.com',
7167
item_model_number: 'MXtest',
7268
notes: 'This is a test note',
7369
properties: [
@@ -152,8 +148,6 @@ describe('Catalogue Items', () => {
152148
days_to_replace: 7,
153149
days_to_rework: 60,
154150
expected_lifetime_days: 3635,
155-
drawing_number: null,
156-
drawing_link: null,
157151
item_model_number: null,
158152
notes: 'Need to find new manufacturer. 27',
159153
properties: [
@@ -214,8 +208,6 @@ describe('Catalogue Items', () => {
214208
days_to_replace: 14,
215209
days_to_rework: null,
216210
expected_lifetime_days: null,
217-
drawing_number: null,
218-
drawing_link: null,
219211
item_model_number: null,
220212
notes: null,
221213
properties: [
@@ -281,8 +273,6 @@ describe('Catalogue Items', () => {
281273
days_to_replace: 14,
282274
days_to_rework: null,
283275
expected_lifetime_days: null,
284-
drawing_number: null,
285-
drawing_link: null,
286276
item_model_number: null,
287277
notes: null,
288278
properties: [
@@ -364,20 +354,15 @@ describe('Catalogue Items', () => {
364354
cy.findByLabelText('Cost (£) *').type('gfdg');
365355
cy.findByLabelText('Time to replace (days) *').type('32gf');
366356
cy.findByLabelText('Expected Lifetime (days)').clear();
367-
cy.findByLabelText('Drawing link').type('test.co.uk');
368357
cy.findByLabelText('Expected Lifetime (days)').type('friday');
369358

370359
cy.findAllByText('Please enter a valid number.').should(
371360
'have.length',
372361
3
373362
);
374-
cy.findAllByText(
375-
'Please enter a valid Drawing link. Only "http://" and "https://" links with typical top-level domain are accepted.'
376-
).should('exist');
377363
cy.findByRole('button', { name: 'Next' }).should('be.disabled');
378364

379365
// details - negative number input validation test
380-
cy.findByLabelText('Drawing link').clear();
381366
cy.findByLabelText('Cost (£) *').clear();
382367
cy.findByLabelText('Cost (£) *').type('-10');
383368
cy.findByLabelText('Cost to rework (£)').clear();
@@ -401,7 +386,6 @@ describe('Catalogue Items', () => {
401386
cy.findByLabelText('Time to replace (days) *').type('14');
402387
cy.findByLabelText('Cost to rework (£)').clear();
403388
cy.findByLabelText('Time to rework (days)').clear();
404-
cy.findByLabelText('Drawing link').type('https://test.co.uk');
405389
cy.findByLabelText('Expected Lifetime (days)').clear();
406390
cy.findByLabelText('Expected Lifetime (days)').type('200');
407391

@@ -518,23 +502,7 @@ describe('Catalogue Items', () => {
518502
cy.url().should('contain', '/manufacturers/1');
519503
});
520504

521-
it('checks the href property of the drawing link link', () => {
522-
cy.findByRole('button', { name: 'Show/Hide columns' }).click();
523-
cy.findByText('Hide all').click();
524-
525-
cy.findByText('Drawing Link').click();
526-
527-
// Find the link element
528-
cy.findAllByText('http://example-drawing-link.com')
529-
.first()
530-
.should('have.attr', 'href')
531-
.should('include', 'http://example-drawing-link.com'); // Check href attribute value
532-
533-
cy.findAllByText('http://example-drawing-link.com')
534-
.first()
535-
.should('have.attr', 'target')
536-
.should('include', '_blank'); // Check target attribute value
537-
});
505+
538506

539507
it('checks the href property of the manufacturer link', () => {
540508
cy.findByRole('button', { name: 'Show/Hide columns' }).click();
@@ -691,8 +659,6 @@ describe('Catalogue Items', () => {
691659
cy.findByLabelText('Time to rework (days)').type('5');
692660
cy.findByLabelText('Expected Lifetime (days)').clear();
693661
cy.findByLabelText('Expected Lifetime (days)').type('345');
694-
cy.findByLabelText('Drawing number').type('MX43242');
695-
cy.findByLabelText('Drawing link').type('https://example.com');
696662
cy.findByLabelText('Model number').type('MXtest');
697663
cy.findByLabelText('Manufacturer *').click();
698664
cy.findByLabelText('Manufacturer *').type(
@@ -722,8 +688,6 @@ describe('Catalogue Items', () => {
722688
days_to_replace: 71,
723689
days_to_rework: 605,
724690
expected_lifetime_days: 345,
725-
drawing_number: 'MX43242',
726-
drawing_link: 'https://example.com',
727691
item_model_number: 'MXtest',
728692
manufacturer_id: '1',
729693
notes: 'This is an updated note',
@@ -1130,8 +1094,6 @@ describe('Catalogue Items', () => {
11301094
days_to_replace: 7,
11311095
days_to_rework: null,
11321096
expected_lifetime_days: 3124,
1133-
drawing_number: null,
1134-
drawing_link: 'http://example-drawing-link.com',
11351097
item_model_number: null,
11361098
is_obsolete: true,
11371099
obsolete_replacement_catalogue_item_id: '6',
@@ -1158,8 +1120,6 @@ describe('Catalogue Items', () => {
11581120
days_to_replace: 7,
11591121
days_to_rework: 60,
11601122
expected_lifetime_days: 3635,
1161-
drawing_number: null,
1162-
drawing_link: null,
11631123
item_model_number: null,
11641124
is_obsolete: false,
11651125
obsolete_replacement_catalogue_item_id: null,

cypress/e2e/with_mock_data/items.cy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ describe('Items', () => {
7272
'High-resolution cameras for beam characterization. 1'
7373
).should('exist');
7474
cy.findByText('Obsolete reason').should('exist');
75-
cy.findByText('Drawing Number').should('exist');
7675

7776
cy.findByRole('link', { name: 'Cameras' }).click();
7877

src/api/api.types.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ export interface CatalogueItemPost {
197197
days_to_replace: number;
198198
days_to_rework?: number | null;
199199
expected_lifetime_days?: number | null;
200-
drawing_number?: string | null;
201-
drawing_link?: string | null;
202200
item_model_number?: string | null;
203201
is_obsolete: boolean;
204202
obsolete_reason?: string | null;

src/api/catalogueItems.test.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ describe('catalogue items api functions', () => {
4141
days_to_replace: 0,
4242
days_to_rework: null,
4343
expected_lifetime_days: null,
44-
drawing_link: null,
45-
drawing_number: null,
4644
notes: null,
4745
is_obsolete: false,
4846
item_model_number: null,
@@ -75,8 +73,6 @@ describe('catalogue items api functions', () => {
7573
days_to_replace: 0,
7674
days_to_rework: null,
7775
expected_lifetime_days: null,
78-
drawing_link: null,
79-
drawing_number: null,
8076
notes: null,
8177
is_obsolete: false,
8278
item_model_number: null,
@@ -160,8 +156,6 @@ describe('catalogue items api functions', () => {
160156
days_to_replace: 0,
161157
days_to_rework: null,
162158
expected_lifetime_days: null,
163-
drawing_link: null,
164-
drawing_number: null,
165159
notes: null,
166160
is_obsolete: false,
167161
item_model_number: null,
@@ -266,8 +260,6 @@ describe('catalogue items api functions', () => {
266260
days_to_replace: 2,
267261
days_to_rework: null,
268262
expected_lifetime_days: null,
269-
drawing_number: null,
270-
drawing_link: null,
271263
item_model_number: null,
272264
is_obsolete: false,
273265
notes: null,
@@ -296,8 +288,6 @@ describe('catalogue items api functions', () => {
296288
days_to_replace: 2,
297289
days_to_rework: null,
298290
expected_lifetime_days: null,
299-
drawing_number: null,
300-
drawing_link: null,
301291
item_model_number: null,
302292
is_obsolete: false,
303293
notes: null,
@@ -405,8 +395,6 @@ describe('catalogue items api functions', () => {
405395
days_to_replace: 2,
406396
days_to_rework: null,
407397
expected_lifetime_days: null,
408-
drawing_number: null,
409-
drawing_link: null,
410398
item_model_number: null,
411399
is_obsolete: false,
412400
obsolete_reason: null,
@@ -434,8 +422,6 @@ describe('catalogue items api functions', () => {
434422
days_to_replace: 2,
435423
days_to_rework: null,
436424
expected_lifetime_days: null,
437-
drawing_number: null,
438-
drawing_link: null,
439425
item_model_number: null,
440426
notes: null,
441427
is_obsolete: false,

src/app.types.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ export interface CatalogueItemDetailsStep {
107107
days_to_replace: string;
108108
days_to_rework?: string | null;
109109
expected_lifetime_days?: string | null;
110-
drawing_number?: string | null;
111-
drawing_link?: string | null;
112110
item_model_number?: string | null;
113111
notes?: string | null;
114112
}
@@ -122,8 +120,6 @@ export interface CatalogueItemDetailsStepPost {
122120
days_to_replace: number;
123121
days_to_rework?: number | null;
124122
expected_lifetime_days?: number | null;
125-
drawing_number?: string | null;
126-
drawing_link?: string | null;
127123
item_model_number?: string | null;
128124
notes?: string | null;
129125
}

0 commit comments

Comments
 (0)